This commit is contained in:
Lana Steuck 2014-06-05 19:37:32 -07:00
commit 0878f5e840
158 changed files with 2711 additions and 1757 deletions

View File

@ -74,19 +74,16 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
# The old builds implementation of this did not preserve symlinks so
# make sure they are followed and the contents copied instead.
# To fix this, remove -L
# Copy empty directories (jre/lib/applet).
$(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D)
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
$(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D)
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
$(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)

View File

@ -373,7 +373,7 @@ ifndef OPENJDK
JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
SRC := $(JDK_OUTPUTDIR)/gensrc_ab/32bit, \
BIN := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/32))
$(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
@ -382,7 +382,7 @@ ifndef OPENJDK
JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
SRC := $(JDK_OUTPUTDIR)/gensrc_ab/legacy, \
BIN := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/legacy))
$(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
@ -393,7 +393,7 @@ ifndef OPENJDK
JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
SRC := $(JDK_OUTPUTDIR)/gensrc_ab/64bit, \
BIN := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/64))
$(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)

View File

@ -428,7 +428,7 @@ ifeq ($(USE_EXTERNAL_LIBZ), true)
UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
UNPACKEXE_ZIPOBJS := -lz
else
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
@ -442,11 +442,6 @@ else
endif
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
UNPACKEXE_CFLAGS += -xregs=no%appl
UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
endif
UNPACKEXE_LANG := C
ifeq ($(OPENJDK_TARGET_OS), solaris)
UNPACKEXE_LANG := C++

View File

@ -552,40 +552,53 @@ $(eval $(call SetupArchive,BUILD_CT_SYM, $(IMAGES_OUTPUTDIR)/symbols/_the.symbol
##########################################################################################
SRC_ZIP_INCLUDES = \
com/sun/corba \
com/sun/image/codec/jpeg \
com/sun/imageio \
com/sun/java_cup \
com/sun/javadoc \
com/sun/java/swing \
com/sun/jmx \
com/sun/naming \
com/sun/org/apache \
com/sun/security/auth \
com/sun/security/jgss \
com/sun/source \
java \
javax/accessibility \
javax/annotation \
javax/imageio \
javax/lang \
javax/management \
javax/naming \
javax/print \
javax/rmi \
javax/script \
javax/security \
javax/sound \
javax/sql \
javax/swing \
javax/tools \
javax/xml \
org/ietf \
org/omg \
org/w3c/dom \
org/xml/sax \
#
ifdef OPENJDK
SRC_ZIP_INCLUDES = \
com \
java \
javax \
jdk \
org \
sun \
#
SRC_ZIP_EXCLUDES =
else
SRC_ZIP_INCLUDES = \
com/sun/corba \
com/sun/image/codec/jpeg \
com/sun/imageio \
com/sun/java_cup \
com/sun/javadoc \
com/sun/java/swing \
com/sun/jmx \
com/sun/naming \
com/sun/org/apache \
com/sun/security/auth \
com/sun/security/jgss \
com/sun/source \
java \
javax/accessibility \
javax/annotation \
javax/imageio \
javax/lang \
javax/management \
javax/naming \
javax/print \
javax/rmi \
javax/script \
javax/security \
javax/sound \
javax/sql \
javax/swing \
javax/tools \
javax/xml \
org/ietf \
org/omg \
org/w3c/dom \
org/xml/sax \
#
SRC_ZIP_EXCLUDES = javax/swing/beaninfo
endif
SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
@ -616,7 +629,7 @@ $(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/src))
$(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \
INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
EXCLUDES := javax/swing/beaninfo, \
EXCLUDES := $(SRC_ZIP_EXCLUDES), \
SUFFIXES := .java .c .h, \
ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \
EXTRA_DEPS := $(LAUNCHER_ZIP_SRC)))

View File

@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-
# To build with all warnings enabled, do the following:
# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,overloads,serial,static,try,varargs -Werror
JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,fallthrough,overloads,serial,static,try,varargs -Werror
# Any java code executed during a JDK build to build other parts of the JDK must be
# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this

View File

@ -1251,7 +1251,7 @@ ifndef BUILD_HEADLESS_ONLY
LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
endif

View File

@ -231,9 +231,9 @@ $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
BUILD_LIBZIP_EXCLUDES :=
ifeq ($(USE_EXTERNAL_LIBZ), true)
LIBZ := -lz
LIBZIP_EXCLUDES += zlib-1.2.5
LIBZIP_EXCLUDES += zlib-1.2.8
else
ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
endif
BUILD_LIBZIP_REORDER :=
@ -410,7 +410,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
endif
ifneq ($(USE_EXTERNAL_LIBZ), true)
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
BUILD_LIBJLI_FILES += \
inflate.c \

View File

@ -143,7 +143,8 @@ ifndef OPENJDK
define SetupAccessBridge
# Parameter 1 Suffix
# Parameter 2 Machine
# Parameter 3 ACCESSBRIDGE_ARCH_ suffix
# Parameter 3 ACCESSBRIDGE_ARCH_ suffix and name of directory where gensrc headers
# are found.
$(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
LIBRARY = JAWTAccessBridge$1, \
@ -153,7 +154,8 @@ ifndef OPENJDK
LANG := C++, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-DACCESSBRIDGE_ARCH_$3, \
-DACCESSBRIDGE_ARCH_$3 \
-I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
@ -179,7 +181,8 @@ ifndef OPENJDK
LANG := C++, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-DACCESSBRIDGE_ARCH_$3, \
-DACCESSBRIDGE_ARCH_$3 \
-I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
@ -204,7 +207,8 @@ ifndef OPENJDK
LANG := C++, \
OPTIMIZATION := LOW, \
CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
-DACCESSBRIDGE_ARCH_$3, \
-DACCESSBRIDGE_ARCH_$3 \
-I$(JDK_OUTPUTDIR)/gensrc_headers_ab/$3, \
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
@ -225,7 +229,7 @@ ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupAccessBridge,-32,I386,32))
$(eval $(call SetupAccessBridge,,I386,LEGACY))
$(eval $(call SetupAccessBridge,,I386,legacy))
else
$(eval $(call SetupAccessBridge,-64,X64,64))
endif

View File

