提交 25a6838e 编写于 作者: L lana

Merge

...@@ -38,8 +38,14 @@ ifndef OPENJDK ...@@ -38,8 +38,14 @@ ifndef OPENJDK
endif endif
endif endif
JFR =
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
JFR = jfr
endif
endif
SUBDIRS = net nio util $(UCRYPTO) SUBDIRS = $(JFR) net nio util $(UCRYPTO)
include $(BUILDDIR)/common/Subdirs.gmk include $(BUILDDIR)/common/Subdirs.gmk
......
# #
# Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as # under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. # published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
# #
# This code is distributed in the hope that it will be useful, but WITHOUT # This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
...@@ -21,34 +23,51 @@ ...@@ -21,34 +23,51 @@
# questions. # questions.
# #
BUILDDIR = ../../..
PACKAGE = oracle.jrockit.jfr
LIBRARY = jfr
PRODUCT = oracle
include $(BUILDDIR)/common/Defs.gmk
#
# Use mapfile
#
FILES_m = $(CLOSED_SHARE_SRC)/native/oracle/jfr/mapfile-vers
include $(BUILDDIR)/common/Mapfile-vers.gmk
#
# Files to compile
#
FILES_c = VMJFR.c
AUTO_FILES_JAVA_DIRS = com/oracle/jrockit/jfr oracle/jrockit/jfr
# Find C source files
#
vpath %.c $(CLOSED_SHARE_SRC)/native/oracle/jfr
# #
# Library to compile.
# #
# This file is used by test i18nTest.sh; this file is called to use include $(BUILDDIR)/common/Library.gmk
# shell globbing to delete Java source and class files whose names
# include non-ASCII characters.
JVMLIB =
JAVALIB =
OTHER_LDLIBS =
# Verify directory context variables are set clean clobber::
if [ "${TESTJAVA}" = "" ] $(RM) -r $(CLASSDESTDIR)/com/oracle/jrockit/jfr
then $(RM) -r $(CLASSDESTDIR)/oracle/jrockit/jfr
echo "TESTJAVA not set. Test cannot execute. Failed."
exit 1
fi
if [ "${TESTSRC}" = "" ]
then
echo "TESTSRC not set. Test cannot execute. Failed."
exit 1
fi
# Copy pre-shipped .jfs files
JFR_LIBDIR = $(LIBDIR)/jfr
JFR_SRCDIR = $(CLOSED_SHARE_SRC)/lib/jfr
if [ "${TESTCLASSES}" = "" ] $(JFR_LIBDIR)/%.jfs: $(JFR_SRCDIR)/%.jfs
then $(install-file)
echo "TESTCLASSES not set. Test cannot execute. Failed."
exit 1
fi
rm -f i18n*.java JFS_FILES := $(subst $(JFR_SRCDIR),$(JFR_LIBDIR),$(wildcard $(JFR_SRCDIR)/*.jfs))
rm -f i18n*.class
all build : $(JFS_FILES)
...@@ -425,7 +425,12 @@ vpath %.$(OBJECT_SUFFIX) $(OBJDIR) ...@@ -425,7 +425,12 @@ vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific # namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
# relatives. # relatives.
# #
VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export VPATH0.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
ifdef OPENJDK
VPATH.h = $(VPATH0.h)
else
VPATH.h = $(CLOSED_SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(VPATH0.h)
endif
vpath %.h $(VPATH.h) vpath %.h $(VPATH.h)
# #
......
...@@ -381,6 +381,11 @@ TOOLS = \ ...@@ -381,6 +381,11 @@ TOOLS = \
sun/tools/jinfo \ sun/tools/jinfo \
sun/tools/jmap sun/tools/jmap
# classes that go into jfr.jar
JFR_CLASSES_DIRS= \
com/oracle/jrockit/jfr \
oracle/jrockit/jfr
# classes that go into jsse.jar # classes that go into jsse.jar
JSSE_CLASSES_DIRS = \ JSSE_CLASSES_DIRS = \
sun/security/provider/Sun.class \ sun/security/provider/Sun.class \
...@@ -583,6 +588,23 @@ $(NOT_RT_JAR_LIST): FRC ...@@ -583,6 +588,23 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "sun/tools/jstack/" >> $@ $(ECHO) "sun/tools/jstack/" >> $@
$(ECHO) "sun/tools/jinfo/" >> $@ $(ECHO) "sun/tools/jinfo/" >> $@
$(ECHO) "sun/tools/jmap/" >> $@ $(ECHO) "sun/tools/jmap/" >> $@
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
$(ECHO) "com/oracle/jrockit/jfr/" >> $@
$(ECHO) "com/oracle/jrockit/jfr/client/" >> $@
$(ECHO) "com/oracle/jrockit/jfr/management/" >> $@
$(ECHO) "oracle/jrockit/jfr/" >> $@
$(ECHO) "oracle/jrockit/jfr/events/" >> $@
$(ECHO) "oracle/jrockit/jfr/openmbean/" >> $@
$(ECHO) "oracle/jrockit/jfr/parser/" >> $@
$(ECHO) "oracle/jrockit/jfr/settings/" >> $@
$(ECHO) "oracle/jrockit/jfr/tools/" >> $@
$(ECHO) "oracle/jrockit/jfr/util/" >> $@
$(ECHO) "oracle/jrockit/jfr/util/log/" >> $@
$(ECHO) "oracle/jrockit/jfr/util/os/" >> $@
$(ECHO) "oracle/jrockit/jfr/util/text/" >> $@
endif
endif
# File order list for rt.jar # File order list for rt.jar
...@@ -607,6 +629,20 @@ $(TOTAL_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_RT_JAR_LIST) ...@@ -607,6 +629,20 @@ $(TOTAL_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_RT_JAR_LIST)
$(MV) $@.temp $@ $(MV) $@.temp $@
@($(CD) $(CLASSBINDIR) && $(java-vm-cleanup)) @($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))
# Create the jfr.jar containing Java Flight Recorder implementation
JFR_JAR=
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
JFR_JAR=$(ABS_TEMPDIR)/jfr-orig.jar
$(JFR_JAR): $(OTHER_JAR_MANIFEST_FILE)
$(prep-target)
$(CD) $(CLASSBINDIR) && \
$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(OTHER_JAR_MANIFEST_FILE) $@ \
$(JFR_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
endif
endif
# Create the rt.jar file list & non-class files list # Create the rt.jar file list & non-class files list
JARSPLIT_JARFILE = $(BUILDTOOLJARDIR)/jarsplit.jar JARSPLIT_JARFILE = $(BUILDTOOLJARDIR)/jarsplit.jar
...@@ -741,7 +777,7 @@ initial-image-jre-sol64:: initial-image-jre-setup ...@@ -741,7 +777,7 @@ initial-image-jre-sol64:: initial-image-jre-setup
# drive names like C: # drive names like C:
initial-image-jre:: initial-image-jre-setup \ initial-image-jre:: initial-image-jre-setup \
$(JRE_DOCFILES) \ $(JRE_DOCFILES) \
$(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) \ $(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) $(JFR_JAR) \
$(BUILDMETAINDEX_JARFILE) $(BUILDMETAINDEX_JARFILE)
@# Copy in bin directory @# Copy in bin directory
$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR) $(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
...@@ -769,6 +805,9 @@ initial-image-jre:: initial-image-jre-setup \ ...@@ -769,6 +805,9 @@ initial-image-jre:: initial-image-jre-setup \
$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar $(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar $(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar $(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
ifneq ($(JFR_JAR),)
$(CP) $(JFR_JAR) $(JRE_IMAGE_DIR)/lib/jfr.jar
endif
@# Generate meta-index to make boot and extension class loaders lazier @# Generate meta-index to make boot and extension class loaders lazier
$(CD) $(JRE_IMAGE_DIR)/lib && \ $(CD) $(JRE_IMAGE_DIR)/lib && \
$(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
......
...@@ -62,18 +62,32 @@ jprt.vm.default.test.targets= \ ...@@ -62,18 +62,32 @@ jprt.vm.default.test.targets= \
# Default jdk test targets (testset=default) # Default jdk test targets (testset=default)
jprt.make.rule.default.test.targets= \ jprt.make.rule.default.test.targets= \
${jprt.my.test.target.set:TESTNAME=jdk_beans1}, \
${jprt.my.test.target.set:TESTNAME=jdk_io}, \
${jprt.my.test.target.set:TESTNAME=jdk_lang}, \ ${jprt.my.test.target.set:TESTNAME=jdk_lang}, \
${jprt.my.test.target.set:TESTNAME=jdk_math}, \ ${jprt.my.test.target.set:TESTNAME=jdk_math}
${jprt.my.test.target.set:TESTNAME=jdk_misc}, \
# Default vm test targets (testset=core)
jprt.vm.core.test.targets= \
${jprt.vm.default.test.targets}
# Core jdk test targets (testset=core)
jprt.make.rule.core.test.targets= \
${jprt.make.rule.default.test.targets}, \
${jprt.my.test.target.set:TESTNAME=jdk_util}, \
${jprt.my.test.target.set:TESTNAME=jdk_io}, \
${jprt.my.test.target.set:TESTNAME=jdk_net}, \ ${jprt.my.test.target.set:TESTNAME=jdk_net}, \
${jprt.my.test.target.set:TESTNAME=jdk_nio1}, \ ${jprt.my.test.target.set:TESTNAME=jdk_nio1}, \
${jprt.my.test.target.set:TESTNAME=jdk_nio2}, \ ${jprt.my.test.target.set:TESTNAME=jdk_nio2}, \
${jprt.my.test.target.set:TESTNAME=jdk_nio3}, \ ${jprt.my.test.target.set:TESTNAME=jdk_nio3}, \
${jprt.my.test.target.set:TESTNAME=jdk_security1}, \ ${jprt.my.test.target.set:TESTNAME=jdk_security1}, \
${jprt.my.test.target.set:TESTNAME=jdk_security2}, \
${jprt.my.test.target.set:TESTNAME=jdk_security3}, \
${jprt.my.test.target.set:TESTNAME=jdk_rmi}, \
${jprt.my.test.target.set:TESTNAME=jdk_management1}, \
${jprt.my.test.target.set:TESTNAME=jdk_management2}, \
${jprt.my.test.target.set:TESTNAME=jdk_text}, \ ${jprt.my.test.target.set:TESTNAME=jdk_text}, \
${jprt.my.test.target.set:TESTNAME=jdk_util} ${jprt.my.test.target.set:TESTNAME=jdk_tools1}, \
${jprt.my.test.target.set:TESTNAME=jdk_tools2}, \
${jprt.my.test.target.set:TESTNAME=jdk_misc}
# All vm test targets (testset=all) # All vm test targets (testset=all)
jprt.vm.all.test.targets= \ jprt.vm.all.test.targets= \
...@@ -83,19 +97,13 @@ jprt.vm.all.test.targets= \ ...@@ -83,19 +97,13 @@ jprt.vm.all.test.targets= \
# All jdk test targets (testset=all) # All jdk test targets (testset=all)
jprt.make.rule.all.test.targets= \ jprt.make.rule.all.test.targets= \
${jprt.make.rule.default.test.targets}, \ ${jprt.make.rule.core.test.targets}, \
${jprt.my.test.target.set:TESTNAME=jdk_awt}, \ ${jprt.my.test.target.set:TESTNAME=jdk_awt}, \
${jprt.my.test.target.set:TESTNAME=jdk_beans1}, \
${jprt.my.test.target.set:TESTNAME=jdk_beans2}, \ ${jprt.my.test.target.set:TESTNAME=jdk_beans2}, \
${jprt.my.test.target.set:TESTNAME=jdk_beans3}, \ ${jprt.my.test.target.set:TESTNAME=jdk_beans3}, \
${jprt.my.test.target.set:TESTNAME=jdk_management1}, \
${jprt.my.test.target.set:TESTNAME=jdk_management2}, \
${jprt.my.test.target.set:TESTNAME=jdk_rmi}, \
${jprt.my.test.target.set:TESTNAME=jdk_security2}, \
${jprt.my.test.target.set:TESTNAME=jdk_security3}, \
${jprt.my.test.target.set:TESTNAME=jdk_sound}, \ ${jprt.my.test.target.set:TESTNAME=jdk_sound}, \
${jprt.my.test.target.set:TESTNAME=jdk_swing}, \ ${jprt.my.test.target.set:TESTNAME=jdk_swing}
${jprt.my.test.target.set:TESTNAME=jdk_tools1}, \
${jprt.my.test.target.set:TESTNAME=jdk_tools2}
# JCK test targets in test/Makefile (no windows) # JCK test targets in test/Makefile (no windows)
jprt.my.jck.test.target.set= \ jprt.my.jck.test.target.set= \
......
...@@ -148,8 +148,8 @@ public class TransformXPath2Filter extends TransformSpi { ...@@ -148,8 +148,8 @@ public class TransformXPath2Filter extends TransformSpi {
} }
input.addNodeFilter(new XPath2NodeFilter(convertNodeListToSet(unionNodes), input.addNodeFilter(new XPath2NodeFilter(unionNodes, substractNodes,
convertNodeListToSet(substractNodes),convertNodeListToSet(intersectNodes))); intersectNodes));
input.setNodeSet(true); input.setNodeSet(true);
return input; return input;
} catch (TransformerException ex) { } catch (TransformerException ex) {
...@@ -170,32 +170,20 @@ public class TransformXPath2Filter extends TransformSpi { ...@@ -170,32 +170,20 @@ public class TransformXPath2Filter extends TransformSpi {
throw new TransformationException("empty", ex); throw new TransformationException("empty", ex);
} }
} }
static Set<Node> convertNodeListToSet(List<NodeList> l){
Set<Node> result=new HashSet<Node>();
for (NodeList rootNodes : l) {
int length = rootNodes.getLength();
for (int i = 0; i < length; i++) {
Node rootNode = rootNodes.item(i);
result.add(rootNode);
}
}
return result;
}
} }
class XPath2NodeFilter implements NodeFilter { class XPath2NodeFilter implements NodeFilter {
boolean hasUnionNodes; boolean hasUnionFilter;
boolean hasSubstractNodes; boolean hasSubstractFilter;
boolean hasIntersectNodes; boolean hasIntersectFilter;
XPath2NodeFilter(Set<Node> unionNodes, Set<Node> substractNodes, XPath2NodeFilter(List<NodeList> unionNodes, List<NodeList> substractNodes,
Set<Node> intersectNodes) { List<NodeList> intersectNodes) {
this.unionNodes=unionNodes; hasUnionFilter=!unionNodes.isEmpty();
hasUnionNodes=!unionNodes.isEmpty(); this.unionNodes=convertNodeListToSet(unionNodes);
this.substractNodes=substractNodes; hasSubstractFilter=!substractNodes.isEmpty();
hasSubstractNodes=!substractNodes.isEmpty(); this.substractNodes=convertNodeListToSet(substractNodes);
this.intersectNodes=intersectNodes; hasIntersectFilter=!intersectNodes.isEmpty();
hasIntersectNodes=!intersectNodes.isEmpty(); this.intersectNodes=convertNodeListToSet(intersectNodes);
} }
Set<Node> unionNodes; Set<Node> unionNodes;
Set<Node> substractNodes; Set<Node> substractNodes;
...@@ -208,16 +196,16 @@ class XPath2NodeFilter implements NodeFilter { ...@@ -208,16 +196,16 @@ class XPath2NodeFilter implements NodeFilter {
public int isNodeInclude(Node currentNode) { public int isNodeInclude(Node currentNode) {
int result=1; int result=1;
if (hasSubstractNodes && rooted(currentNode, substractNodes)) { if (hasSubstractFilter && rooted(currentNode, substractNodes)) {
result = -1; result = -1;
} else if (hasIntersectNodes && !rooted(currentNode, intersectNodes)) { } else if (hasIntersectFilter && !rooted(currentNode, intersectNodes)) {
result = 0; result = 0;
} }
//TODO OPTIMIZE //TODO OPTIMIZE
if (result==1) if (result==1)
return 1; return 1;
if (hasUnionNodes) { if (hasUnionFilter) {
if (rooted(currentNode, unionNodes)) { if (rooted(currentNode, unionNodes)) {
return 1; return 1;
} }
...@@ -231,7 +219,7 @@ class XPath2NodeFilter implements NodeFilter { ...@@ -231,7 +219,7 @@ class XPath2NodeFilter implements NodeFilter {
int inUnion=-1; int inUnion=-1;
public int isNodeIncludeDO(Node n, int level) { public int isNodeIncludeDO(Node n, int level) {
int result=1; int result=1;
if (hasSubstractNodes) { if (hasSubstractFilter) {
if ((inSubstract==-1) || (level<=inSubstract)) { if ((inSubstract==-1) || (level<=inSubstract)) {
if (inList(n, substractNodes)) { if (inList(n, substractNodes)) {
inSubstract=level; inSubstract=level;
...@@ -244,7 +232,7 @@ class XPath2NodeFilter implements NodeFilter { ...@@ -244,7 +232,7 @@ class XPath2NodeFilter implements NodeFilter {
} }
} }
if (result!=-1){ if (result!=-1){
if (hasIntersectNodes) { if (hasIntersectFilter) {
if ((inIntersect==-1) || (level<=inIntersect)) { if ((inIntersect==-1) || (level<=inIntersect)) {
if (!inList(n, intersectNodes)) { if (!inList(n, intersectNodes)) {
inIntersect=-1; inIntersect=-1;
...@@ -260,7 +248,7 @@ class XPath2NodeFilter implements NodeFilter { ...@@ -260,7 +248,7 @@ class XPath2NodeFilter implements NodeFilter {
inUnion=-1; inUnion=-1;
if (result==1) if (result==1)
return 1; return 1;
if (hasUnionNodes) { if (hasUnionFilter) {
if ((inUnion==-1) && inList(n, unionNodes)) { if ((inUnion==-1) && inList(n, unionNodes)) {
inUnion=level; inUnion=level;
} }
...@@ -280,6 +268,9 @@ class XPath2NodeFilter implements NodeFilter { ...@@ -280,6 +268,9 @@ class XPath2NodeFilter implements NodeFilter {
* @return if rooted bye the rootnodes * @return if rooted bye the rootnodes
*/ */
static boolean rooted(Node currentNode, Set<Node> nodeList ) { static boolean rooted(Node currentNode, Set<Node> nodeList ) {
if (nodeList.isEmpty()) {
return false;
}
if (nodeList.contains(currentNode)) { if (nodeList.contains(currentNode)) {
return true; return true;
} }
...@@ -302,4 +293,17 @@ class XPath2NodeFilter implements NodeFilter { ...@@ -302,4 +293,17 @@ class XPath2NodeFilter implements NodeFilter {
static boolean inList(Node currentNode, Set<Node> nodeList ) { static boolean inList(Node currentNode, Set<Node> nodeList ) {
return nodeList.contains(currentNode); return nodeList.contains(currentNode);
} }
private static Set<Node> convertNodeListToSet(List<NodeList> l){
Set<Node> result=new HashSet<Node>();
for (NodeList rootNodes : l) {
int length = rootNodes.getLength();
for (int i = 0; i < length; i++) {
Node rootNode = rootNodes.item(i);
result.add(rootNode);
}
}
return result;
}
} }
...@@ -6431,7 +6431,8 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -6431,7 +6431,8 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* @see #setKeyColumns * @see #setKeyColumns
*/ */
public int[] getKeyColumns() throws SQLException { public int[] getKeyColumns() throws SQLException {
return keyCols; int[]keyColumns = this.keyCols;
return (keyColumns == null) ? null : Arrays.copyOf(keyColumns, keyColumns.length);
} }
......
/* /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -27,6 +27,7 @@ package com.sun.rowset.internal; ...@@ -27,6 +27,7 @@ package com.sun.rowset.internal;
import java.sql.*; import java.sql.*;
import java.io.*; import java.io.*;
import java.util.Arrays;
/** /**
* The abstract base class from which the classes <code>Row</code> * The abstract base class from which the classes <code>Row</code>
...@@ -65,7 +66,8 @@ public abstract class BaseRow implements Serializable, Cloneable { ...@@ -65,7 +66,8 @@ public abstract class BaseRow implements Serializable, Cloneable {
* original values * original values
*/ */
public Object[] getOrigRow() { public Object[] getOrigRow() {
return origVals; Object[] origRow = this.origVals;
return (origRow == null) ? null: Arrays.copyOf(origRow, origRow.length);
} }
/** /**
......
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -48,7 +48,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable { ...@@ -48,7 +48,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
* for this field is set with the <code>java.io.Writer</code> object given * for this field is set with the <code>java.io.Writer</code> object given
* as the second argument to the <code>writeXML</code> method. * as the second argument to the <code>writeXML</code> method.
*/ */
private java.io.Writer writer; private transient java.io.Writer writer;
/** /**
* The <code>java.util.Stack</code> object that this <code>WebRowSetXmlWriter</code> * The <code>java.util.Stack</code> object that this <code>WebRowSetXmlWriter</code>
...@@ -205,16 +205,11 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable { ...@@ -205,16 +205,11 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
//Changed to beginSection and endSection for maps for proper indentation //Changed to beginSection and endSection for maps for proper indentation
beginSection("map"); beginSection("map");
java.util.Map<?,?> typeMap = caller.getTypeMap(); Map<String, Class<?>> typeMap = caller.getTypeMap();
if (typeMap != null) { if(typeMap != null) {
Iterator<?> i = typeMap.keySet().iterator(); for(Map.Entry<String, Class<?>> mm : typeMap.entrySet()) {
Class<?> c; propString("type", mm.getKey());
String type; propString("class", mm.getValue().getName());
while (i.hasNext()) {
type = (String)i.next();
c = (Class)typeMap.get(type);
propString("type", type);
propString("class", c.getName());
} }
} }
endSection("map"); endSection("map");
......
/* /*
* Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -30,13 +30,13 @@ package java.io; ...@@ -30,13 +30,13 @@ package java.io;
* functionality of keeping track of the current line number. * functionality of keeping track of the current line number.
* <p> * <p>
* A line is a sequence of bytes ending with a carriage return * A line is a sequence of bytes ending with a carriage return
* character (<code>'&#92;r'</code>), a newline character * character ({@code '\u005Cr'}), a newline character
* (<code>'&#92;n'</code>), or a carriage return character followed * ({@code '\u005Cn'}), or a carriage return character followed
* immediately by a linefeed character. In all three cases, the line * immediately by a linefeed character. In all three cases, the line
* terminating character(s) are returned as a single newline character. * terminating character(s) are returned as a single newline character.
* <p> * <p>
* The line number begins at <code>0</code>, and is incremented by * The line number begins at {@code 0}, and is incremented by
* <code>1</code> when a <code>read</code> returns a newline character. * {@code 1} when a {@code read} returns a newline character.
* *
* @author Arthur van Hoff * @author Arthur van Hoff
* @see java.io.LineNumberReader * @see java.io.LineNumberReader
...@@ -66,22 +66,22 @@ class LineNumberInputStream extends FilterInputStream { ...@@ -66,22 +66,22 @@ class LineNumberInputStream extends FilterInputStream {
/** /**
* Reads the next byte of data from this input stream. The value * Reads the next byte of data from this input stream. The value
* byte is returned as an <code>int</code> in the range * byte is returned as an {@code int} in the range
* <code>0</code> to <code>255</code>. If no byte is available * {@code 0} to {@code 255}. If no byte is available
* because the end of the stream has been reached, the value * because the end of the stream has been reached, the value
* <code>-1</code> is returned. This method blocks until input data * {@code -1} is returned. This method blocks until input data
* is available, the end of the stream is detected, or an exception * is available, the end of the stream is detected, or an exception
* is thrown. * is thrown.
* <p> * <p>
* The <code>read</code> method of * The {@code read} method of
* <code>LineNumberInputStream</code> calls the <code>read</code> * {@code LineNumberInputStream} calls the {@code read}
* method of the underlying input stream. It checks for carriage * method of the underlying input stream. It checks for carriage
* returns and newline characters in the input, and modifies the * returns and newline characters in the input, and modifies the
* current line number as appropriate. A carriage-return character or * current line number as appropriate. A carriage-return character or
* a carriage return followed by a newline character are both * a carriage return followed by a newline character are both
* converted into a single newline character. * converted into a single newline character.
* *
* @return the next byte of data, or <code>-1</code> if the end of this * @return the next byte of data, or {@code -1} if the end of this
* stream is reached. * stream is reached.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* @see java.io.FilterInputStream#in * @see java.io.FilterInputStream#in
...@@ -111,18 +111,18 @@ class LineNumberInputStream extends FilterInputStream { ...@@ -111,18 +111,18 @@ class LineNumberInputStream extends FilterInputStream {
} }
/** /**
* Reads up to <code>len</code> bytes of data from this input stream * Reads up to {@code len} bytes of data from this input stream
* into an array of bytes. This method blocks until some input is available. * into an array of bytes. This method blocks until some input is available.
* <p> * <p>
* The <code>read</code> method of * The {@code read} method of
* <code>LineNumberInputStream</code> repeatedly calls the * {@code LineNumberInputStream} repeatedly calls the
* <code>read</code> method of zero arguments to fill in the byte array. * {@code read} method of zero arguments to fill in the byte array.
* *
* @param b the buffer into which the data is read. * @param b the buffer into which the data is read.
* @param off the start offset of the data. * @param off the start offset of the data.
* @param len the maximum number of bytes read. * @param len the maximum number of bytes read.
* @return the total number of bytes read into the buffer, or * @return the total number of bytes read into the buffer, or
* <code>-1</code> if there is no more data because the end of * {@code -1} if there is no more data because the end of
* this stream has been reached. * this stream has been reached.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* @see java.io.LineNumberInputStream#read() * @see java.io.LineNumberInputStream#read()
...@@ -160,15 +160,15 @@ class LineNumberInputStream extends FilterInputStream { ...@@ -160,15 +160,15 @@ class LineNumberInputStream extends FilterInputStream {
} }
/** /**
* Skips over and discards <code>n</code> bytes of data from this * Skips over and discards {@code n} bytes of data from this
* input stream. The <code>skip</code> method may, for a variety of * input stream. The {@code skip} method may, for a variety of
* reasons, end up skipping over some smaller number of bytes, * reasons, end up skipping over some smaller number of bytes,
* possibly <code>0</code>. The actual number of bytes skipped is * possibly {@code 0}. The actual number of bytes skipped is
* returned. If <code>n</code> is negative, no bytes are skipped. * returned. If {@code n} is negative, no bytes are skipped.
* <p> * <p>
* The <code>skip</code> method of <code>LineNumberInputStream</code> creates * The {@code skip} method of {@code LineNumberInputStream} creates
* a byte array and then repeatedly reads into it until * a byte array and then repeatedly reads into it until
* <code>n</code> bytes have been read or the end of the stream has * {@code n} bytes have been read or the end of the stream has
* been reached. * been reached.
* *
* @param n the number of bytes to be skipped. * @param n the number of bytes to be skipped.
...@@ -225,12 +225,12 @@ class LineNumberInputStream extends FilterInputStream { ...@@ -225,12 +225,12 @@ class LineNumberInputStream extends FilterInputStream {
* <p> * <p>
* Note that if the underlying input stream is able to supply * Note that if the underlying input stream is able to supply
* <i>k</i> input characters without blocking, the * <i>k</i> input characters without blocking, the
* <code>LineNumberInputStream</code> can guarantee only to provide * {@code LineNumberInputStream} can guarantee only to provide
* <i>k</i>/2 characters without blocking, because the * <i>k</i>/2 characters without blocking, because the
* <i>k</i> characters from the underlying input stream might * <i>k</i> characters from the underlying input stream might
* consist of <i>k</i>/2 pairs of <code>'&#92;r'</code> and * consist of <i>k</i>/2 pairs of {@code '\u005Cr'} and
* <code>'&#92;n'</code>, which are converted to just * {@code '\u005Cn'}, which are converted to just
* <i>k</i>/2 <code>'&#92;n'</code> characters. * <i>k</i>/2 {@code '\u005Cn'} characters.
* *
* @return the number of bytes that can be read from this input stream * @return the number of bytes that can be read from this input stream
* without blocking. * without blocking.
...@@ -243,12 +243,12 @@ class LineNumberInputStream extends FilterInputStream { ...@@ -243,12 +243,12 @@ class LineNumberInputStream extends FilterInputStream {
/** /**
* Marks the current position in this input stream. A subsequent * Marks the current position in this input stream. A subsequent
* call to the <code>reset</code> method repositions this stream at * call to the {@code reset} method repositions this stream at
* the last marked position so that subsequent reads re-read the same bytes. * the last marked position so that subsequent reads re-read the same bytes.
* <p> * <p>
* The <code>mark</code> method of * The {@code mark} method of
* <code>LineNumberInputStream</code> remembers the current line * {@code LineNumberInputStream} remembers the current line
* number in a private variable, and then calls the <code>mark</code> * number in a private variable, and then calls the {@code mark}
* method of the underlying input stream. * method of the underlying input stream.
* *
* @param readlimit the maximum limit of bytes that can be read before * @param readlimit the maximum limit of bytes that can be read before
...@@ -264,12 +264,12 @@ class LineNumberInputStream extends FilterInputStream { ...@@ -264,12 +264,12 @@ class LineNumberInputStream extends FilterInputStream {
/** /**
* Repositions this stream to the position at the time the * Repositions this stream to the position at the time the
* <code>mark</code> method was last called on this input stream. * {@code mark} method was last called on this input stream.
* <p> * <p>
* The <code>reset</code> method of * The {@code reset} method of
* <code>LineNumberInputStream</code> resets the line number to be * {@code LineNumberInputStream} resets the line number to be
* the line number at the time the <code>mark</code> method was * the line number at the time the {@code mark} method was
* called, and then calls the <code>reset</code> method of the * called, and then calls the {@code reset} method of the
* underlying input stream. * underlying input stream.
* <p> * <p>
* Stream marks are intended to be used in * Stream marks are intended to be used in
......
/* /*
* Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,7 +28,7 @@ package java.io; ...@@ -28,7 +28,7 @@ package java.io;
import java.util.Arrays; import java.util.Arrays;
/** /**
* The <code>StreamTokenizer</code> class takes an input stream and * The {@code StreamTokenizer} class takes an input stream and
* parses it into "tokens", allowing the tokens to be * parses it into "tokens", allowing the tokens to be
* read one at a time. The parsing process is controlled by a table * read one at a time. The parsing process is controlled by a table
* and a number of flags that can be set to various states. The * and a number of flags that can be set to various states. The
...@@ -36,7 +36,7 @@ import java.util.Arrays; ...@@ -36,7 +36,7 @@ import java.util.Arrays;
* strings, and various comment styles. * strings, and various comment styles.
* <p> * <p>
* Each byte read from the input stream is regarded as a character * Each byte read from the input stream is regarded as a character
* in the range <code>'&#92;u0000'</code> through <code>'&#92;u00FF'</code>. * in the range {@code '\u005Cu0000'} through {@code '\u005Cu00FF'}.
* The character value is used to look up five possible attributes of * The character value is used to look up five possible attributes of
* the character: <i>white space</i>, <i>alphabetic</i>, * the character: <i>white space</i>, <i>alphabetic</i>,
* <i>numeric</i>, <i>string quote</i>, and <i>comment character</i>. * <i>numeric</i>, <i>string quote</i>, and <i>comment character</i>.
...@@ -53,8 +53,8 @@ import java.util.Arrays; ...@@ -53,8 +53,8 @@ import java.util.Arrays;
* <p> * <p>
* A typical application first constructs an instance of this class, * A typical application first constructs an instance of this class,
* sets up the syntax tables, and then repeatedly loops calling the * sets up the syntax tables, and then repeatedly loops calling the
* <code>nextToken</code> method in each iteration of the loop until * {@code nextToken} method in each iteration of the loop until
* it returns the value <code>TT_EOF</code>. * it returns the value {@code TT_EOF}.
* *
* @author James Gosling * @author James Gosling
* @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#nextToken()
...@@ -99,19 +99,19 @@ public class StreamTokenizer { ...@@ -99,19 +99,19 @@ public class StreamTokenizer {
private static final byte CT_COMMENT = 16; private static final byte CT_COMMENT = 16;
/** /**
* After a call to the <code>nextToken</code> method, this field * After a call to the {@code nextToken} method, this field
* contains the type of the token just read. For a single character * contains the type of the token just read. For a single character
* token, its value is the single character, converted to an integer. * token, its value is the single character, converted to an integer.
* For a quoted string token, its value is the quote character. * For a quoted string token, its value is the quote character.
* Otherwise, its value is one of the following: * Otherwise, its value is one of the following:
* <ul> * <ul>
* <li><code>TT_WORD</code> indicates that the token is a word. * <li>{@code TT_WORD} indicates that the token is a word.
* <li><code>TT_NUMBER</code> indicates that the token is a number. * <li>{@code TT_NUMBER} indicates that the token is a number.
* <li><code>TT_EOL</code> indicates that the end of line has been read. * <li>{@code TT_EOL} indicates that the end of line has been read.
* The field can only have this value if the * The field can only have this value if the
* <code>eolIsSignificant</code> method has been called with the * {@code eolIsSignificant} method has been called with the
* argument <code>true</code>. * argument {@code true}.
* <li><code>TT_EOF</code> indicates that the end of the input stream * <li>{@code TT_EOF} indicates that the end of the input stream
* has been reached. * has been reached.
* </ul> * </ul>
* <p> * <p>
...@@ -160,8 +160,8 @@ public class StreamTokenizer { ...@@ -160,8 +160,8 @@ public class StreamTokenizer {
* the string. * the string.
* <p> * <p>
* The current token is a word when the value of the * The current token is a word when the value of the
* <code>ttype</code> field is <code>TT_WORD</code>. The current token is * {@code ttype} field is {@code TT_WORD}. The current token is
* a quoted string token when the value of the <code>ttype</code> field is * a quoted string token when the value of the {@code ttype} field is
* a quote character. * a quote character.
* <p> * <p>
* The initial value of this field is null. * The initial value of this field is null.
...@@ -175,7 +175,7 @@ public class StreamTokenizer { ...@@ -175,7 +175,7 @@ public class StreamTokenizer {
/** /**
* If the current token is a number, this field contains the value * If the current token is a number, this field contains the value
* of that number. The current token is a number when the value of * of that number. The current token is a number when the value of
* the <code>ttype</code> field is <code>TT_NUMBER</code>. * the {@code ttype} field is {@code TT_NUMBER}.
* <p> * <p>
* The initial value of this field is 0.0. * The initial value of this field is 0.0.
* *
...@@ -201,14 +201,14 @@ public class StreamTokenizer { ...@@ -201,14 +201,14 @@ public class StreamTokenizer {
* stream. The stream tokenizer is initialized to the following * stream. The stream tokenizer is initialized to the following
* default state: * default state:
* <ul> * <ul>
* <li>All byte values <code>'A'</code> through <code>'Z'</code>, * <li>All byte values {@code 'A'} through {@code 'Z'},
* <code>'a'</code> through <code>'z'</code>, and * {@code 'a'} through {@code 'z'}, and
* <code>'&#92;u00A0'</code> through <code>'&#92;u00FF'</code> are * {@code '\u005Cu00A0'} through {@code '\u005Cu00FF'} are
* considered to be alphabetic. * considered to be alphabetic.
* <li>All byte values <code>'&#92;u0000'</code> through * <li>All byte values {@code '\u005Cu0000'} through
* <code>'&#92;u0020'</code> are considered to be white space. * {@code '\u005Cu0020'} are considered to be white space.
* <li><code>'/'</code> is a comment character. * <li>{@code '/'} is a comment character.
* <li>Single quote <code>'&#92;''</code> and double quote <code>'"'</code> * <li>Single quote {@code '\u005C''} and double quote {@code '"'}
* are string quote characters. * are string quote characters.
* <li>Numbers are parsed. * <li>Numbers are parsed.
* <li>Ends of lines are treated as white space, not as separate tokens. * <li>Ends of lines are treated as white space, not as separate tokens.
...@@ -252,7 +252,7 @@ public class StreamTokenizer { ...@@ -252,7 +252,7 @@ public class StreamTokenizer {
/** /**
* Resets this tokenizer's syntax table so that all characters are * Resets this tokenizer's syntax table so that all characters are
* "ordinary." See the <code>ordinaryChar</code> method * "ordinary." See the {@code ordinaryChar} method
* for more information on a character being ordinary. * for more information on a character being ordinary.
* *
* @see java.io.StreamTokenizer#ordinaryChar(int) * @see java.io.StreamTokenizer#ordinaryChar(int)
...@@ -305,7 +305,7 @@ public class StreamTokenizer { ...@@ -305,7 +305,7 @@ public class StreamTokenizer {
* Specifies that all characters <i>c</i> in the range * Specifies that all characters <i>c</i> in the range
* <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code> * <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code>
* are "ordinary" in this tokenizer. See the * are "ordinary" in this tokenizer. See the
* <code>ordinaryChar</code> method for more information on a * {@code ordinaryChar} method for more information on a
* character being ordinary. * character being ordinary.
* *
* @param low the low end of the range. * @param low the low end of the range.
...@@ -327,12 +327,12 @@ public class StreamTokenizer { ...@@ -327,12 +327,12 @@ public class StreamTokenizer {
* character has as a comment character, word component, string * character has as a comment character, word component, string
* delimiter, white space, or number character. When such a character * delimiter, white space, or number character. When such a character
* is encountered by the parser, the parser treats it as a * is encountered by the parser, the parser treats it as a
* single-character token and sets <code>ttype</code> field to the * single-character token and sets {@code ttype} field to the
* character value. * character value.
* *
* <p>Making a line terminator character "ordinary" may interfere * <p>Making a line terminator character "ordinary" may interfere
* with the ability of a <code>StreamTokenizer</code> to count * with the ability of a {@code StreamTokenizer} to count
* lines. The <code>lineno</code> method may no longer reflect * lines. The {@code lineno} method may no longer reflect
* the presence of such terminator characters in its line count. * the presence of such terminator characters in its line count.
* *
* @param ch the character. * @param ch the character.
...@@ -361,9 +361,9 @@ public class StreamTokenizer { ...@@ -361,9 +361,9 @@ public class StreamTokenizer {
* Specifies that matching pairs of this character delimit string * Specifies that matching pairs of this character delimit string
* constants in this tokenizer. * constants in this tokenizer.
* <p> * <p>
* When the <code>nextToken</code> method encounters a string * When the {@code nextToken} method encounters a string
* constant, the <code>ttype</code> field is set to the string * constant, the {@code ttype} field is set to the string
* delimiter and the <code>sval</code> field is set to the body of * delimiter and the {@code sval} field is set to the body of
* the string. * the string.
* <p> * <p>
* If a string quote character is encountered, then a string is * If a string quote character is encountered, then a string is
...@@ -371,7 +371,7 @@ public class StreamTokenizer { ...@@ -371,7 +371,7 @@ public class StreamTokenizer {
* the string quote character, up to (but not including) the next * the string quote character, up to (but not including) the next
* occurrence of that same string quote character, or a line * occurrence of that same string quote character, or a line
* terminator, or end of file. The usual escape sequences such as * terminator, or end of file. The usual escape sequences such as
* <code>"&#92;n"</code> and <code>"&#92;t"</code> are recognized and * {@code "\u005Cn"} and {@code "\u005Ct"} are recognized and
* converted to single characters as the string is parsed. * converted to single characters as the string is parsed.
* *
* <p>Any other attribute settings for the specified character are cleared. * <p>Any other attribute settings for the specified character are cleared.
...@@ -398,9 +398,9 @@ public class StreamTokenizer { ...@@ -398,9 +398,9 @@ public class StreamTokenizer {
* <p> * <p>
* When the parser encounters a word token that has the format of a * When the parser encounters a word token that has the format of a
* double precision floating-point number, it treats the token as a * double precision floating-point number, it treats the token as a
* number rather than a word, by setting the <code>ttype</code> * number rather than a word, by setting the {@code ttype}
* field to the value <code>TT_NUMBER</code> and putting the numeric * field to the value {@code TT_NUMBER} and putting the numeric
* value of the token into the <code>nval</code> field. * value of the token into the {@code nval} field.
* *
* @see java.io.StreamTokenizer#nval * @see java.io.StreamTokenizer#nval
* @see java.io.StreamTokenizer#TT_NUMBER * @see java.io.StreamTokenizer#TT_NUMBER
...@@ -416,21 +416,21 @@ public class StreamTokenizer { ...@@ -416,21 +416,21 @@ public class StreamTokenizer {
/** /**
* Determines whether or not ends of line are treated as tokens. * Determines whether or not ends of line are treated as tokens.
* If the flag argument is true, this tokenizer treats end of lines * If the flag argument is true, this tokenizer treats end of lines
* as tokens; the <code>nextToken</code> method returns * as tokens; the {@code nextToken} method returns
* <code>TT_EOL</code> and also sets the <code>ttype</code> field to * {@code TT_EOL} and also sets the {@code ttype} field to
* this value when an end of line is read. * this value when an end of line is read.
* <p> * <p>
* A line is a sequence of characters ending with either a * A line is a sequence of characters ending with either a
* carriage-return character (<code>'&#92;r'</code>) or a newline * carriage-return character ({@code '\u005Cr'}) or a newline
* character (<code>'&#92;n'</code>). In addition, a carriage-return * character ({@code '\u005Cn'}). In addition, a carriage-return
* character followed immediately by a newline character is treated * character followed immediately by a newline character is treated
* as a single end-of-line token. * as a single end-of-line token.
* <p> * <p>
* If the <code>flag</code> is false, end-of-line characters are * If the {@code flag} is false, end-of-line characters are
* treated as white space and serve only to separate tokens. * treated as white space and serve only to separate tokens.
* *
* @param flag <code>true</code> indicates that end-of-line characters * @param flag {@code true} indicates that end-of-line characters
* are separate tokens; <code>false</code> indicates that * are separate tokens; {@code false} indicates that
* end-of-line characters are white space. * end-of-line characters are white space.
* @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#nextToken()
* @see java.io.StreamTokenizer#ttype * @see java.io.StreamTokenizer#ttype
...@@ -442,14 +442,14 @@ public class StreamTokenizer { ...@@ -442,14 +442,14 @@ public class StreamTokenizer {
/** /**
* Determines whether or not the tokenizer recognizes C-style comments. * Determines whether or not the tokenizer recognizes C-style comments.
* If the flag argument is <code>true</code>, this stream tokenizer * If the flag argument is {@code true}, this stream tokenizer
* recognizes C-style comments. All text between successive * recognizes C-style comments. All text between successive
* occurrences of <code>/*</code> and <code>*&#47;</code> are discarded. * occurrences of {@code /*} and <code>*&#47;</code> are discarded.
* <p> * <p>
* If the flag argument is <code>false</code>, then C-style comments * If the flag argument is {@code false}, then C-style comments
* are not treated specially. * are not treated specially.
* *
* @param flag <code>true</code> indicates to recognize and ignore * @param flag {@code true} indicates to recognize and ignore
* C-style comments. * C-style comments.
*/ */
public void slashStarComments(boolean flag) { public void slashStarComments(boolean flag) {
...@@ -458,15 +458,15 @@ public class StreamTokenizer { ...@@ -458,15 +458,15 @@ public class StreamTokenizer {
/** /**
* Determines whether or not the tokenizer recognizes C++-style comments. * Determines whether or not the tokenizer recognizes C++-style comments.
* If the flag argument is <code>true</code>, this stream tokenizer * If the flag argument is {@code true}, this stream tokenizer
* recognizes C++-style comments. Any occurrence of two consecutive * recognizes C++-style comments. Any occurrence of two consecutive
* slash characters (<code>'/'</code>) is treated as the beginning of * slash characters ({@code '/'}) is treated as the beginning of
* a comment that extends to the end of the line. * a comment that extends to the end of the line.
* <p> * <p>
* If the flag argument is <code>false</code>, then C++-style * If the flag argument is {@code false}, then C++-style
* comments are not treated specially. * comments are not treated specially.
* *
* @param flag <code>true</code> indicates to recognize and ignore * @param flag {@code true} indicates to recognize and ignore
* C++-style comments. * C++-style comments.
*/ */
public void slashSlashComments(boolean flag) { public void slashSlashComments(boolean flag) {
...@@ -475,16 +475,16 @@ public class StreamTokenizer { ...@@ -475,16 +475,16 @@ public class StreamTokenizer {
/** /**
* Determines whether or not word token are automatically lowercased. * Determines whether or not word token are automatically lowercased.
* If the flag argument is <code>true</code>, then the value in the * If the flag argument is {@code true}, then the value in the
* <code>sval</code> field is lowercased whenever a word token is * {@code sval} field is lowercased whenever a word token is
* returned (the <code>ttype</code> field has the * returned (the {@code ttype} field has the
* value <code>TT_WORD</code> by the <code>nextToken</code> method * value {@code TT_WORD} by the {@code nextToken} method
* of this tokenizer. * of this tokenizer.
* <p> * <p>
* If the flag argument is <code>false</code>, then the * If the flag argument is {@code false}, then the
* <code>sval</code> field is not modified. * {@code sval} field is not modified.
* *
* @param fl <code>true</code> indicates that all word tokens should * @param fl {@code true} indicates that all word tokens should
* be lowercased. * be lowercased.
* @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#nextToken()
* @see java.io.StreamTokenizer#ttype * @see java.io.StreamTokenizer#ttype
...@@ -506,9 +506,9 @@ public class StreamTokenizer { ...@@ -506,9 +506,9 @@ public class StreamTokenizer {
/** /**
* Parses the next token from the input stream of this tokenizer. * Parses the next token from the input stream of this tokenizer.
* The type of the next token is returned in the <code>ttype</code> * The type of the next token is returned in the {@code ttype}
* field. Additional information about the token may be in the * field. Additional information about the token may be in the
* <code>nval</code> field or the <code>sval</code> field of this * {@code nval} field or the {@code sval} field of this
* tokenizer. * tokenizer.
* <p> * <p>
* Typical clients of this * Typical clients of this
...@@ -516,7 +516,7 @@ public class StreamTokenizer { ...@@ -516,7 +516,7 @@ public class StreamTokenizer {
* calling nextToken to parse successive tokens until TT_EOF * calling nextToken to parse successive tokens until TT_EOF
* is returned. * is returned.
* *
* @return the value of the <code>ttype</code> field. * @return the value of the {@code ttype} field.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* @see java.io.StreamTokenizer#nval * @see java.io.StreamTokenizer#nval
* @see java.io.StreamTokenizer#sval * @see java.io.StreamTokenizer#sval
...@@ -752,10 +752,10 @@ public class StreamTokenizer { ...@@ -752,10 +752,10 @@ public class StreamTokenizer {
} }
/** /**
* Causes the next call to the <code>nextToken</code> method of this * Causes the next call to the {@code nextToken} method of this
* tokenizer to return the current value in the <code>ttype</code> * tokenizer to return the current value in the {@code ttype}
* field, and not to modify the value in the <code>nval</code> or * field, and not to modify the value in the {@code nval} or
* <code>sval</code> field. * {@code sval} field.
* *
* @see java.io.StreamTokenizer#nextToken() * @see java.io.StreamTokenizer#nextToken()
* @see java.io.StreamTokenizer#nval * @see java.io.StreamTokenizer#nval
......
/* /*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -110,8 +110,8 @@ public final class Byte extends Number implements Comparable<Byte> { ...@@ -110,8 +110,8 @@ public final class Byte extends Number implements Comparable<Byte> {
* determined by whether {@link java.lang.Character#digit(char, * determined by whether {@link java.lang.Character#digit(char,
* int)} returns a nonnegative value) except that the first * int)} returns a nonnegative value) except that the first
* character may be an ASCII minus sign {@code '-'} * character may be an ASCII minus sign {@code '-'}
* (<code>'&#92;u002D'</code>) to indicate a negative value or an * ({@code '\u005Cu002D'}) to indicate a negative value or an
* ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code byte} value is * indicate a positive value. The resulting {@code byte} value is
* returned. * returned.
* *
...@@ -127,8 +127,8 @@ public final class Byte extends Number implements Comparable<Byte> { ...@@ -127,8 +127,8 @@ public final class Byte extends Number implements Comparable<Byte> {
* *
* <li> Any character of the string is not a digit of the * <li> Any character of the string is not a digit of the
* specified radix, except that the first character may be a minus * specified radix, except that the first character may be a minus
* sign {@code '-'} (<code>'&#92;u002D'</code>) or plus sign * sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the * {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1. * string is longer than length 1.
* *
* <li> The value represented by the string is not a value of type * <li> The value represented by the string is not a value of type
...@@ -157,9 +157,9 @@ public final class Byte extends Number implements Comparable<Byte> { ...@@ -157,9 +157,9 @@ public final class Byte extends Number implements Comparable<Byte> {
* Parses the string argument as a signed decimal {@code * Parses the string argument as a signed decimal {@code
* byte}. The characters in the string must all be decimal digits, * byte}. The characters in the string must all be decimal digits,
* except that the first character may be an ASCII minus sign * except that the first character may be an ASCII minus sign
* {@code '-'} (<code>'&#92;u002D'</code>) to indicate a negative * {@code '-'} ({@code '\u005Cu002D'}) to indicate a negative
* value or an ASCII plus sign {@code '+'} * value or an ASCII plus sign {@code '+'}
* (<code>'&#92;u002B'</code>) to indicate a positive value. The * ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code byte} value is returned, exactly as if the * resulting {@code byte} value is returned, exactly as if the
* argument and the radix 10 were given as arguments to the {@link * argument and the radix 10 were given as arguments to the {@link
* #parseByte(java.lang.String, int)} method. * #parseByte(java.lang.String, int)} method.
...@@ -445,6 +445,47 @@ public final class Byte extends Number implements Comparable<Byte> { ...@@ -445,6 +445,47 @@ public final class Byte extends Number implements Comparable<Byte> {
return x - y; return x - y;
} }
/**
* Converts the argument to an {@code int} by an unsigned
* conversion. In an unsigned conversion to an {@code int}, the
* high-order 24 bits of the {@code int} are zero and the
* low-order 8 bits are equal to the bits of the {@code byte} argument.
*
* Consequently, zero and positive {@code byte} values are mapped
* to a numerically equal {@code int} value and negative {@code
* byte} values are mapped to an {@code int} value equal to the
* input plus 2<sup>8</sup>.
*
* @param x the value to convert to an unsigned {@code int}
* @return the argument converted to {@code int} by an unsigned
* conversion
* @since 1.8
*/
public static int toUnsignedInt(byte x) {
return ((int) x) & 0xff;
}
/**
* Converts the argument to a {@code long} by an unsigned
* conversion. In an unsigned conversion to a {@code long}, the
* high-order 56 bits of the {@code long} are zero and the
* low-order 8 bits are equal to the bits of the {@code byte} argument.
*
* Consequently, zero and positive {@code byte} values are mapped
* to a numerically equal {@code long} value and negative {@code
* byte} values are mapped to a {@code long} value equal to the
* input plus 2<sup>8</sup>.
*
* @param x the value to convert to an unsigned {@code long}
* @return the argument converted to {@code long} by an unsigned
* conversion
* @since 1.8
*/
public static long toUnsignedLong(byte x) {
return ((long) x) & 0xffL;
}
/** /**
* The number of bits used to represent a {@code byte} value in two's * The number of bits used to represent a {@code byte} value in two's
* complement binary form. * complement binary form.
......
/* /*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -140,7 +140,7 @@ public final class Double extends Number implements Comparable<Double> { ...@@ -140,7 +140,7 @@ public final class Double extends Number implements Comparable<Double> {
* <li>Otherwise, the result is a string that represents the sign and * <li>Otherwise, the result is a string that represents the sign and
* magnitude (absolute value) of the argument. If the sign is negative, * magnitude (absolute value) of the argument. If the sign is negative,
* the first character of the result is '{@code -}' * the first character of the result is '{@code -}'
* (<code>'&#92;u002D'</code>); if the sign is positive, no sign character * ({@code '\u005Cu002D'}); if the sign is positive, no sign character
* appears in the result. As for the magnitude <i>m</i>: * appears in the result. As for the magnitude <i>m</i>:
* <ul> * <ul>
* <li>If <i>m</i> is infinity, it is represented by the characters * <li>If <i>m</i> is infinity, it is represented by the characters
...@@ -156,7 +156,7 @@ public final class Double extends Number implements Comparable<Double> { ...@@ -156,7 +156,7 @@ public final class Double extends Number implements Comparable<Double> {
* <li>If <i>m</i> is greater than or equal to 10<sup>-3</sup> but less * <li>If <i>m</i> is greater than or equal to 10<sup>-3</sup> but less
* than 10<sup>7</sup>, then it is represented as the integer part of * than 10<sup>7</sup>, then it is represented as the integer part of
* <i>m</i>, in decimal form with no leading zeroes, followed by * <i>m</i>, in decimal form with no leading zeroes, followed by
* '{@code .}' (<code>'&#92;u002E'</code>), followed by one or * '{@code .}' ({@code '\u005Cu002E'}), followed by one or
* more decimal digits representing the fractional part of <i>m</i>. * more decimal digits representing the fractional part of <i>m</i>.
* *
* <li>If <i>m</i> is less than 10<sup>-3</sup> or greater than or * <li>If <i>m</i> is less than 10<sup>-3</sup> or greater than or
...@@ -168,9 +168,9 @@ public final class Double extends Number implements Comparable<Double> { ...@@ -168,9 +168,9 @@ public final class Double extends Number implements Comparable<Double> {
* 10<sup><i>n</i></sup> so that 1 &le; <i>a</i> {@literal <} 10. The * 10<sup><i>n</i></sup> so that 1 &le; <i>a</i> {@literal <} 10. The
* magnitude is then represented as the integer part of <i>a</i>, * magnitude is then represented as the integer part of <i>a</i>,
* as a single decimal digit, followed by '{@code .}' * as a single decimal digit, followed by '{@code .}'
* (<code>'&#92;u002E'</code>), followed by decimal digits * ({@code '\u005Cu002E'}), followed by decimal digits
* representing the fractional part of <i>a</i>, followed by the * representing the fractional part of <i>a</i>, followed by the
* letter '{@code E}' (<code>'&#92;u0045'</code>), followed * letter '{@code E}' ({@code '\u005Cu0045'}), followed
* by a representation of <i>n</i> as a decimal integer, as * by a representation of <i>n</i> as a decimal integer, as
* produced by the method {@link Integer#toString(int)}. * produced by the method {@link Integer#toString(int)}.
* </ul> * </ul>
...@@ -208,7 +208,7 @@ public final class Double extends Number implements Comparable<Double> { ...@@ -208,7 +208,7 @@ public final class Double extends Number implements Comparable<Double> {
* <li>Otherwise, the result is a string that represents the sign * <li>Otherwise, the result is a string that represents the sign
* and magnitude of the argument. If the sign is negative, the * and magnitude of the argument. If the sign is negative, the
* first character of the result is '{@code -}' * first character of the result is '{@code -}'
* (<code>'&#92;u002D'</code>); if the sign is positive, no sign * ({@code '\u005Cu002D'}); if the sign is positive, no sign
* character appears in the result. As for the magnitude <i>m</i>: * character appears in the result. As for the magnitude <i>m</i>:
* *
* <ul> * <ul>
......
/* /*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -138,7 +138,7 @@ public final class Float extends Number implements Comparable<Float> { ...@@ -138,7 +138,7 @@ public final class Float extends Number implements Comparable<Float> {
* <li>Otherwise, the result is a string that represents the sign and * <li>Otherwise, the result is a string that represents the sign and
* magnitude (absolute value) of the argument. If the sign is * magnitude (absolute value) of the argument. If the sign is
* negative, the first character of the result is * negative, the first character of the result is
* '{@code -}' (<code>'&#92;u002D'</code>); if the sign is * '{@code -}' ({@code '\u005Cu002D'}); if the sign is
* positive, no sign character appears in the result. As for * positive, no sign character appears in the result. As for
* the magnitude <i>m</i>: * the magnitude <i>m</i>:
* <ul> * <ul>
...@@ -154,7 +154,7 @@ public final class Float extends Number implements Comparable<Float> { ...@@ -154,7 +154,7 @@ public final class Float extends Number implements Comparable<Float> {
* less than 10<sup>7</sup>, then it is represented as the * less than 10<sup>7</sup>, then it is represented as the
* integer part of <i>m</i>, in decimal form with no leading * integer part of <i>m</i>, in decimal form with no leading
* zeroes, followed by '{@code .}' * zeroes, followed by '{@code .}'
* (<code>'&#92;u002E'</code>), followed by one or more * ({@code '\u005Cu002E'}), followed by one or more
* decimal digits representing the fractional part of * decimal digits representing the fractional part of
* <i>m</i>. * <i>m</i>.
* <li> If <i>m</i> is less than 10<sup>-3</sup> or greater than or * <li> If <i>m</i> is less than 10<sup>-3</sup> or greater than or
...@@ -166,10 +166,10 @@ public final class Float extends Number implements Comparable<Float> { ...@@ -166,10 +166,10 @@ public final class Float extends Number implements Comparable<Float> {
* 10<sup><i>n</i></sup> so that 1 &le; <i>a</i> {@literal <} 10. * 10<sup><i>n</i></sup> so that 1 &le; <i>a</i> {@literal <} 10.
* The magnitude is then represented as the integer part of * The magnitude is then represented as the integer part of
* <i>a</i>, as a single decimal digit, followed by * <i>a</i>, as a single decimal digit, followed by
* '{@code .}' (<code>'&#92;u002E'</code>), followed by * '{@code .}' ({@code '\u005Cu002E'}), followed by
* decimal digits representing the fractional part of * decimal digits representing the fractional part of
* <i>a</i>, followed by the letter '{@code E}' * <i>a</i>, followed by the letter '{@code E}'
* (<code>'&#92;u0045'</code>), followed by a representation * ({@code '\u005Cu0045'}), followed by a representation
* of <i>n</i> as a decimal integer, as produced by the * of <i>n</i> as a decimal integer, as produced by the
* method {@link java.lang.Integer#toString(int)}. * method {@link java.lang.Integer#toString(int)}.
* *
...@@ -210,7 +210,7 @@ public final class Float extends Number implements Comparable<Float> { ...@@ -210,7 +210,7 @@ public final class Float extends Number implements Comparable<Float> {
* <li>Otherwise, the result is a string that represents the sign and * <li>Otherwise, the result is a string that represents the sign and
* magnitude (absolute value) of the argument. If the sign is negative, * magnitude (absolute value) of the argument. If the sign is negative,
* the first character of the result is '{@code -}' * the first character of the result is '{@code -}'
* (<code>'&#92;u002D'</code>); if the sign is positive, no sign character * ({@code '\u005Cu002D'}); if the sign is positive, no sign character
* appears in the result. As for the magnitude <i>m</i>: * appears in the result. As for the magnitude <i>m</i>:
* *
* <ul> * <ul>
......
/* /*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -80,8 +80,8 @@ public final class Short extends Number implements Comparable<Short> { ...@@ -80,8 +80,8 @@ public final class Short extends Number implements Comparable<Short> {
* determined by whether {@link java.lang.Character#digit(char, * determined by whether {@link java.lang.Character#digit(char,
* int)} returns a nonnegative value) except that the first * int)} returns a nonnegative value) except that the first
* character may be an ASCII minus sign {@code '-'} * character may be an ASCII minus sign {@code '-'}
* (<code>'&#92;u002D'</code>) to indicate a negative value or an * ({@code '\u005Cu002D'}) to indicate a negative value or an
* ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code short} value * indicate a positive value. The resulting {@code short} value
* is returned. * is returned.
* *
...@@ -97,8 +97,8 @@ public final class Short extends Number implements Comparable<Short> { ...@@ -97,8 +97,8 @@ public final class Short extends Number implements Comparable<Short> {
* *
* <li> Any character of the string is not a digit of the * <li> Any character of the string is not a digit of the
* specified radix, except that the first character may be a minus * specified radix, except that the first character may be a minus
* sign {@code '-'} (<code>'&#92;u002D'</code>) or plus sign * sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the * {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1. * string is longer than length 1.
* *
* <li> The value represented by the string is not a value of type * <li> The value represented by the string is not a value of type
...@@ -126,9 +126,9 @@ public final class Short extends Number implements Comparable<Short> { ...@@ -126,9 +126,9 @@ public final class Short extends Number implements Comparable<Short> {
* Parses the string argument as a signed decimal {@code * Parses the string argument as a signed decimal {@code
* short}. The characters in the string must all be decimal * short}. The characters in the string must all be decimal
* digits, except that the first character may be an ASCII minus * digits, except that the first character may be an ASCII minus
* sign {@code '-'} (<code>'&#92;u002D'</code>) to indicate a * sign {@code '-'} ({@code '\u005Cu002D'}) to indicate a
* negative value or an ASCII plus sign {@code '+'} * negative value or an ASCII plus sign {@code '+'}
* (<code>'&#92;u002B'</code>) to indicate a positive value. The * ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code short} value is returned, exactly as if the * resulting {@code short} value is returned, exactly as if the
* argument and the radix 10 were given as arguments to the {@link * argument and the radix 10 were given as arguments to the {@link
* #parseShort(java.lang.String, int)} method. * #parseShort(java.lang.String, int)} method.
...@@ -469,6 +469,47 @@ public final class Short extends Number implements Comparable<Short> { ...@@ -469,6 +469,47 @@ public final class Short extends Number implements Comparable<Short> {
return (short) (((i & 0xFF00) >> 8) | (i << 8)); return (short) (((i & 0xFF00) >> 8) | (i << 8));
} }
/**
* Converts the argument to an {@code int} by an unsigned
* conversion. In an unsigned conversion to an {@code int}, the
* high-order 16 bits of the {@code int} are zero and the
* low-order 16 bits are equal to the bits of the {@code short} argument.
*
* Consequently, zero and positive {@code short} values are mapped
* to a numerically equal {@code int} value and negative {@code
* short} values are mapped to an {@code int} value equal to the
* input plus 2<sup>16</sup>.
*
* @param x the value to convert to an unsigned {@code int}
* @return the argument converted to {@code int} by an unsigned
* conversion
* @since 1.8
*/
public static int toUnsignedInt(short x) {
return ((int) x) & 0xffff;
}
/**
* Converts the argument to a {@code long} by an unsigned
* conversion. In an unsigned conversion to a {@code long}, the
* high-order 48 bits of the {@code long} are zero and the
* low-order 16 bits are equal to the bits of the {@code short} argument.
*
* Consequently, zero and positive {@code short} values are mapped
* to a numerically equal {@code long} value and negative {@code
* short} values are mapped to a {@code long} value equal to the
* input plus 2<sup>16</sup>.
*
* @param x the value to convert to an unsigned {@code long}
* @return the argument converted to {@code long} by an unsigned
* conversion
* @since 1.8
*/
public static long toUnsignedLong(short x) {
return ((long) x) & 0xffffL;
}
/** use serialVersionUID from JDK 1.1. for interoperability */ /** use serialVersionUID from JDK 1.1. for interoperability */
private static final long serialVersionUID = 7515723908773894738L; private static final long serialVersionUID = 7515723908773894738L;
} }
/* /*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1646,8 +1646,7 @@ public class SimpleDateFormat extends DateFormat { ...@@ -1646,8 +1646,7 @@ public class SimpleDateFormat extends DateFormat {
// determine the local time. (6645292) // determine the local time. (6645292)
int dstAmount = (nameIndex >= 3) ? tz.getDSTSavings() : 0; int dstAmount = (nameIndex >= 3) ? tz.getDSTSavings() : 0;
if (!(useSameName || (nameIndex >= 3 && dstAmount == 0))) { if (!(useSameName || (nameIndex >= 3 && dstAmount == 0))) {
calb.set(Calendar.ZONE_OFFSET, tz.getRawOffset()) calb.set(Calendar.DST_OFFSET, dstAmount);
.set(Calendar.DST_OFFSET, dstAmount);
} }
return (start + zoneNames[nameIndex].length()); return (start + zoneNames[nameIndex].length());
} }
......
...@@ -2705,7 +2705,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca ...@@ -2705,7 +2705,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
* removed from the serialization stream; this will probably happen in the * removed from the serialization stream; this will probably happen in the
* near future. * near future.
*/ */
private void writeObject(ObjectOutputStream stream) private synchronized void writeObject(ObjectOutputStream stream)
throws IOException throws IOException
{ {
// Try to compute the time correctly, for the future (stream // Try to compute the time correctly, for the future (stream
......
...@@ -106,7 +106,15 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V> ...@@ -106,7 +106,15 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
/** /**
* Distinguished non-null value for representing null values. * Distinguished non-null value for representing null values.
*/ */
private static final Object NULL = new Integer(0); private static final Object NULL = new Object() {
public int hashCode() {
return 0;
}
public String toString() {
return "java.util.EnumMap.NULL";
}
};
private Object maskNull(Object value) { private Object maskNull(Object value) {
return (value == null ? NULL : value); return (value == null ? NULL : value);
......
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
package javax.crypto; package javax.crypto;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.regex.*; import java.util.regex.*;
...@@ -389,16 +391,15 @@ public class Cipher { ...@@ -389,16 +391,15 @@ public class Cipher {
return matches(regexp, value) ? S_YES : S_NO; return matches(regexp, value) ? S_YES : S_NO;
} }
// Map<String,Pattern> for previously compiled patterns // ConcurrentMap<String,Pattern> for previously compiled patterns
// XXX use ConcurrentHashMap once available private final static ConcurrentMap<String, Pattern> patternCache =
private final static Map<String, Pattern> patternCache = new ConcurrentHashMap<String, Pattern>();
Collections.synchronizedMap(new HashMap<String, Pattern>());
private static boolean matches(String regexp, String str) { private static boolean matches(String regexp, String str) {
Pattern pattern = patternCache.get(regexp); Pattern pattern = patternCache.get(regexp);
if (pattern == null) { if (pattern == null) {
pattern = Pattern.compile(regexp); pattern = Pattern.compile(regexp);
patternCache.put(regexp, pattern); patternCache.putIfAbsent(regexp, pattern);
} }
return pattern.matcher(str.toUpperCase(Locale.ENGLISH)).matches(); return pattern.matcher(str.toUpperCase(Locale.ENGLISH)).matches();
} }
......
/* /*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
package javax.sql.rowset.serial; package javax.sql.rowset.serial;
import java.sql.*; import java.sql.*;
import java.util.Arrays;
import java.util.Map; import java.util.Map;
/** /**
...@@ -119,7 +120,7 @@ public class SQLInputImpl implements SQLInput { ...@@ -119,7 +120,7 @@ public class SQLInputImpl implements SQLInput {
"object with null parameters"); "object with null parameters");
} }
// assign our local reference to the attribute stream // assign our local reference to the attribute stream
attrib = attributes; attrib = Arrays.copyOf(attributes, attributes.length);
// init the index point before the head of the stream // init the index point before the head of the stream
idx = -1; idx = -1;
// set the map // set the map
......
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -25,11 +25,10 @@ ...@@ -25,11 +25,10 @@
package javax.sql.rowset.serial; package javax.sql.rowset.serial;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.*; import java.sql.*;
import javax.sql.*;
import java.io.*;
import java.lang.String;
import java.math.*;
import java.util.Map; import java.util.Map;
import java.util.Vector; import java.util.Vector;
...@@ -444,16 +443,15 @@ public class SQLOutputImpl implements SQLOutput { ...@@ -444,16 +443,15 @@ public class SQLOutputImpl implements SQLOutput {
* will need to track if a field is SQL null for itself * will need to track if a field is SQL null for itself
*/ */
if (x == null) { if (x == null) {
attribs.add(x); attribs.add(null);
return; } else {
/*
* We have to write out a SerialStruct that contains
* the name of this class otherwise we don't know
* what to re-instantiate during readSQL()
*/
attribs.add(new SerialStruct(x, map));
} }
/*
* We have to write out a SerialStruct that contains
* the name of this class otherwise we don't know
* what to re-instantiate during readSQL()
*/
attribs.add(new SerialStruct(x, map));
} }
/** /**
...@@ -470,10 +468,10 @@ public class SQLOutputImpl implements SQLOutput { ...@@ -470,10 +468,10 @@ public class SQLOutputImpl implements SQLOutput {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void writeRef(Ref x) throws SQLException { public void writeRef(Ref x) throws SQLException {
if (x == null) { if (x == null) {
attribs.add(x); attribs.add(null);
return; } else {
attribs.add(new SerialRef(x));
} }
attribs.add(new SerialRef(x));
} }
/** /**
...@@ -490,10 +488,10 @@ public class SQLOutputImpl implements SQLOutput { ...@@ -490,10 +488,10 @@ public class SQLOutputImpl implements SQLOutput {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void writeBlob(Blob x) throws SQLException { public void writeBlob(Blob x) throws SQLException {
if (x == null) { if (x == null) {
attribs.add(x); attribs.add(null);
return; } else {
attribs.add(new SerialBlob(x));
} }
attribs.add(new SerialBlob(x));
} }
/** /**
...@@ -510,10 +508,10 @@ public class SQLOutputImpl implements SQLOutput { ...@@ -510,10 +508,10 @@ public class SQLOutputImpl implements SQLOutput {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void writeClob(Clob x) throws SQLException { public void writeClob(Clob x) throws SQLException {
if (x == null) { if (x == null) {
attribs.add(x); attribs.add(null);
return; } else {
attribs.add(new SerialClob(x));
} }
attribs.add(new SerialClob(x));
} }
/** /**
...@@ -554,10 +552,10 @@ public class SQLOutputImpl implements SQLOutput { ...@@ -554,10 +552,10 @@ public class SQLOutputImpl implements SQLOutput {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void writeArray(Array x) throws SQLException { public void writeArray(Array x) throws SQLException {
if (x == null) { if (x == null) {
attribs.add(x); attribs.add(null);
return; } else {
attribs.add(new SerialArray(x, map));
} }
attribs.add(new SerialArray(x, map));
} }
/** /**
...@@ -574,11 +572,10 @@ public class SQLOutputImpl implements SQLOutput { ...@@ -574,11 +572,10 @@ public class SQLOutputImpl implements SQLOutput {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void writeURL(java.net.URL url) throws SQLException { public void writeURL(java.net.URL url) throws SQLException {
if (url == null) { if (url == null) {
attribs.add(url); attribs.add(null);
return; } else {
attribs.add(new SerialDatalink(url));
} }
attribs.add(new SerialDatalink(url));
} }
......
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -29,6 +29,7 @@ import java.sql.*; ...@@ -29,6 +29,7 @@ import java.sql.*;
import javax.sql.*; import javax.sql.*;
import java.io.*; import java.io.*;
import java.math.*; import java.math.*;
import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.Vector; import java.util.Vector;
...@@ -174,7 +175,8 @@ public class SerialStruct implements Struct, Serializable, Cloneable { ...@@ -174,7 +175,8 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
* @throws SerialException if an error occurs * @throws SerialException if an error occurs
*/ */
public Object[] getAttributes() throws SerialException { public Object[] getAttributes() throws SerialException {
return attribs; Object[] val = this.attribs;
return (val == null) ? null : Arrays.copyOf(val, val.length);
} }
/** /**
...@@ -197,7 +199,8 @@ public class SerialStruct implements Struct, Serializable, Cloneable { ...@@ -197,7 +199,8 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
public Object[] getAttributes(Map<String,Class<?>> map) public Object[] getAttributes(Map<String,Class<?>> map)
throws SerialException throws SerialException
{ {
return attribs; Object[] val = this.attribs;
return (val == null) ? null : Arrays.copyOf(val, val.length);
} }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册