@ -88,7 +88,7 @@ PROFILE_2_RTJAR_INCLUDE_PACKAGES := \
java/sql \
javax/rmi/ssl \
javax/sql \
javax/transaction \
javax/transaction/xa \
javax/xml \
org/w3c \
org/xml/sax \
@ -223,7 +223,8 @@ FULL_JRE_RTJAR_INCLUDE_TYPES := \
javax/management/remote/rmi/_RMIConnection_Stub.class \
javax/management/remote/rmi/_RMIServerImpl_Tie.class \
javax/management/remote/rmi/_RMIServer_Stub.class \
javax/rmi/*.class
javax/rmi/*.class \
javax/transaction/*.class
FULL_JRE_RTJAR_EXCLUDE_TYPES :=

View File

@ -512,7 +512,7 @@ class ConstantPool {
}
static String qualifiedStringValue(String s1, String s234) {
// Qualification by dot must decompose uniquely. Second string might already be qualified.
assert(s1.indexOf(".") < 0);
assert(s1.indexOf('.') < 0);
return s1+"."+s234;
}

View File

@ -102,7 +102,7 @@ public final class CorbanameUrl {
}
location = url.substring(addrStart, addrEnd);
int keyStart = location.indexOf("/");
int keyStart = location.indexOf('/');
if (keyStart >= 0) {
// Has key string
if (keyStart == (location.length() -1)) {

View File

@ -336,7 +336,7 @@ public class RegistryContext implements Context, Referenceable {
String url = "rmi://";
// Enclose IPv6 literal address in '[' and ']'
url = (host.indexOf(":") > -1) ? url + "[" + host + "]" :
url = (host.indexOf(':') > -1) ? url + "[" + host + "]" :
url + host;
if (port > 0) {
url += ":" + Integer.toString(port);

View File

@ -149,7 +149,7 @@ abstract public class GenericURLContext implements Context {
* foo:rest/of/name foo:
*/
protected String getURLPrefix(String url) throws NamingException {
int start = url.indexOf(":");
int start = url.indexOf(':');
if (start < 0) {
throw new OperationNotSupportedException("Invalid URL: " + url);
@ -160,7 +160,7 @@ abstract public class GenericURLContext implements Context {
start += 2; // skip double slash
// find last slash
int posn = url.indexOf("/", start);
int posn = url.indexOf('/', start);
if (posn >= 0) {
start = posn;
} else {

View File

@ -303,7 +303,7 @@ public final class ExecOptionPermission extends Permission
offset = pname.length() - 1;
while ((last = pname.lastIndexOf(".", offset)) != -1) {
while ((last = pname.lastIndexOf('.', offset)) != -1) {
pname = pname.substring(0, last+1) + "*";
x = permissions.get(pname);
@ -318,7 +318,7 @@ public final class ExecOptionPermission extends Permission
pname = p.getName();
offset = pname.length() - 1;
while ((last = pname.lastIndexOf("=", offset)) != -1) {
while ((last = pname.lastIndexOf('=', offset)) != -1) {
pname = pname.substring(0, last+1) + "*";
x = permissions.get(pname);

View File

@ -6831,7 +6831,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
// table name else isolate table name.
indexFrom = command.toLowerCase().indexOf("from");
indexComma = command.indexOf(",", indexFrom);
indexComma = command.indexOf(',', indexFrom);
if(indexComma == -1) {
// implies only one table

View File

@ -910,7 +910,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
// now remove the last ","
strWhereClause = strWhereClause.substring
(0, strWhereClause.lastIndexOf(","));
(0, strWhereClause.lastIndexOf(','));
// Add from clause
strWhereClause = strWhereClause.concat(" from ");
@ -920,7 +920,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
//Remove the last ","
strWhereClause = strWhereClause.substring
(0, strWhereClause.lastIndexOf(","));
(0, strWhereClause.lastIndexOf(','));
// Add the where clause
strWhereClause = strWhereClause.concat(" where ");

View File

@ -240,7 +240,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
// Remove the string after "@xxxx"
// before writing it to the xml file.
String strProviderInstance = (caller.getSyncProvider()).toString();
String strProvider = strProviderInstance.substring(0, (caller.getSyncProvider()).toString().indexOf("@"));
String strProvider = strProviderInstance.substring(0, (caller.getSyncProvider()).toString().indexOf('@'));
propString("sync-provider-name", strProvider);
propString("sync-provider-vendor", "Oracle Corporation");

View File

@ -1147,7 +1147,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
if (nullValue) {
rs.setSyncProvider(null);
} else {
String str = s.substring(0,s.indexOf("@")+1);
String str = s.substring(0,s.indexOf('@')+1);
rs.setSyncProvider(str);
}
break;

View File

@ -39,7 +39,7 @@ import org.xml.sax.InputSource;
public class XmlResolver implements EntityResolver {
public InputSource resolveEntity(String publicId, String systemId) {
String schemaName = systemId.substring(systemId.lastIndexOf("/"));
String schemaName = systemId.substring(systemId.lastIndexOf('/'));
if(systemId.startsWith("http://java.sun.com/xml/ns/jdbc")) {
return new InputSource(this.getClass().getResourceAsStream(schemaName));

View File

@ -694,7 +694,7 @@ public class JndiLoginModule implements LoginModule {
throw new LoginException("Error: no CallbackHandler available " +
"to garner authentication information from the user");
String protocol = userProvider.substring(0, userProvider.indexOf(":"));
String protocol = userProvider.substring(0, userProvider.indexOf(':'));
Callback[] callbacks = new Callback[2];
callbacks[0] = new NameCallback(protocol + " "

View File

@ -400,7 +400,7 @@ public class LdapLoginModule implements LoginModule {
// Add any JNDI properties to the environment
for (String key : options.keySet()) {
if (key.indexOf(".") > -1) {
if (key.indexOf('.') > -1) {
ldapEnvironment.put(key, options.get(key));
}
}

View File

@ -857,7 +857,7 @@ public class CommandInterpreter {
bpSpec = runtime.createClassLineBreakpoint(classId, lineNumber);
} else {
// Try stripping method from class.method token.
int idot = token.lastIndexOf(".");
int idot = token.lastIndexOf('.');
if ( (idot <= 0) || /* No dot or dot in first char */
(idot >= token.length() - 1) ) { /* dot in last char */
return null;

View File

@ -1079,7 +1079,7 @@ class Commands {
}
} else {
// Try stripping method from class.method token.
int idot = token.lastIndexOf(".");
int idot = token.lastIndexOf('.');
if ( (idot <= 0) || /* No dot or dot in first char */
(idot >= token.length() - 1) ) { /* dot in last char */
printBreakpointCommandUsage(atForm, inForm);

View File

@ -67,7 +67,7 @@ class AllClassesQuery extends QueryHandler {
continue;
}
String name = clazz.getName();
int pos = name.lastIndexOf(".");
int pos = name.lastIndexOf('.');
String pkg;
if (name.startsWith("[")) { // Only in ancient heap dumps
pkg = "<Arrays>";

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -86,6 +86,7 @@ public class Applet extends Panel {
/**
* Read an applet from an object input stream.
* @param s an object input stream.
* @exception HeadlessException if
* <code>GraphicsEnvironment.isHeadless()</code> returns
* <code>true</code>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -152,7 +152,7 @@ public interface AppletContext {
* For security reasons, mapping of streams and keys exists for each
* codebase. In other words, applet from one codebase cannot access
* the streams created by an applet from a different codebase
* <p>
*
* @param key key with which the specified value is to be associated.
* @param stream stream to be associated with the specified key. If this
* parameter is <code>null</code>, the specified key is removed
@ -172,7 +172,7 @@ public interface AppletContext {
* For security reasons, mapping of streams and keys exists for each
* codebase. In other words, applet from one codebase cannot access
* the streams created by an applet from a different codebase
* <p>
*
* @return the stream to which this applet context maps the key
* @param key key whose associated stream is to be returned.
* @since 1.4
@ -185,7 +185,7 @@ public interface AppletContext {
* For security reasons, mapping of streams and keys exists for each
* codebase. In other words, applet from one codebase cannot access
* the streams created by an applet from a different codebase
* <p>
*
* @return an Iterator of all the names of the streams in this applet
* context.
* @since 1.4

View File

@ -1926,9 +1926,9 @@ public abstract class Path2D implements Shape, Cloneable {
* maintains, but it may contain no more precision either.
* If the tradeoff of precision vs. storage size in the result is
* important then the convenience constructors in the
* {@link Path2D.Float#Path2D.Float(Shape, AffineTransform) Path2D.Float}
* {@link Path2D.Float#Float(Shape, AffineTransform) Path2D.Float}
* and
* {@link Path2D.Double#Path2D.Double(Shape, AffineTransform) Path2D.Double}
* {@link Path2D.Double#Double(Shape, AffineTransform) Path2D.Double}
* subclasses should be used to make the choice explicit.
*
* @param at the {@code AffineTransform} used to transform a

View File

@ -1296,7 +1296,7 @@ public final class Class<T> implements java.io.Serializable,
String simpleName = getSimpleBinaryName();
if (simpleName == null) { // top level class
simpleName = getName();
return simpleName.substring(simpleName.lastIndexOf(".")+1); // strip the package name
return simpleName.substring(simpleName.lastIndexOf('.')+1); // strip the package name
}
// According to JLS3 "Binary Compatibility" (13.1) the binary
// name of non-package classes (not top level) is the binary

View File

@ -2133,7 +2133,7 @@ public abstract class ClassLoader {
return result.booleanValue();
// Check for most specific package entry
int dotIndex = className.lastIndexOf(".");
int dotIndex = className.lastIndexOf('.');
if (dotIndex < 0) { // default package
result = packageAssertionStatus.get(null);
if (result != null)
@ -2144,7 +2144,7 @@ public abstract class ClassLoader {
result = packageAssertionStatus.get(className);
if (result != null)
return result.booleanValue();
dotIndex = className.lastIndexOf(".", dotIndex-1);
dotIndex = className.lastIndexOf('.', dotIndex-1);
}
// Return the classloader default

View File

@ -85,7 +85,7 @@ class InvokerBytecodeGenerator {
private InvokerBytecodeGenerator(LambdaForm lambdaForm, int localsMapSize,
String className, String invokerName, MethodType invokerType) {
if (invokerName.contains(".")) {
int p = invokerName.indexOf(".");
int p = invokerName.indexOf('.');
className = invokerName.substring(0, p);
invokerName = invokerName.substring(p+1);
}

View File

@ -607,7 +607,7 @@ class LambdaForm {
assert(m.getName().equals("interpret" + sig.substring(sig.indexOf('_'))));
LambdaForm form = new LambdaForm(sig);
form.vmentry = m;
mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form);
form = mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form);
// FIXME: get rid of PREPARED_FORMS; use MethodTypeForm cache only
forms.put(sig, form);
}

View File

@ -313,7 +313,8 @@ public class LambdaMetafactory {
* reference expression</em> features of the Java Programming Language.
*
* <p>This is the general, more flexible metafactory; a streamlined version
* is provided by {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}.
* is provided by {@link #metafactory(java.lang.invoke.MethodHandles.Lookup,
* String, MethodType, MethodType, MethodHandle, MethodType)}.
* A general description of the behavior of this method is provided
* {@link LambdaMetafactory above}.
*

View File

@ -692,8 +692,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
lform = new LambdaForm("guardWithCatch", lambdaType.parameterCount(), names);
basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform);
return lform;
return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform);
}
static

View File

@ -91,8 +91,10 @@ final class MethodTypeForm {
return lambdaForms[which];
}
public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
// Should we perform some sort of CAS, to avoid racy duplication?
synchronized public LambdaForm setCachedLambdaForm(int which, LambdaForm form) {
// Simulate a CAS, to avoid racy duplication of results.
LambdaForm prev = lambdaForms[which];
if (prev != null) return prev;
return lambdaForms[which] = form;
}

View File

@ -633,7 +633,7 @@ public abstract class Executable extends AccessibleObject
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getParameterTypes(),
getGenericParameterTypes(),
TypeAnnotation.TypeAnnotationTarget.METHOD_FORMAL_PARAMETER);
}

View File

@ -294,7 +294,7 @@ public class CookieManager extends CookieHandler
// the path is the directory of the page/doc
String path = uri.getPath();
if (!path.endsWith("/")) {
int i = path.lastIndexOf("/");
int i = path.lastIndexOf('/');
if (i > 0) {
path = path.substring(0, i + 1);
} else {
@ -364,7 +364,7 @@ public class CookieManager extends CookieHandler
static private boolean isInPortList(String lst, int port) {
int i = lst.indexOf(",");
int i = lst.indexOf(',');
int val = -1;
while (i > 0) {
try {
@ -375,7 +375,7 @@ public class CookieManager extends CookieHandler
} catch (NumberFormatException numberFormatException) {
}
lst = lst.substring(i+1);
i = lst.indexOf(",");
i = lst.indexOf(',');
}
if (!lst.isEmpty()) {
try {

View File

@ -1138,7 +1138,7 @@ class InetAddress implements java.io.Serializable {
// This is supposed to be an IPv6 literal
// Check if a numeric or string zone id is present
int pos;
if ((pos=host.indexOf ("%")) != -1) {
if ((pos=host.indexOf ('%')) != -1) {
numericZone = checkNumericZone (host);
if (numericZone == -1) { /* remainder of string must be an ifname */
ifname = host.substring (pos+1);

View File

@ -1017,7 +1017,7 @@ class Socket implements java.io.Closeable {
if (isClosed())
throw new SocketException("Socket is closed");
if (!on) {
getImpl().setOption(SocketOptions.SO_LINGER, new Boolean(on));
getImpl().setOption(SocketOptions.SO_LINGER, on);
} else {
if (linger < 0) {
throw new IllegalArgumentException("invalid value for SO_LINGER");

View File

@ -777,7 +777,7 @@ public final class SocketPermission extends Permission
// Literal IPv6 address
host = getName().substring(1, getName().indexOf(']'));
} else {
int i = getName().indexOf(":");
int i = getName().indexOf(':');
if (i == -1)
host = getName();
else {

View File

@ -368,7 +368,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
String host = epoint.getHostString();
// IPv6 litteral?
if (epoint.getAddress() instanceof Inet6Address &&
(!host.startsWith("[")) && (host.indexOf(":") >= 0)) {
(!host.startsWith("[")) && (host.indexOf(':') >= 0)) {
host = "[" + host + "]";
}
try {
@ -688,7 +688,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts {
String host = saddr.getHostString();
// IPv6 litteral?
if (saddr.getAddress() instanceof Inet6Address &&
(!host.startsWith("[")) && (host.indexOf(":") >= 0)) {
(!host.startsWith("[")) && (host.indexOf(':') >= 0)) {
host = "[" + host + "]";
}
try {

View File

@ -1851,9 +1851,9 @@ public final class URI
sb.append("//");
if (authority.startsWith("[")) {
// authority should (but may not) contain an embedded IPv6 address
int end = authority.indexOf("]");
int end = authority.indexOf(']');
String doquote = authority, dontquote = "";
if (end != -1 && authority.indexOf(":") != -1) {
if (end != -1 && authority.indexOf(':') != -1) {
// the authority contains an IPv6 address
if (end == authority.length()) {
dontquote = authority;
@ -1889,8 +1889,8 @@ public final class URI
* because we must not quote a literal IPv6 address
*/
if (opaquePart.startsWith("//[")) {
int end = opaquePart.indexOf("]");
if (end != -1 && opaquePart.indexOf(":")!=-1) {
int end = opaquePart.indexOf(']');
if (end != -1 && opaquePart.indexOf(':')!=-1) {
String doquote, dontquote;
if (end == opaquePart.length()) {
dontquote = opaquePart;

View File

@ -592,14 +592,24 @@ public final class AccessController {
System.getSecurityManager() != null &&
!callerPD.impliesCreateAccessControlContext())
{
ProtectionDomain nullPD = new ProtectionDomain(null, null);
return new AccessControlContext(new ProtectionDomain[] { nullPD });
return getInnocuousAcc();
} else {
return new AccessControlContext(callerPD, combiner, parent,
context, perms);
}
}
private static class AccHolder {
// An AccessControlContext with no granted permissions.
// Only initialized on demand when getInnocuousAcc() is called.
static final AccessControlContext innocuousAcc =
new AccessControlContext(new ProtectionDomain[] {
new ProtectionDomain(null, null) });
}
private static AccessControlContext getInnocuousAcc() {
return AccHolder.innocuousAcc;
}
private static ProtectionDomain getCallerPD(final Class <?> caller) {
ProtectionDomain callerPd = doPrivileged
(new PrivilegedAction<ProtectionDomain>() {

View File

@ -430,7 +430,7 @@ final class BasicPermissionCollection
offset = path.length()-1;
while ((last = path.lastIndexOf(".", offset)) != -1) {
while ((last = path.lastIndexOf('.', offset)) != -1) {
path = path.substring(0, last+1) + "*";
//System.out.println("check "+path);

View File

@ -931,7 +931,7 @@ public abstract class Provider extends Properties {
}
private String[] getTypeAndAlgorithm(String key) {
int i = key.indexOf(".");
int i = key.indexOf('.');
if (i < 1) {
if (debug != null) {
debug.println("Ignoring invalid entry in provider "

View File

@ -1114,7 +1114,7 @@ public final class Security {
// implementation of an algorithm. We are only interested
// in entries which lead to the implementation
// classes.
if (currentKey.indexOf(" ") < 0) {
if (currentKey.indexOf(' ') < 0) {
result.add(currentKey.substring(
serviceName.length() + 1));
}

View File

@ -546,7 +546,7 @@ final class PropertyPermissionCollection extends PermissionCollection
offset = name.length()-1;
while ((last = name.lastIndexOf(".", offset)) != -1) {
while ((last = name.lastIndexOf('.', offset)) != -1) {
name = name.substring(0, last+1) + "*";
//System.out.println("check "+name);

View File

@ -276,7 +276,7 @@ class JarVerifier {
// now we are parsing a signature block file
String key = uname.substring(0, uname.lastIndexOf("."));
String key = uname.substring(0, uname.lastIndexOf('.'));
if (signerCache == null)
signerCache = new ArrayList<>();

View File

@ -779,7 +779,7 @@ public class LogManager {
int ix = 1;
for (;;) {
int ix2 = name.indexOf(".", ix);
int ix2 = name.indexOf('.', ix);
if (ix2 < 0) {
break;
}
@ -802,7 +802,7 @@ public class LogManager {
}
LogNode node = root;
while (name.length() > 0) {
int ix = name.indexOf(".");
int ix = name.indexOf('.');
String head;
if (ix > 0) {
head = name.substring(0, ix);

View File

@ -174,7 +174,7 @@ public class XMLFormatter extends Formatter {
// Check to see if the parameter was not a messagetext format
// or was not null or empty
if (parameters != null && parameters.length != 0
&& record.getMessage().indexOf("{") == -1 ) {
&& record.getMessage().indexOf('{') == -1 ) {
for (Object parameter : parameters) {
sb.append(" <param>");
try {

View File

@ -319,7 +319,8 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
if (len > 0) {
byte[] extra = new byte[len];
readFully(extra, 0, len);
e.setExtra0(extra, true);
e.setExtra0(extra,
e.csize == ZIP64_MAGICVAL || e.size == ZIP64_MAGICVAL);
}
return e;
}

View File

@ -290,7 +290,7 @@ public class MBeanPermission extends Permission {
// Parse ObjectName
int openingBracket = name.indexOf("[");
int openingBracket = name.indexOf('[');
if (openingBracket == -1) {
// If "[on]" missing then ObjectName("*:*")
//
@ -329,7 +329,7 @@ public class MBeanPermission extends Permission {
// Parse member
int poundSign = name.indexOf("#");
int poundSign = name.indexOf('#');
if (poundSign == -1)
setMember("*");

View File

@ -329,7 +329,7 @@ public class DescriptorSupport
inFld = false;
} else if (inFld && inDesc) {
// want kw=value, eg, name="myname" value="myvalue"
int eq_separator = tok.indexOf("=");
int eq_separator = tok.indexOf('=');
if (eq_separator > 0) {
String kwPart = tok.substring(0,eq_separator);
String valPart = tok.substring(eq_separator+1);
@ -458,7 +458,7 @@ public class DescriptorSupport
if ((fields[i] == null) || (fields[i].equals(""))) {
continue;
}
int eq_separator = fields[i].indexOf("=");
int eq_separator = fields[i].indexOf('=');
if (eq_separator < 0) {
// illegal if no = or is first character
if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {

View File

@ -934,7 +934,7 @@ public class RequiredModelMBean
String opMethodName;
// Parse for class name and method
int opSplitter = opName.lastIndexOf(".");
int opSplitter = opName.lastIndexOf('.');
if (opSplitter > 0) {
opClassName = opName.substring(0,opSplitter);
opMethodName = opName.substring(opSplitter+1);
@ -943,7 +943,7 @@ public class RequiredModelMBean
/* Ignore anything after a left paren. We keep this for
compatibility but it isn't specified. */
opSplitter = opMethodName.indexOf("(");
opSplitter = opMethodName.indexOf('(');
if (opSplitter > 0)
opMethodName = opMethodName.substring(0,opSplitter);

View File

@ -495,7 +495,7 @@ public final class PrivateCredentialPermission extends Permission {
// perform new initialization from the permission name
if (getName().indexOf(" ") == -1 && getName().indexOf("\"") == -1) {
if (getName().indexOf(' ') == -1 && getName().indexOf('"') == -1) {
// name only has a credential class specified
credentialClass = getName();

View File

@ -600,7 +600,7 @@ public class Sasl {
// implementation of an algorithm. We are only interested
// in entries which lead to the implementation
// classes.
if (currentKey.indexOf(" ") < 0) {
if (currentKey.indexOf(' ') < 0) {
String className = providers[i].getProperty(currentKey);
if (!classes.contains(className)) {
classes.add(className);

View File

@ -785,11 +785,29 @@ public class ClassWriter extends ClassVisitor {
if (innerClasses == null) {
innerClasses = new ByteVector();
}
++innerClassesCount;
innerClasses.putShort(name == null ? 0 : newClass(name));
innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
innerClasses.putShort(access);
// Sec. 4.7.6 of the JVMS states "Every CONSTANT_Class_info entry in the
// constant_pool table which represents a class or interface C that is
// not a package member must have exactly one corresponding entry in the
// classes array". To avoid duplicates we keep track in the intVal field
// of the Item of each CONSTANT_Class_info entry C whether an inner
// class entry has already been added for C (this field is unused for
// class entries, and changing its value does not change the hashcode
// and equality tests). If so we store the index of this inner class
// entry (plus one) in intVal. This hack allows duplicate detection in
// O(1) time.
Item nameItem = newClassItem(name);
if (nameItem.intVal == 0) {
++innerClassesCount;
innerClasses.putShort(nameItem.index);
innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
innerClasses.putShort(access);
nameItem.intVal = innerClassesCount;
} else {
// Compare the inner classes entry nameItem.intVal - 1 with the
// arguments of this method and throw an exception if there is a
// difference?
}
}
@Override

View File

@ -1455,16 +1455,20 @@ final class Frame {
| cw.getMergedType(t & BASE_VALUE, u & BASE_VALUE);
} else {
// if u and t are array types, but not with the same element
// type, merge(u,t)=java/lang/Object
v = OBJECT | cw.addType("java/lang/Object");
// type, merge(u,t) = dim(u) - 1 | java/lang/Object
int vdim = ELEMENT_OF + (u & DIM);
v = vdim | OBJECT | cw.addType("java/lang/Object");
}
} else if ((t & BASE_KIND) == OBJECT || (t & DIM) != 0) {
// if t is any other reference or array type, the merged type
// is Object, or min(dim(u), dim(t)) | java/lang/Object is u
// and t have different array dimensions
int tdim = t & DIM;
int udim = u & DIM;
v = (udim != tdim ? Math.min(tdim, udim) : 0) | OBJECT
// is min(udim, tdim) | java/lang/Object, where udim is the
// array dimension of u, minus 1 if u is an array type with a
// primitive element type (and similarly for tdim).
int tdim = (((t & DIM) == 0 || (t & BASE_KIND) == OBJECT) ? 0
: ELEMENT_OF) + (t & DIM);
int udim = (((u & DIM) == 0 || (u & BASE_KIND) == OBJECT) ? 0
: ELEMENT_OF) + (u & DIM);
v = Math.min(tdim, udim) | OBJECT
| cw.addType("java/lang/Object");
} else {
// if t is any other type, merge(u,t)=TOP

View File

@ -230,6 +230,7 @@ final class Item {
* @param strVal3
* third part of the value of this item.
*/
@SuppressWarnings("fallthrough")
void set(final int type, final String strVal1, final String strVal2,
final String strVal3) {
this.type = type;
@ -237,9 +238,10 @@ final class Item {
this.strVal2 = strVal2;
this.strVal3 = strVal3;
switch (type) {
case ClassWriter.CLASS:
this.intVal = 0; // intVal of a class must be zero, see visitInnerClass
case ClassWriter.UTF8:
case ClassWriter.STR:
case ClassWriter.CLASS:
case ClassWriter.MTYPE:
case ClassWriter.TYPE_NORMAL:
hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());

View File

@ -502,7 +502,7 @@ public class Label {
void addToSubroutine(final long id, final int nbSubroutines) {
if ((status & VISITED) == 0) {
status |= VISITED;
srcAndRefPositions = new int[(nbSubroutines - 1) / 32 + 1];
srcAndRefPositions = new int[nbSubroutines / 32 + 1];
}
srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
}

View File

@ -1430,6 +1430,14 @@ class MethodWriter extends MethodVisitor {
@Override
public void visitMaxs(final int maxStack, final int maxLocals) {
if (resize) {
// replaces the temporary jump opcodes introduced by Label.resolve.
if (ClassReader.RESIZE) {
resizeInstructions();
} else {
throw new RuntimeException("Method code too large!");
}
}
if (ClassReader.FRAMES && compute == FRAMES) {
// completes the control flow graph with exception handler blocks
Handler handler = firstHandler;
@ -1987,43 +1995,43 @@ class MethodWriter extends MethodVisitor {
stackMap.putByte(v);
}
} else {
StringBuffer buf = new StringBuffer();
StringBuilder sb = new StringBuilder();
d >>= 28;
while (d-- > 0) {
buf.append('[');
sb.append('[');
}
if ((t & Frame.BASE_KIND) == Frame.OBJECT) {
buf.append('L');
buf.append(cw.typeTable[t & Frame.BASE_VALUE].strVal1);
buf.append(';');
sb.append('L');
sb.append(cw.typeTable[t & Frame.BASE_VALUE].strVal1);
sb.append(';');
} else {
switch (t & 0xF) {
case 1:
buf.append('I');
sb.append('I');
break;
case 2:
buf.append('F');
sb.append('F');
break;
case 3:
buf.append('D');
sb.append('D');
break;
case 9:
buf.append('Z');
sb.append('Z');
break;
case 10:
buf.append('B');
sb.append('B');
break;
case 11:
buf.append('C');
sb.append('C');
break;
case 12:
buf.append('S');
sb.append('S');
break;
default:
buf.append('J');
sb.append('J');
}
}
stackMap.putByte(7).putShort(cw.newClass(buf.toString()));
stackMap.putByte(7).putShort(cw.newClass(sb.toString()));
}
}
}
@ -2051,14 +2059,6 @@ class MethodWriter extends MethodVisitor {
if (classReaderOffset != 0) {
return 6 + classReaderLength;
}
if (resize) {
// replaces the temporary jump opcodes introduced by Label.resolve.
if (ClassReader.RESIZE) {
resizeInstructions();
} else {
throw new RuntimeException("Method code too large!");
}
}
int size = 8;
if (code.length > 0) {
if (code.length > 65536) {
@ -2715,49 +2715,50 @@ class MethodWriter extends MethodVisitor {
}
}
// recomputes the stack map frames
if (frameCount > 0) {
if (compute == FRAMES) {
frameCount = 0;
stackMap = null;
previousFrame = null;
frame = null;
Frame f = new Frame();
f.owner = labels;
Type[] args = Type.getArgumentTypes(descriptor);
f.initInputFrame(cw, access, args, maxLocals);
visitFrame(f);
Label l = labels;
while (l != null) {
/*
* here we need the original label position. getNewOffset
* must therefore never have been called for this label.
*/
u = l.position - 3;
if ((l.status & Label.STORE) != 0 || (u >= 0 && resize[u])) {
getNewOffset(allIndexes, allSizes, l);
// TODO update offsets in UNINITIALIZED values
visitFrame(l.frame);
}
l = l.successor;
}
} else {
// updates the stack map frame labels
if (compute == FRAMES) {
Label l = labels;
while (l != null) {
/*
* Resizing an existing stack map frame table is really hard.
* Not only the table must be parsed to update the offets, but
* new frames may be needed for jump instructions that were
* inserted by this method. And updating the offsets or
* inserting frames can change the format of the following
* frames, in case of packed frames. In practice the whole table
* must be recomputed. For this the frames are marked as
* potentially invalid. This will cause the whole class to be
* reread and rewritten with the COMPUTE_FRAMES option (see the
* ClassWriter.toByteArray method). This is not very efficient
* but is much easier and requires much less code than any other
* method I can think of.
* Detects the labels that are just after an IF instruction that
* has been resized with the IFNOT GOTO_W pattern. These labels
* are now the target of a jump instruction (the IFNOT
* instruction). Note that we need the original label position
* here. getNewOffset must therefore never have been called for
* this label.
*/
cw.invalidFrames = true;
u = l.position - 3;
if (u >= 0 && resize[u]) {
l.status |= Label.TARGET;
}
getNewOffset(allIndexes, allSizes, l);
l = l.successor;
}
// Update the offsets in the uninitialized types
for (i = 0; i < cw.typeTable.length; ++i) {
Item item = cw.typeTable[i];
if (item != null && item.type == ClassWriter.TYPE_UNINIT) {
item.intVal = getNewOffset(allIndexes, allSizes, 0,
item.intVal);
}
}
// The stack map frames are not serialized yet, so we don't need
// to update them. They will be serialized in visitMaxs.
} else if (frameCount > 0) {
/*
* Resizing an existing stack map frame table is really hard. Not
* only the table must be parsed to update the offets, but new
* frames may be needed for jump instructions that were inserted by
* this method. And updating the offsets or inserting frames can
* change the format of the following frames, in case of packed
* frames. In practice the whole table must be recomputed. For this
* the frames are marked as potentially invalid. This will cause the
* whole class to be reread and rewritten with the COMPUTE_FRAMES
* option (see the ClassWriter.toByteArray method). This is not very
* efficient but is much easier and requires much less code than any
* other method I can think of.
*/
cw.invalidFrames = true;
}
// updates the exception handler block labels
Handler h = firstHandler;

View File

@ -585,11 +585,11 @@ public class Type {
case DOUBLE:
return "double";
case ARRAY:
StringBuffer b = new StringBuffer(getElementType().getClassName());
StringBuilder sb = new StringBuilder(getElementType().getClassName());
for (int i = getDimensions(); i > 0; --i) {
b.append("[]");
sb.append("[]");
}
return b.toString();
return sb.toString();
case OBJECT:
return new String(buf, off, len).replace('/', '.');
default:

View File

@ -1089,7 +1089,7 @@ public class InstructionAdapter extends MethodVisitor {
@Deprecated
public void invokestatic(final String owner, final String name,
final String desc) {
if (api < Opcodes.ASM5) {
if (api >= Opcodes.ASM5) {
invokestatic(owner, name, desc, false);
return;
}

View File

@ -205,7 +205,7 @@ public class Method {
}
String returnType = method.substring(0, space);
String methodName = method.substring(space + 1, start - 1).trim();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append('(');
int p;
do {
@ -229,7 +229,7 @@ public class Method {
return type;
}
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
int index = 0;
while ((index = type.indexOf("[]", index) + 1) > 0) {
sb.append('[');

View File

@ -147,17 +147,17 @@ public abstract class Remapper {
}
Type[] args = Type.getArgumentTypes(desc);
StringBuffer s = new StringBuffer("(");
StringBuilder sb = new StringBuilder("(");
for (int i = 0; i < args.length; i++) {
s.append(mapDesc(args[i].getDescriptor()));
sb.append(mapDesc(args[i].getDescriptor()));
}
Type returnType = Type.getReturnType(desc);
if (returnType == Type.VOID_TYPE) {
s.append(")V");
return s.toString();
sb.append(")V");
return sb.toString();
}
s.append(')').append(mapDesc(returnType.getDescriptor()));
return s.toString();
sb.append(')').append(mapDesc(returnType.getDescriptor()));
return sb.toString();
}
public Object mapValue(Object value) {

View File

@ -239,7 +239,9 @@ public class SerialVersionUIDAdder extends ClassVisitor {
if (computeSVUID) {
this.name = name;
this.access = access;
this.interfaces = Arrays.copyOf(interfaces, interfaces.length);
this.interfaces = new String[interfaces.length];
System.arraycopy(interfaces, 0, this.interfaces, 0,
interfaces.length);
}
super.visit(version, access, name, signature, superName, interfaces);

View File

@ -351,7 +351,7 @@ public class MethodNode extends MethodVisitor {
}
@Override
@SuppressWarnings("serial") // Anonymous class
@SuppressWarnings("serial")
public AnnotationVisitor visitAnnotationDefault() {
return new AnnotationNode(new ArrayList<Object>(0) {
@Override

View File

@ -66,7 +66,7 @@ import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
* @author Bing Ran
* @author Eric Bruneton
*/
@SuppressWarnings("serial") // implementation class
@SuppressWarnings("serial")
public class AnalyzerException extends Exception {
public final AbstractInsnNode node;

View File

@ -754,14 +754,14 @@ public class Frame<V extends Value> {
*/
@Override
public String toString() {
StringBuffer b = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < getLocals(); ++i) {
b.append(getLocal(i));
sb.append(getLocal(i));
}
b.append(' ');
sb.append(' ');
for (int i = 0; i < getStackSize(); ++i) {
b.append(getStack(i).toString());
sb.append(getStack(i).toString());
}
return b.toString();
return sb.toString();
}
}

View File

@ -206,7 +206,6 @@ public class ASMifier extends Printer {
}
text.add("import java.util.*;\n");
text.add("import jdk.internal.org.objectweb.asm.*;\n");
text.add("import jdk.internal.org.objectweb.asm.attrs.*;\n");
text.add("public class " + simpleName + "Dump implements Opcodes {\n\n");
text.add("public static byte[] dump () throws Exception {\n\n");
text.add("ClassWriter cw = new ClassWriter(0);\n");

View File

@ -298,26 +298,26 @@ public class CheckClassAdapter extends ClassVisitor {
for (int j = 0; j < method.instructions.size(); ++j) {
method.instructions.get(j).accept(mv);
StringBuffer s = new StringBuffer();
StringBuilder sb = new StringBuilder();
Frame<BasicValue> f = frames[j];
if (f == null) {
s.append('?');
sb.append('?');
} else {
for (int k = 0; k < f.getLocals(); ++k) {
s.append(getShortName(f.getLocal(k).toString()))
sb.append(getShortName(f.getLocal(k).toString()))
.append(' ');
}
s.append(" : ");
sb.append(" : ");
for (int k = 0; k < f.getStackSize(); ++k) {
s.append(getShortName(f.getStack(k).toString()))
sb.append(getShortName(f.getStack(k).toString()))
.append(' ');
}
}
while (s.length() < method.maxStack + method.maxLocals + 1) {
s.append(' ');
while (sb.length() < method.maxStack + method.maxLocals + 1) {
sb.append(' ');
}
pw.print(Integer.toString(j + 100000).substring(1));
pw.print(" " + s + " : " + t.text.get(t.text.size() - 1));
pw.print(" " + sb + " : " + t.text.get(t.text.size() - 1));
}
for (int j = 0; j < method.tryCatchBlocks.size(); ++j) {
method.tryCatchBlocks.get(j).accept(mv);

View File

@ -443,7 +443,7 @@ public class Textifier extends Printer {
}
buf.append(tab);
appendAccess(access);
appendAccess(access & ~Opcodes.ACC_VOLATILE);
if ((access & Opcodes.ACC_NATIVE) != 0) {
buf.append("native ");
}

View File

@ -1,12 +1,12 @@
Path: .
Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/asm-svn-2014-03-12
Working Copy Root Path: /hudson/jobs/objectweb-pull/workspace/asm-svn-2014-05-27
URL: file:///svnroot/asm/trunk/asm
Repository Root: file:///svnroot/asm
Repository UUID: 271bd773-ee82-43a6-9b2b-1890ed8ce7f9
Revision: 1721
Revision: 1748
Node Kind: directory
Schedule: normal
Last Changed Author: ebruneton
Last Changed Rev: 1721
Last Changed Date: 2014-03-02 17:25:35 +0100 (Sun, 02 Mar 2014)
Last Changed Rev: 1747
Last Changed Date: 2014-05-24 10:22:13 +0200 (Sat, 24 May 2014)

View File

@ -32,7 +32,7 @@ import java.net.SocketOption;
* {@link java.net.StandardSocketOptions}. These options may be platform
* specific.
*
* @since 1.9
* @since 1.8
*/
@jdk.Exported
public final class ExtendedSocketOptions {

View File

@ -58,7 +58,7 @@ import java.security.BasicPermission;
*
* @see jdk.net.ExtendedSocketOptions
*
* @since 1.9
* @since 1.8
*/
@jdk.Exported

View File

@ -43,7 +43,7 @@ import java.lang.annotation.Native;
* When a security manager is installed, a {@link NetworkPermission}
* is required to set or get this option.
*
* @since 1.9
* @since 1.8
*/
@jdk.Exported
public class SocketFlow {
@ -66,7 +66,7 @@ public class SocketFlow {
* one of these statuses, which reflect the state of socket's
* flow.
*
* @since 1.9
* @since 1.8
*/
@jdk.Exported
public enum Status {

View File

@ -51,7 +51,7 @@ import sun.net.ExtendedOptionsImpl;
* When a security manager is installed, some non-standard socket options
* may require a security permission before being set or get.
* The details are specified in {@link ExtendedSocketOptions}. No permission
* is required for {@link java.net.StandardSocketOption}s.
* is required for {@link java.net.StandardSocketOptions}.
*
* @see java.nio.channels.NetworkChannel
*/

View File

@ -27,7 +27,7 @@
* Platform specific socket options for the {@code java.net} and {@code java.nio.channels}
* socket classes.
*
* @since 1.9
* @since 1.8
*/
@jdk.Exported

View File

@ -84,7 +84,7 @@ public abstract class AbstractMonitor implements Monitor {
* {@inheritDoc}
*/
public String getBaseName() {
int baseIndex = name.lastIndexOf(".")+1;
int baseIndex = name.lastIndexOf('.') + 1;
return name.substring(baseIndex);
}

View File

@ -138,8 +138,8 @@ public class HostIdentifier {
String frag = u.getFragment();
URI u2 = null;
int c1index = uriString.indexOf(":");
int c2index = uriString.lastIndexOf(":");
int c1index = uriString.indexOf(':');
int c2index = uriString.lastIndexOf(':');
if (c2index != c1index) {
/*
* this is the scheme:hostname:port case. Attempt to

View File

@ -68,7 +68,7 @@ public class StackTraceElementCompositeData extends LazyCompositeData {
ste.getMethodName(),
ste.getFileName(),
new Integer(ste.getLineNumber()),
new Boolean(ste.isNativeMethod()),
ste.isNativeMethod(),
};
try {
return new CompositeDataSupport(stackTraceElementCompositeType,

View File

@ -120,8 +120,8 @@ public class ThreadInfoCompositeData extends LazyCompositeData {
new Long(threadInfo.getLockOwnerId()),
threadInfo.getLockOwnerName(),
stackTraceData,
new Boolean(threadInfo.isSuspended()),
new Boolean(threadInfo.isInNative()),
threadInfo.isSuspended(),
threadInfo.isInNative(),
lockedMonitorsData,
lockedSyncsData,
};

View File

@ -59,7 +59,7 @@ public class VMOptionCompositeData extends LazyCompositeData {
final Object[] vmOptionItemValues = {
option.getName(),
option.getValue(),
new Boolean(option.isWriteable()),
option.isWriteable(),
option.getOrigin().toString(),
};

View File

@ -70,8 +70,8 @@ public class NotificationTargetImpl implements NotificationTarget {
String addrStr;
if (target.startsWith("[")) {
final int index = target.indexOf("]");
final int index2 = target.lastIndexOf(":");
final int index = target.indexOf(']');
final int index2 = target.lastIndexOf(':');
if(index == -1)
throw new IllegalArgumentException("Host starts with [ but " +
"does not end with ]");
@ -85,8 +85,8 @@ public class NotificationTargetImpl implements NotificationTarget {
if (addrStr.startsWith("["))
throw new IllegalArgumentException("More than one [[...]]");
} else {
final int index = target.indexOf(":");
final int index2 = target.lastIndexOf(":");
final int index = target.indexOf(':');
final int index2 = target.lastIndexOf(':');
if(index == -1) throw new
IllegalArgumentException("Missing port separator \":\"");
addrStr = target.substring(0, index);
@ -98,7 +98,7 @@ public class NotificationTargetImpl implements NotificationTarget {
address = InetAddress.getByName(addrStr);
//THE CHECK SHOULD BE STRONGER!!!
final int index = target.lastIndexOf(":");
final int index = target.lastIndexOf(':');
community = target.substring(index + 1, target.length());

View File

@ -273,8 +273,8 @@ public class ExtensionInfo {
else
{
// Look for index of "." in the string
int sIdx = source.indexOf(".");
int tIdx = target.indexOf(".");
int sIdx = source.indexOf('.');
int tIdx = target.indexOf('.');
if (sIdx == -1)
sIdx = source.length() - 1;
@ -304,10 +304,10 @@ public class ExtensionInfo {
String versionError = mf.format(args);
// Look for "-" for pre-release
int prIndex = token.indexOf("-");
int prIndex = token.indexOf('-');
// Look for "_" for patch release
int patchIndex = token.indexOf("_");
int patchIndex = token.indexOf('_');
if (prIndex == -1 && patchIndex == -1)
{

View File

@ -172,7 +172,7 @@ public class JarIndex {
if ((jarFiles = indexMap.get(fileName)) == null) {
/* try the package name again */
int pos;
if((pos = fileName.lastIndexOf("/")) != -1) {
if((pos = fileName.lastIndexOf('/')) != -1) {
jarFiles = indexMap.get(fileName.substring(0, pos));
}
}
@ -195,7 +195,7 @@ public class JarIndex {
public void add(String fileName, String jarName) {
String packageName;
int pos;
if((pos = fileName.lastIndexOf("/")) != -1) {
if((pos = fileName.lastIndexOf('/')) != -1) {
packageName = fileName.substring(0, pos);
} else {
packageName = fileName;

View File

@ -793,7 +793,7 @@ public class URLClassPath {
boolean validIndex(final String name) {
String packageName = name;
int pos;
if((pos = name.lastIndexOf("/")) != -1) {
if((pos = name.lastIndexOf('/')) != -1) {
packageName = name.substring(0, pos);
}
@ -803,7 +803,7 @@ public class URLClassPath {
while (enum_.hasMoreElements()) {
entry = enum_.nextElement();
entryName = entry.getName();
if((pos = entryName.lastIndexOf("/")) != -1)
if((pos = entryName.lastIndexOf('/')) != -1)
entryName = entryName.substring(0, pos);
if (entryName.equals(packageName)) {
return true;
@ -900,7 +900,7 @@ public class URLClassPath {
*/
JarIndex newIndex = newLoader.getIndex();
if(newIndex != null) {
int pos = jarName.lastIndexOf("/");
int pos = jarName.lastIndexOf('/');
newIndex.merge(this.index, (pos == -1 ?
null : jarName.substring(0, pos + 1)));
}

View File

@ -258,7 +258,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
d = null;
}
if (d != null && time != null) {
int c = time.indexOf(":");
int c = time.indexOf(':');
now.setTime(d);
now.set(Calendar.HOUR, Integer.parseInt(time.substring(0, c)));
now.set(Calendar.MINUTE, Integer.parseInt(time.substring(c + 1)));
@ -294,7 +294,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
public FtpDirEntry parseLine(String line) {
String name = null;
int i = line.lastIndexOf(";");
int i = line.lastIndexOf(';');
if (i > 0) {
name = line.substring(i + 1).trim();
line = line.substring(0, i);
@ -305,7 +305,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
FtpDirEntry file = new FtpDirEntry(name);
while (!line.isEmpty()) {
String s;
i = line.indexOf(";");
i = line.indexOf(';');
if (i > 0) {
s = line.substring(0, i);
line = line.substring(i + 1);
@ -313,7 +313,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
s = line;
line = "";
}
i = s.indexOf("=");
i = s.indexOf('=');
if (i > 0) {
String fact = s.substring(0, i);
String value = s.substring(i + 1);

View File

@ -325,7 +325,7 @@ public final class DNSNameService implements NameService {
while (i.hasNext()) {
String parentDomain = i.next();
int start = 0;
while ((start = parentDomain.indexOf(".")) != -1
while ((start = parentDomain.indexOf('.')) != -1
&& start < parentDomain.length() -1) {
try {
results = resolve(ctx, host+"."+parentDomain, ids, 0);

View File

@ -132,7 +132,7 @@ public class IPAddressUtil {
byte[] dst = new byte[INADDR16SZ];
int srcb_length = srcb.length;
int pc = src.indexOf ("%");
int pc = src.indexOf ('%');
if (pc == srcb_length -1) {
return null;
}

View File

@ -356,8 +356,8 @@ public class ParseUtil {
* because we must not quote a literal IPv6 address
*/
if (opaquePart.startsWith("//[")) {
int end = opaquePart.indexOf("]");
if (end != -1 && opaquePart.indexOf(":")!=-1) {
int end = opaquePart.indexOf(']');
if (end != -1 && opaquePart.indexOf(':')!=-1) {
String doquote, dontquote;
if (end == opaquePart.length()) {
dontquote = opaquePart;
@ -408,8 +408,8 @@ public class ParseUtil {
} else if (authority != null) {
sb.append("//");
if (authority.startsWith("[")) {
int end = authority.indexOf("]");
if (end != -1 && authority.indexOf(":")!=-1) {
int end = authority.indexOf(']');
if (end != -1 && authority.indexOf(':')!=-1) {
String doquote, dontquote;
if (end == authority.length()) {
dontquote = authority;

View File

@ -341,6 +341,6 @@ public final class ReflectUtil {
* (not to be confused with a Java Language anonymous inner class).
*/
public static boolean isVMAnonymousClass(Class<?> cls) {
return cls.getName().indexOf("/") > -1;
return cls.getName().indexOf('/') > -1;
}
}

View File

@ -426,7 +426,7 @@ public abstract class Log {
* Mimic old log messages that only contain unqualified names.
*/
private static String unqualifiedName(String name) {
int lastDot = name.lastIndexOf(".");
int lastDot = name.lastIndexOf('.');
if (lastDot >= 0) {
name = name.substring(lastDot + 1);
}

View File

@ -141,7 +141,7 @@ public final class CGIHandler {
{
try {
String command, param;
int delim = QueryString.indexOf("=");
int delim = QueryString.indexOf('=');
if (delim == -1) {
command = QueryString;
param = "";

View File

@ -50,8 +50,8 @@ public class GSSManagerImpl extends GSSManager {
if (osname.startsWith("SunOS") ||
osname.contains("OS X") ||
osname.startsWith("Linux")) {
return new Boolean(System.getProperty
(USE_NATIVE_PROP));
return Boolean.valueOf(System.getProperty
(USE_NATIVE_PROP));
}
return Boolean.FALSE;
}

View File

@ -39,7 +39,7 @@ class Krb5Util {
static String getTGSName(GSSNameElement name)
throws GSSException {
String krbPrinc = name.getKrbName();
int atIndex = krbPrinc.indexOf("@");
int atIndex = krbPrinc.indexOf('@');
String realm = krbPrinc.substring(atIndex + 1);
StringBuffer buf = new StringBuffer("krbtgt/");
buf.append(realm).append('@').append(realm);

View File

@ -1271,7 +1271,7 @@ public class PolicyFile extends java.security.Policy {
Boolean imp = AccessController.doPrivileged
(new PrivilegedAction<Boolean>() {
public Boolean run() {
return new Boolean(entry.getCodeSource().implies(cs));
return entry.getCodeSource().implies(cs);
}
});
if (!imp.booleanValue()) {
@ -1856,7 +1856,7 @@ public class PolicyFile extends java.security.Policy {
int colonIndex;
String prefix = value;
String suffix;
if ((colonIndex = value.indexOf(":")) != -1) {
if ((colonIndex = value.indexOf(':')) != -1) {
prefix = value.substring(0, colonIndex);
}

View File

@ -338,7 +338,7 @@ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager {
}
String sigType;
if (keyType.contains("_")) {
int k = keyType.indexOf("_");
int k = keyType.indexOf('_');
sigType = keyType.substring(k + 1);
keyType = keyType.substring(0, k);
} else {

View File

@ -302,7 +302,7 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager
final String sigKeyAlgorithm;
KeyType(String algorithm) {
int k = algorithm.indexOf("_");
int k = algorithm.indexOf('_');
if (k == -1) {
keyAlgorithm = algorithm;
sigKeyAlgorithm = null;

View File

@ -300,8 +300,8 @@ public class HostnameChecker {
template = template.toLowerCase(Locale.ENGLISH);
// Retreive leftmost component
int templateIdx = template.indexOf(".");
int nameIdx = name.indexOf(".");
int templateIdx = template.indexOf('.');
int nameIdx = name.indexOf('.');
if (templateIdx == -1)
templateIdx = template.length();
@ -326,7 +326,7 @@ public class HostnameChecker {
*/
private static boolean matchWildCards(String name, String template) {
int wildcardIdx = template.indexOf("*");
int wildcardIdx = template.indexOf('*');
if (wildcardIdx == -1)
return name.equals(template);
@ -349,7 +349,7 @@ public class HostnameChecker {
// update the match scope
name = name.substring(beforeStartIdx + beforeWildcard.length());
wildcardIdx = afterWildcard.indexOf("*");
wildcardIdx = afterWildcard.indexOf('*');
}
return name.endsWith(afterWildcard);
}

View File

@ -98,7 +98,7 @@ public class SignatureFileVerifier {
} finally {
Providers.stopJarVerification(obj);
}
this.name = name.substring(0, name.lastIndexOf("."))
this.name = name.substring(0, name.lastIndexOf('.'))
.toUpperCase(Locale.ENGLISH);
this.md = md;
this.signerCache = signerCache;

Some files were not shown because too many files have changed in this diff Show More