This commit is contained in:
Lana Steuck 2013-11-15 07:14:23 -08:00
commit 1a633e63a9
259 changed files with 15214 additions and 12140 deletions

View File

@ -1,5 +1,6 @@
^build/
^dist/
^testoutput/
/nbproject/private/
^make/netbeans/.*/build/
^make/netbeans/.*/dist/

View File

@ -103,6 +103,7 @@ SUNWprivate_1.1 {
Java_sun_management_VMManagementImpl_getSafepointCount;
Java_sun_management_VMManagementImpl_getSafepointSyncTime;
Java_sun_management_VMManagementImpl_getStartupTime;
Java_sun_management_VMManagementImpl_getUptime0;
Java_sun_management_VMManagementImpl_getTotalApplicationNonStoppedTime;
Java_sun_management_VMManagementImpl_getTotalClassCount;
Java_sun_management_VMManagementImpl_getTotalCompileTime;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -115,7 +115,6 @@ BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
LIBJAVA_SRC_DIRS := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \
$(JDK_TOPDIR)/src/share/native/java/lang \
$(JDK_TOPDIR)/src/share/native/java/lang/ref \
$(JDK_TOPDIR)/src/share/native/java/lang/reflect \
$(JDK_TOPDIR)/src/share/native/java/io \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \

View File

@ -275,19 +275,12 @@ BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
##########################################################################################
BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/share/native/sun/management \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/management
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management
BUILD_LIBMANAGEMENT_EXCLUDES :=
BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/management
ifneq ($(OPENJDK_TARGET_OS), windows)
BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
else
BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
endif
ifneq ($(OPENJDK_TARGET_OS), solaris)
BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
endif

View File

@ -140,7 +140,6 @@ SUNWprivate_1.1 {
Java_java_lang_Double_doubleToRawLongBits;
Java_java_lang_reflect_Proxy_defineClass0;
Java_java_lang_Shutdown_runAllFinalizers;
Java_java_lang_ref_Finalizer_invokeFinalizeMethod;
Java_java_lang_Float_intBitsToFloat;
Java_java_lang_Float_floatToRawIntBits;
Java_java_lang_StrictMath_IEEEremainder;

View File

@ -88,7 +88,6 @@ text: .text%Java_java_lang_Throwable_getStackTraceElement;
text: .text%throwFileNotFoundException;
text: .text%JNU_NotifyAll;
# Test LoadFrame
text: .text%Java_java_lang_ref_Finalizer_invokeFinalizeMethod;
text: .text%JNU_CallMethodByName;
text: .text%JNU_CallMethodByNameV;
text: .text%Java_java_io_UnixFileSystem_createDirectory;

View File

@ -78,7 +78,6 @@ text: .text%writeBytes;
text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2;
text: .text%JNU_GetEnv;
text: .text%Java_java_io_UnixFileSystem_checkAccess;
text: .text%Java_java_lang_ref_Finalizer_invokeFinalizeMethod;
text: .text%Java_java_lang_reflect_Array_newArray;
text: .text%Java_java_lang_Throwable_getStackTraceDepth;
text: .text%Java_java_lang_Throwable_getStackTraceElement;

View File

@ -78,7 +78,6 @@ text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_Pri
text: .text%JNU_GetEnv;
text: .text%Java_java_io_UnixFileSystem_checkAccess;
text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
text: .text%Java_java_lang_ref_Finalizer_invokeFinalizeMethod;
text: .text%Java_java_io_FileInputStream_available;
text: .text%Java_java_lang_reflect_Array_newArray;
text: .text%Java_java_lang_Throwable_getStackTraceDepth;

View File

@ -27,17 +27,17 @@
SUNWprivate_1.1 {
global:
Java_com_sun_management_UnixOperatingSystem_getCommittedVirtualMemorySize;
Java_com_sun_management_UnixOperatingSystem_getFreePhysicalMemorySize;
Java_com_sun_management_UnixOperatingSystem_getFreeSwapSpaceSize;
Java_com_sun_management_UnixOperatingSystem_getMaxFileDescriptorCount;
Java_com_sun_management_UnixOperatingSystem_getOpenFileDescriptorCount;
Java_com_sun_management_UnixOperatingSystem_getProcessCpuLoad;
Java_com_sun_management_UnixOperatingSystem_getProcessCpuTime;
Java_com_sun_management_UnixOperatingSystem_getSystemCpuLoad;
Java_com_sun_management_UnixOperatingSystem_getTotalPhysicalMemorySize;
Java_com_sun_management_UnixOperatingSystem_getTotalSwapSpaceSize;
Java_com_sun_management_UnixOperatingSystem_initialize;
Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize;
Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize;
Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize;
Java_sun_management_OperatingSystemImpl_getMaxFileDescriptorCount;
Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount;
Java_sun_management_OperatingSystemImpl_getProcessCpuLoad;
Java_sun_management_OperatingSystemImpl_getProcessCpuTime;
Java_sun_management_OperatingSystemImpl_getSystemCpuLoad;
Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize;
Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize;
Java_sun_management_OperatingSystemImpl_initialize;
Java_sun_management_ClassLoadingImpl_setVerboseClass;
Java_sun_management_DiagnosticCommandImpl_executeDiagnosticCommand;
Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommands;
@ -103,6 +103,7 @@ SUNWprivate_1.1 {
Java_sun_management_VMManagementImpl_getSafepointCount;
Java_sun_management_VMManagementImpl_getSafepointSyncTime;
Java_sun_management_VMManagementImpl_getStartupTime;
Java_sun_management_VMManagementImpl_getUptime0;
Java_sun_management_VMManagementImpl_getTotalApplicationNonStoppedTime;
Java_sun_management_VMManagementImpl_getTotalClassCount;
Java_sun_management_VMManagementImpl_getTotalCompileTime;

View File

@ -541,7 +541,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
if (rowSetWriter != null) {
Class<?> c = rowSetWriter.getClass();
if (c != null) {
Class[] theInterfaces = c.getInterfaces();
Class<?>[] theInterfaces = c.getInterfaces();
for (int i = 0; i < theInterfaces.length; i++) {
if ((theInterfaces[i].getName()).indexOf("TransactionalWriter") > 0) {
tXWriter = true;

View File

@ -51,6 +51,11 @@ import java.util.Arrays;
*/
public abstract class BaseRow implements Serializable, Cloneable {
/**
* Specify the serialVersionUID
*/
private static final long serialVersionUID = 4152013523511412238L;
/**
* The array containing the original values for this <code>BaseRow</code>
* object.
@ -77,7 +82,7 @@ public abstract class BaseRow implements Serializable, Cloneable {
* @param idx the index of the element to return
* @return the <code>Object</code> value at the given index into this
* row's array of original values
* @throws <code>SQLException</code> if there is an error
* @throws SQLException if there is an error
*/
public abstract Object getColumnObject(int idx) throws SQLException;
@ -90,7 +95,7 @@ public abstract class BaseRow implements Serializable, Cloneable {
* @param idx the index of the element to be set
* @param obj the <code>Object</code> to which the element at index
* <code>idx</code> to be set
* @throws <code>SQLException</code> if there is an error
* @throws SQLException if there is an error
*/
public abstract void setColumnObject(int idx, Object obj) throws SQLException;
}

View File

@ -444,7 +444,7 @@ interface DataInput {
* a {@code double} value. It does this
* by first constructing a {@code long}
* value in exactly the manner
* of the {@code readlong}
* of the {@code readLong}
* method, then converting this {@code long}
* value to a {@code double} in exactly
* the manner of the method {@code Double.longBitsToDouble}.

View File

@ -1248,7 +1248,7 @@ public class ObjectOutputStream
handles.assign(unshared ? null : desc);
Class<?> cl = desc.forClass();
Class[] ifaces = cl.getInterfaces();
Class<?>[] ifaces = cl.getInterfaces();
bout.writeInt(ifaces.length);
for (int i = 0; i < ifaces.length; i++) {
bout.writeUTF(ifaces[i].getName());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2013, 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
@ -1746,7 +1746,7 @@ public class ObjectStreamClass implements Serializable {
dout.writeUTF("()V");
}
Constructor[] cons = cl.getDeclaredConstructors();
Constructor<?>[] cons = cl.getDeclaredConstructors();
MemberSignature[] consSigs = new MemberSignature[cons.length];
for (int i = 0; i < cons.length; i++) {
consSigs[i] = new MemberSignature(cons[i]);

View File

@ -122,14 +122,9 @@ public final class String
/**
* Class String is special cased within the Serialization Stream Protocol.
*
* A String instance is written initially into an ObjectOutputStream in the
* following format:
* <pre>
* {@code TC_STRING} (utf String)
* </pre>
* The String is written by method {@code DataOutput.writeUTF}.
* A new handle is generated to refer to all future references to the
* string instance within the stream.
* A String instance is written into an ObjectOutputStream according to
* <a href="{@docroot}../platform/serialization/spec/output.html">
* Object Serialization Specification, Section 6.2, "Stream Elements"</a>
*/
private static final ObjectStreamField[] serialPersistentFields =
new ObjectStreamField[0];
@ -2242,6 +2237,11 @@ public final class String
* expression does not match any part of the input then the resulting array
* has just one element, namely this string.
*
* <p> When there is a positive-width match at the beginning of this
* string then an empty leading substring is included at the beginning
* of the resulting array. A zero-width match at the beginning however
* never produces such empty leading substring.
*
* <p> The {@code limit} parameter controls the number of times the
* pattern is applied and therefore affects the length of the resulting
* array. If the limit <i>n</i> is greater than zero then the pattern

View File

@ -1263,6 +1263,9 @@ public final class System {
public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) {
return new Thread(target, acc);
}
public void invokeFinalize(Object o) throws Throwable {
o.finalize();
}
});
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013, 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
@ -51,7 +51,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
/* package */ final class InnerClassLambdaMetafactory extends AbstractValidatingLambdaMetafactory {
private static final Unsafe UNSAFE = Unsafe.getUnsafe();
private static final int CLASSFILE_VERSION = 51;
private static final int CLASSFILE_VERSION = 52;
private static final String METHOD_DESCRIPTOR_VOID = Type.getMethodDescriptor(Type.VOID_TYPE);
private static final String JAVA_LANG_OBJECT = "java/lang/Object";
private static final String NAME_CTOR = "<init>";
@ -465,7 +465,9 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
convertArgumentTypes(methodType);
// Invoke the method we want to forward to
visitMethodInsn(invocationOpcode(), implMethodClassName, implMethodName, implMethodDesc);
visitMethodInsn(invocationOpcode(), implMethodClassName,
implMethodName, implMethodDesc,
implDefiningClass.isInterface());
// Convert the return value (if any) and return it
// Note: if adapting from non-void to void, the 'return'

View File

@ -275,7 +275,7 @@ class InvokerBytecodeGenerator {
*/
private void classFilePrologue() {
cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, className, null, superName, null);
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, className, null, superName, null);
cw.visitSource(sourceFile, null);
String invokerDesc = invokerType.toMethodDescriptorString();
@ -646,7 +646,8 @@ class InvokerBytecodeGenerator {
// invocation
if (member.isMethod()) {
mtype = member.getMethodType().toMethodDescriptorString();
mv.visitMethodInsn(refKindOpcode(refKind), cname, mname, mtype);
mv.visitMethodInsn(refKindOpcode(refKind), cname, mname, mtype,
member.getDeclaringClass().isInterface());
} else {
mtype = MethodType.toFieldDescriptorString(member.getFieldType());
mv.visitFieldInsn(refKindOpcode(refKind), cname, mname, mtype);

View File

@ -744,8 +744,11 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodHandle ginvoker = GuardWithCatch.INVOKES[nargs].bindReceiver(gguard);
return makePairwiseConvert(ginvoker, type, 2);
} else {
target = target.asType(type.changeReturnType(Object.class));
MethodHandle gtarget = makeSpreadArguments(target, Object[].class, 0, nargs);
catcher = catcher.asType(ctype.changeParameterType(0, Throwable.class));
MethodType catcherType = ctype.changeParameterType(0, Throwable.class)
.changeReturnType(Object.class);
catcher = catcher.asType(catcherType);
MethodHandle gcatcher = makeSpreadArguments(catcher, Object[].class, 1, nargs);
GuardWithCatch gguard = new GuardWithCatch(gtarget, exType, gcatcher);
if (gtarget == null || gcatcher == null) throw new InternalError();

View File

@ -32,6 +32,7 @@ import java.lang.ref.ReferenceQueue;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import sun.invoke.util.BytecodeDescriptor;
@ -98,13 +99,25 @@ class MethodType implements java.io.Serializable {
private @Stable MethodTypeForm form; // erased form, plus cached data about primitives
private @Stable MethodType wrapAlt; // alternative wrapped/unwrapped version
private @Stable Invokers invokers; // cache of handy higher-order adapters
private @Stable String methodDescriptor; // cache for toMethodDescriptorString
/**
* Check the given parameters for validity and store them into the final fields.
*/
private MethodType(Class<?> rtype, Class<?>[] ptypes) {
private MethodType(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
checkRtype(rtype);
checkPtypes(ptypes);
this.rtype = rtype;
// defensively copy the array passed in by the user
this.ptypes = trusted ? ptypes : Arrays.copyOf(ptypes, ptypes.length);
}
/**
* Construct a temporary unchecked instance of MethodType for use only as a key to the intern table.
* Does not check the given parameters for validity, and must be discarded after it is used as a searching key.
* The parameters are reversed for this constructor, so that is is not accidentally used.
*/
private MethodType(Class<?>[] ptypes, Class<?> rtype) {
this.rtype = rtype;
this.ptypes = ptypes;
}
@ -146,20 +159,21 @@ class MethodType implements java.io.Serializable {
/*non-public*/ static final int MAX_MH_INVOKER_ARITY = MAX_MH_ARITY-1; // deduct one more for invoker
private static void checkRtype(Class<?> rtype) {
rtype.equals(rtype); // null check
Objects.requireNonNull(rtype);
}
private static int checkPtype(Class<?> ptype) {
ptype.getClass(); //NPE
private static void checkPtype(Class<?> ptype) {
Objects.requireNonNull(ptype);
if (ptype == void.class)
throw newIllegalArgumentException("parameter type cannot be void");
if (ptype == double.class || ptype == long.class) return 1;
return 0;
}
/** Return number of extra slots (count of long/double args). */
private static int checkPtypes(Class<?>[] ptypes) {
int slots = 0;
for (Class<?> ptype : ptypes) {
slots += checkPtype(ptype);
checkPtype(ptype);
if (ptype == double.class || ptype == long.class) {
slots++;
}
}
checkSlotCount(ptypes.length + slots);
return slots;
@ -284,20 +298,16 @@ class MethodType implements java.io.Serializable {
*/
/*trusted*/ static
MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
MethodType mt = internTable.get(new MethodType(ptypes, rtype));
if (mt != null)
return mt;
if (ptypes.length == 0) {
ptypes = NO_PTYPES; trusted = true;
}
MethodType mt1 = new MethodType(rtype, ptypes);
MethodType mt0 = internTable.get(mt1);
if (mt0 != null)
return mt0;
if (!trusted)
// defensively copy the array passed in by the user
mt1 = new MethodType(rtype, ptypes.clone());
mt = new MethodType(rtype, ptypes, trusted);
// promote the object to the Real Thing, and reprobe
MethodTypeForm form = MethodTypeForm.findForm(mt1);
mt1.form = form;
return internTable.add(mt1);
mt.form = MethodTypeForm.findForm(mt);
return internTable.add(mt);
}
private static final MethodType[] objectOnlyTypes = new MethodType[20];
@ -919,7 +929,12 @@ class MethodType implements java.io.Serializable {
* @return the bytecode type descriptor representation
*/
public String toMethodDescriptorString() {
return BytecodeDescriptor.unparse(this);
String desc = methodDescriptor;
if (desc == null) {
desc = BytecodeDescriptor.unparse(this);
methodDescriptor = desc;
}
return desc;
}
/*non-public*/ static String toFieldDescriptorString(Class<?> cls) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013, 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
@ -35,7 +35,7 @@ import static sun.invoke.util.Wrapper.*;
class TypeConvertingMethodAdapter extends MethodVisitor {
TypeConvertingMethodAdapter(MethodVisitor mv) {
super(Opcodes.ASM4, mv);
super(Opcodes.ASM5, mv);
}
private static final int NUM_WRAPPERS = Wrapper.values().length;

View File

@ -27,17 +27,14 @@ package java.lang.ref;
import java.security.PrivilegedAction;
import java.security.AccessController;
import sun.misc.JavaLangAccess;
import sun.misc.SharedSecrets;
import sun.misc.VM;
final class Finalizer extends FinalReference<Object> { /* Package-private; must be in
same package as the Reference
class */
/* A native method that invokes an arbitrary object's finalize method is
required since the finalize method is protected
*/
static native void invokeFinalizeMethod(Object o) throws Throwable;
private static ReferenceQueue<Object> queue = new ReferenceQueue<>();
private static Finalizer unfinalized = null;
private static final Object lock = new Object();
@ -90,7 +87,7 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
new Finalizer(finalizee);
}
private void runFinalizer() {
private void runFinalizer(JavaLangAccess jla) {
synchronized (this) {
if (hasBeenFinalized()) return;
remove();
@ -98,7 +95,8 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
try {
Object finalizee = this.get();
if (finalizee != null && !(finalizee instanceof java.lang.Enum)) {
invokeFinalizeMethod(finalizee);
jla.invokeFinalize(finalizee);
/* Clear stack slot containing this variable, to decrease
the chances of false retention with a conservative GC */
finalizee = null;
@ -141,16 +139,21 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
/* Called by Runtime.runFinalization() */
static void runFinalization() {
if (!VM.isBooted()) {
return;
}
forkSecondaryFinalizer(new Runnable() {
private volatile boolean running;
public void run() {
if (running)
return;
final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
running = true;
for (;;) {
Finalizer f = (Finalizer)queue.poll();
if (f == null) break;
f.runFinalizer();
f.runFinalizer(jla);
}
}
});
@ -158,11 +161,16 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
/* Invoked by java.lang.Shutdown */
static void runAllFinalizers() {
if (!VM.isBooted()) {
return;
}
forkSecondaryFinalizer(new Runnable() {
private volatile boolean running;
public void run() {
if (running)
return;
final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
running = true;
for (;;) {
Finalizer f;
@ -171,7 +179,7 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
if (f == null) break;
unfinalized = f.next;
}
f.runFinalizer();
f.runFinalizer(jla);
}}});
}
@ -183,13 +191,25 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
public void run() {
if (running)
return;
// Finalizer thread starts before System.initializeSystemClass
// is called. Wait until JavaLangAccess is available
while (!VM.isBooted()) {
// delay until VM completes initialization
try {
VM.awaitBooted();
} catch (InterruptedException x) {
// ignore and continue
}
}
final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
running = true;
for (;;) {
try {
Finalizer f = (Finalizer)queue.remove();
f.runFinalizer();
f.runFinalizer(jla);
} catch (InterruptedException x) {
continue;
// ignore and continue
}
}
}

View File

@ -240,6 +240,7 @@ public abstract class Executable extends AccessibleObject
* declared or implicitly declared or neither) for the executable
* represented by this object.
*
* @since 1.8
* @return The number of formal parameters for the executable this
* object represents
*/
@ -290,6 +291,7 @@ public abstract class Executable extends AccessibleObject
* have unique names, or names that are legal identifiers in the
* Java programming language (JLS 3.8).
*
* @since 1.8
* @throws MalformedParametersException if the class file contains
* a MethodParameters attribute that is improperly formatted.
* @return an array of {@code Parameter} objects representing all

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
@ -494,9 +494,10 @@ public class Proxy implements java.io.Serializable {
private final int hash;
private final WeakReference<Class<?>>[] refs;
@SuppressWarnings("unchecked")
KeyX(Class<?>[] interfaces) {
hash = Arrays.hashCode(interfaces);
refs = new WeakReference[interfaces.length];
refs = (WeakReference<Class<?>>[])new WeakReference<?>[interfaces.length];
for (int i = 0; i < interfaces.length; i++) {
refs[i] = new WeakReference<>(interfaces[i]);
}

View File

@ -114,7 +114,7 @@ class HostPortrange {
if (hoststr.equals("*")) {
hoststr = "";
} else if (hoststr.startsWith("*.")) {
hoststr = hoststr.substring(1).toLowerCase(); // leave the '.' ?
hoststr = toLowerCase(hoststr.substring(1));
} else {
throw new IllegalArgumentException("invalid host wildcard specification");
}
@ -147,7 +147,7 @@ class HostPortrange {
hoststr = sb.toString();
} else {
// regular domain name
hoststr = hoststr.toLowerCase();
hoststr = toLowerCase(hoststr);
}
}
}
@ -161,6 +161,38 @@ class HostPortrange {
}
}
static final int CASE_DIFF = 'A' - 'a';
/**
* Convert to lower case, and check that all chars are ascii
* alphanumeric, '-' or '.' only.
*/
static String toLowerCase(String s) {
int len = s.length();
StringBuilder sb = null;
for (int i=0; i<len; i++) {
char c = s.charAt(i);
if ((c >= 'a' && c <= 'z') || (c == '.')) {
if (sb != null)
sb.append(c);
} else if ((c >= '0' && c <= '9') || (c == '-')) {
if (sb != null)
sb.append(c);
} else if (c >= 'A' && c <= 'Z') {
if (sb == null) {
sb = new StringBuilder(len);
sb.append(s, 0, i);
}
sb.append((char)(c - CASE_DIFF));
} else {
throw new IllegalArgumentException("Invalid characters in hostname");
}
}
return sb == null ? s : sb.toString();
}
public boolean literal() {
return literal;
}

View File

@ -1135,7 +1135,7 @@ class InetAddress implements java.io.Serializable {
// see if it is IPv4 address
addr = IPAddressUtil.textToNumericFormatV4(host);
if (addr == null) {
// see if it is IPv6 address
// 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) {
@ -1144,7 +1144,9 @@ class InetAddress implements java.io.Serializable {
ifname = host.substring (pos+1);
}
}
addr = IPAddressUtil.textToNumericFormatV6(host);
if ((addr = IPAddressUtil.textToNumericFormatV6(host)) == null && host.contains(":")) {
throw new UnknownHostException(host + ": invalid IPv6 address");
}
} else if (ipv6Expected) {
// Means an IPv4 litteral between brackets!
throw new UnknownHostException("["+host+"]");
@ -1162,10 +1164,10 @@ class InetAddress implements java.io.Serializable {
}
return ret;
}
} else if (ipv6Expected) {
// We were expecting an IPv6 Litteral, but got something else
throw new UnknownHostException("["+host+"]");
}
} else if (ipv6Expected) {
// We were expecting an IPv6 Litteral, but got something else
throw new UnknownHostException("["+host+"]");
}
return getAllByName0(host, reqAddr, true);
}

View File

@ -426,7 +426,10 @@ public final class URLPermission extends Permission {
this.ssp = url.substring(delim + 1);
if (!ssp.startsWith("//")) {
this.authority = new Authority(scheme, ssp.toLowerCase());
if (!ssp.equals("*")) {
throw new IllegalArgumentException("invalid URL string");
}
this.authority = new Authority(scheme, "*");
return;
}
String authpath = ssp.substring(2);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2013, 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
@ -81,7 +81,7 @@ class TempFileHelper {
String prefix,
String suffix,
boolean createDirectory,
FileAttribute[] attrs)
FileAttribute<?>[] attrs)
throws IOException
{
if (prefix == null)
@ -155,7 +155,7 @@ class TempFileHelper {
static Path createTempFile(Path dir,
String prefix,
String suffix,
FileAttribute[] attrs)
FileAttribute<?>[] attrs)
throws IOException
{
return create(dir, prefix, suffix, false, attrs);
@ -167,7 +167,7 @@ class TempFileHelper {
*/
static Path createTempDirectory(Path dir,
String prefix,
FileAttribute[] attrs)
FileAttribute<?>[] attrs)
throws IOException
{
return create(dir, prefix, null, true, attrs);

View File

@ -369,7 +369,8 @@ final class DateTimeParseContext {
Objects.requireNonNull(chrono, "chrono");
currentParsed().chrono = chrono;
if (chronoListeners != null && !chronoListeners.isEmpty()) {
Consumer[] tmp = new Consumer[1];
@SuppressWarnings({"rawtypes", "unchecked"})
Consumer<Chronology>[] tmp = new Consumer[1];
Consumer<Chronology>[] listeners = chronoListeners.toArray(tmp);
chronoListeners.clear();
for (Consumer<Chronology> l : listeners) {

View File

@ -266,14 +266,14 @@ final class Parsed implements TemporalAccessor {
TemporalAccessor resolvedObject = targetField.resolve(fieldValues, this, resolverStyle);
if (resolvedObject != null) {
if (resolvedObject instanceof ChronoZonedDateTime) {
ChronoZonedDateTime czdt = (ChronoZonedDateTime) resolvedObject;
ChronoZonedDateTime<?> czdt = (ChronoZonedDateTime) resolvedObject;
if (zone.equals(czdt.getZone()) == false) {
throw new DateTimeException("ChronoZonedDateTime must use the effective parsed zone: " + zone);
}
resolvedObject = czdt.toLocalDateTime();
}
if (resolvedObject instanceof ChronoLocalDateTime) {
ChronoLocalDateTime cldt = (ChronoLocalDateTime) resolvedObject;
ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime) resolvedObject;
updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
updateCheckConflict(cldt.toLocalDate());
changedCount++;

View File

@ -138,7 +138,7 @@ public class Base64 {
if (lineLength <= 0) {
return Encoder.RFC4648;
}
return new Encoder(false, lineSeparator, lineLength >> 2 << 2);
return new Encoder(false, lineSeparator, lineLength >> 2 << 2, true);
}
/**
@ -192,11 +192,13 @@ public class Base64 {
private final byte[] newline;
private final int linemax;
private final boolean isURL;
private final boolean doPadding;
private Encoder(boolean isURL, byte[] newline, int linemax) {
private Encoder(boolean isURL, byte[] newline, int linemax, boolean doPadding) {
this.isURL = isURL;
this.newline = newline;
this.linemax = linemax;
this.doPadding = doPadding;
}
/**
@ -228,9 +230,22 @@ public class Base64 {
private static final int MIMELINEMAX = 76;
private static final byte[] CRLF = new byte[] {'\r', '\n'};
static final Encoder RFC4648 = new Encoder(false, null, -1);
static final Encoder RFC4648_URLSAFE = new Encoder(true, null, -1);
static final Encoder RFC2045 = new Encoder(false, CRLF, MIMELINEMAX);
static final Encoder RFC4648 = new Encoder(false, null, -1, true);
static final Encoder RFC4648_URLSAFE = new Encoder(true, null, -1, true);
static final Encoder RFC2045 = new Encoder(false, CRLF, MIMELINEMAX, true);
private final int outLength(int srclen) {
int len = 0;
if (doPadding) {
len = 4 * ((srclen + 2) / 3);
} else {
int n = srclen % 3;
len = 4 * (srclen / 3) + (n == 0 ? 0 : n + 1);
}
if (linemax > 0) // line separators
len += (len - 1) / linemax * newline.length;
return len;
}
/**
* Encodes all bytes from the specified byte array into a newly-allocated
@ -243,9 +258,7 @@ public class Base64 {
* encoded bytes.
*/
public byte[] encode(byte[] src) {
int len = 4 * ((src.length + 2) / 3); // dst array size
if (linemax > 0) // line separators
len += (len - 1) / linemax * newline.length;
int len = outLength(src.length); // dst array size
byte[] dst = new byte[len];
int ret = encode0(src, 0, src.length, dst);
if (ret != dst.length)
@ -273,10 +286,7 @@ public class Base64 {
* space for encoding all input bytes.
*/
public int encode(byte[] src, byte[] dst) {
int len = 4 * ((src.length + 2) / 3); // dst array size
if (linemax > 0) {
len += (len - 1) / linemax * newline.length;
}
int len = outLength(src.length); // dst array size
if (dst.length < len)
throw new IllegalArgumentException(
"Output byte array is too small for encoding all input bytes");
@ -321,9 +331,7 @@ public class Base64 {
* @return A newly-allocated byte buffer containing the encoded bytes.
*/
public ByteBuffer encode(ByteBuffer buffer) {
int len = 4 * ((buffer.remaining() + 2) / 3);
if (linemax > 0)
len += (len - 1) / linemax * newline.length;
int len = outLength(buffer.remaining());
byte[] dst = new byte[len];
int ret = 0;
if (buffer.hasArray()) {
@ -415,7 +423,25 @@ public class Base64 {
public OutputStream wrap(OutputStream os) {
Objects.requireNonNull(os);
return new EncOutputStream(os, isURL ? toBase64URL : toBase64,
newline, linemax);
newline, linemax, doPadding);
}
/**
* Returns an encoder instance that encodes equivalently to this one,
* but without adding any padding character at the end of the encoded
* byte data.
*
* <p> The encoding scheme of this encoder instance is unaffected by
* this invocation. The returned encoder instance should be used for
* non-padding encoding operation.
*
* @return an equivalent encoder that encodes without adding any
* padding character at the end
*/
public Encoder withoutPadding() {
if (!doPadding)
return this;
return new Encoder(isURL, newline, linemax, false);
}
private int encodeArray(ByteBuffer src, ByteBuffer dst, int bytesOut) {
@ -476,13 +502,17 @@ public class Base64 {
da[dp++] = (byte)base64[b0 >> 2];
if (sp == sl) {
da[dp++] = (byte)base64[(b0 << 4) & 0x3f];
da[dp++] = '=';
da[dp++] = '=';
if (doPadding) {
da[dp++] = '=';
da[dp++] = '=';
}
} else {
int b1 = sa[sp++] & 0xff;
da[dp++] = (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)];
da[dp++] = (byte)base64[(b1 << 2) & 0x3f];
da[dp++] = '=';
if (doPadding) {
da[dp++] = '=';
}
}
}
return dp - dp00 + bytesOut;
@ -548,13 +578,17 @@ public class Base64 {
dst.put(dp++, (byte)base64[b0 >> 2]);
if (sp == src.limit()) {
dst.put(dp++, (byte)base64[(b0 << 4) & 0x3f]);
dst.put(dp++, (byte)'=');
dst.put(dp++, (byte)'=');
if (doPadding) {
dst.put(dp++, (byte)'=');
dst.put(dp++, (byte)'=');
}
} else {
int b1 = src.get(sp++) & 0xff;
dst.put(dp++, (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)]);
dst.put(dp++, (byte)base64[(b1 << 2) & 0x3f]);
dst.put(dp++, (byte)'=');
if (doPadding) {
dst.put(dp++, (byte)'=');
}
}
}
return dp - dp00 + bytesOut;
@ -597,13 +631,17 @@ public class Base64 {
dst[dp++] = (byte)base64[b0 >> 2];
if (sp == end) {
dst[dp++] = (byte)base64[(b0 << 4) & 0x3f];
dst[dp++] = '=';
dst[dp++] = '=';
if (doPadding) {
dst[dp++] = '=';
dst[dp++] = '=';
}
} else {
int b1 = src[sp++] & 0xff;
dst[dp++] = (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)];
dst[dp++] = (byte)base64[(b1 << 2) & 0x3f];
dst[dp++] = '=';
if (doPadding) {
dst[dp++] = '=';
}
}
}
return dp;
@ -1149,14 +1187,16 @@ public class Base64 {
private final char[] base64; // byte->base64 mapping
private final byte[] newline; // line separator, if needed
private final int linemax;
private final boolean doPadding;// whether or not to pad
private int linepos = 0;
EncOutputStream(OutputStream os,
char[] base64, byte[] newline, int linemax) {
EncOutputStream(OutputStream os, char[] base64,
byte[] newline, int linemax, boolean doPadding) {
super(os);
this.base64 = base64;
this.newline = newline;
this.linemax = linemax;
this.doPadding = doPadding;
}
@Override
@ -1228,14 +1268,18 @@ public class Base64 {
checkNewline();
out.write(base64[b0 >> 2]);
out.write(base64[(b0 << 4) & 0x3f]);
out.write('=');
out.write('=');
if (doPadding) {
out.write('=');
out.write('=');
}
} else if (leftover == 2) {
checkNewline();
out.write(base64[b0 >> 2]);
out.write(base64[(b0 << 4) & 0x3f | (b1 >> 4)]);
out.write(base64[(b1 << 2) & 0x3f]);
out.write('=');
if (doPadding) {
out.write('=');
}
}
leftover = 0;
out.close();

View File

@ -1243,7 +1243,7 @@ public class IdentityHashMap<K,V>
if (ti >= size) {
throw new ConcurrentModificationException();
}
a[ti++] = (T) new AbstractMap.SimpleEntry(unmaskNull(key), tab[si + 1]);
a[ti++] = (T) new AbstractMap.SimpleEntry<>(unmaskNull(key), tab[si + 1]);
}
}
// fewer elements than expected or concurrent modification from other thread detected

View File

@ -1820,7 +1820,7 @@ public class ForkJoinPool extends AbstractExecutorService {
}
}
for (;;) { // help stealer or descend to its stealer
ForkJoinTask[] a; int b;
ForkJoinTask<?>[] a; int b;
if (subtask.status < 0) // surround probes with
continue restart; // consistency checks
if ((b = v.base) - v.top < 0 && (a = v.array) != null) {

View File

@ -1253,11 +1253,11 @@ public class ScheduledThreadPoolExecutor
* Snapshot iterator that works off copy of underlying q array.
*/
private class Itr implements Iterator<Runnable> {
final RunnableScheduledFuture[] array;
final RunnableScheduledFuture<?>[] array;
int cursor = 0; // index of next element to return
int lastRet = -1; // index of last element, or -1 if no such
Itr(RunnableScheduledFuture[] array) {
Itr(RunnableScheduledFuture<?>[] array) {
this.array = array;
}

View File

@ -351,7 +351,7 @@ public class Logger {
? caller.getClassLoader()
: null);
if (callersClassLoader != null) {
this.callersClassLoaderRef = new WeakReference(callersClassLoader);
this.callersClassLoaderRef = new WeakReference<>(callersClassLoader);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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
@ -55,11 +55,11 @@ class Logging implements LoggingMXBean {
}
public List<String> getLoggerNames() {
Enumeration loggers = logManager.getLoggerNames();
Enumeration<String> loggers = logManager.getLoggerNames();
ArrayList<String> array = new ArrayList<>();
for (; loggers.hasMoreElements();) {
array.add((String) loggers.nextElement());
array.add(loggers.nextElement());
}
return array;
}

View File

@ -1142,10 +1142,15 @@ public final class Pattern
* input sequence that is terminated by another subsequence that matches
* this pattern or is terminated by the end of the input sequence. The
* substrings in the array are in the order in which they occur in the
* input. If this pattern does not match any subsequence of the input then
* input. If this pattern does not match any subsequence of the input then
* the resulting array has just one element, namely the input sequence in
* string form.
*
* <p> When there is a positive-width match at the beginning of the input
* sequence then an empty leading substring is included at the beginning
* of the resulting array. A zero-width match at the beginning however
* never produces such empty leading substring.
*
* <p> The <tt>limit</tt> parameter controls the number of times the
* pattern is applied and therefore affects the length of the resulting
* array. If the limit <i>n</i> is greater than zero then the pattern
@ -1185,7 +1190,6 @@ public final class Pattern
* <td><tt>{ "b", "", ":and:f" }</tt></td></tr>
* </table></blockquote>
*
*
* @param input
* The character sequence to be split
*
@ -1204,6 +1208,11 @@ public final class Pattern
// Add segments before each match found
while(m.find()) {
if (!matchLimited || matchList.size() < limit - 1) {
if (index == 0 && index == m.start() && m.start() == m.end()) {
// no empty leading substring included for zero-width match
// at the beginning of the input char sequence.
continue;
}
String match = input.subSequence(index, m.start()).toString();
matchList.add(match);
index = m.end();
@ -5755,13 +5764,18 @@ NEXT: while (i <= last) {
* input sequence that is terminated by another subsequence that matches
* this pattern or is terminated by the end of the input sequence. The
* substrings in the stream are in the order in which they occur in the
* input. Trailing empty strings will be discarded and not encountered in
* input. Trailing empty strings will be discarded and not encountered in
* the stream.
*
* <p> If this pattern does not match any subsequence of the input then
* the resulting stream has just one element, namely the input sequence in
* string form.
*
* <p> When there is a positive-width match at the beginning of the input
* sequence then an empty leading substring is included at the beginning
* of the stream. A zero-width match at the beginning however never produces
* such empty leading substring.
*
* <p> If the input sequence is mutable, it must remain constant during the
* execution of the terminal stream operation. Otherwise, the result of the
* terminal stream operation is undefined.
@ -5817,7 +5831,8 @@ NEXT: while (i <= last) {
current = matcher.end();
if (!nextElement.isEmpty()) {
return true;
} else {
} else if (current > 0) { // no empty leading substring for zero-width
// match at the beginning of the input
emptyElementCount++;
}
}

View File

@ -178,8 +178,8 @@ public class AttributeList extends ArrayList<Object> {
/**
* Inserts the attribute specified as an element at the position specified.
* Elements with an index greater than or equal to the current position are
* shifted up. If the index is out of range (index < 0 || index >
* size()) a RuntimeOperationsException should be raised, wrapping the
* shifted up. If the index is out of range {@literal (index < 0 || index >
* size())} a RuntimeOperationsException should be raised, wrapping the
* java.lang.IndexOutOfBoundsException thrown.
*
* @param object The <CODE>Attribute</CODE> object to be inserted.
@ -199,7 +199,7 @@ public class AttributeList extends ArrayList<Object> {
/**
* Sets the element at the position specified to be the attribute specified.
* The previous element at that position is discarded. If the index is
* out of range (index < 0 || index > size() a RuntimeOperationsException
* out of range {@literal (index < 0 || index > size())} a RuntimeOperationsException
* should be raised, wrapping the java.lang.IndexOutOfBoundsException thrown.
*
* @param object The value to which the attribute element should be set.
@ -234,7 +234,7 @@ public class AttributeList extends ArrayList<Object> {
* Inserts all of the elements in the <CODE>AttributeList</CODE> specified
* into this list, starting at the specified position, in the order in which
* they are returned by the Iterator of the {@code AttributeList} specified.
* If the index is out of range (index < 0 || index > size() a
* If the index is out of range {@literal (index < 0 || index > size())} a
* RuntimeOperationsException should be raised, wrapping the
* java.lang.IndexOutOfBoundsException thrown.
*

View File

@ -44,12 +44,12 @@ class BooleanValueExp extends QueryEval implements ValueExp {
private boolean val = false;
/** Creates a new BooleanValueExp representing the boolean literal <val>.*/
/** Creates a new BooleanValueExp representing the boolean literal {@code val}.*/
BooleanValueExp(boolean val) {
this.val = val;
}
/**Creates a new BooleanValueExp representing the Boolean object <val>.*/
/**Creates a new BooleanValueExp representing the Boolean object {@code val}.*/
BooleanValueExp(Boolean val) {
this.val = val.booleanValue();
}

View File

@ -96,7 +96,7 @@ import javax.management.openmbean.OpenType;
* of the mapped Java type, called <em>opendata</em>(J) in the <a
* href="MXBean.html#mapping-rules">MXBean type mapping rules</a>.</p>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="Descriptor Fields">
*
* <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
*
@ -330,7 +330,7 @@ import javax.management.openmbean.OpenType;
* interest outside Model MBeans, for example. But only Model MBeans have
* a predefined behavior for these fields.</p>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="ModelMBean Fields">
*
* <tr><th>Name</th><th>Type</th><th>Used in</th><th>Meaning</th></tr>
*

View File

@ -94,7 +94,7 @@ import java.lang.annotation.*;
* <p>then the resulting {@code Descriptor} will contain the following
* fields:</p>
*
* <table border="2">
* <table border="2" summary="Descriptor Fields">
* <tr><th>Name</th><th>Value</th></tr>
* <tr><td>units</td><td>"bytes"</td></tr>
* <tr><td>descriptionResourceKey</td><td>"bytes.key"</td></tr>
@ -143,7 +143,7 @@ import java.lang.annotation.*;
* or an array of annotations. The value of the field is derived from
* the value of the annotation element as follows:</p>
*
* <table border="2">
* <table border="2" summary="Descriptor Field Types">
* <tr><th>Annotation element</th><th>Descriptor field</th></tr>
* <tr><td>Primitive value ({@code 5}, {@code false}, etc)</td>
* <td>Wrapped value ({@code Integer.valueOf(5)},

View File

@ -344,7 +344,7 @@ public class ImmutableDescriptor implements Descriptor {
* the given object is also a Descriptor, and if the two Descriptors have
* the same field names (possibly differing in case) and the same
* associated values. The respective values for a field in the two
* Descriptors are equal if the following conditions hold:</p>
* Descriptors are equal if the following conditions hold:
*
* <ul>
* <li>If one value is null then the other must be too.</li>

View File

@ -217,8 +217,7 @@ public class JMX {
}
/**
* <p>Make a proxy for an MXBean in a local or remote
* MBean Server.</p>
* Make a proxy for an MXBean in a local or remote MBean Server.
*
* <p>If you have an MBean Server {@code mbs} containing an
* MXBean with {@link ObjectName} {@code name}, and if the
@ -253,7 +252,7 @@ public class JMX {
* <li><p>{@code proxy.setSimpleAttribute("whatever")} will result
* in a call to {@code mbs.}{@link
* MBeanServerConnection#setAttribute setAttribute}<code>(name,
* new Attribute("SimpleAttribute", "whatever"))</code>.<p>
* new Attribute("SimpleAttribute", "whatever"))</code>.</p>
*
* <p>Because {@code String} is a <em>simple type</em>, in the
* sense of {@link javax.management.openmbean.SimpleType}, it

View File

@ -162,7 +162,7 @@ public class MBeanFeatureInfo implements Serializable, DescriptorRead {
* Serializes an {@link MBeanFeatureInfo} to an {@link ObjectOutputStream}.
* @serialData
* For compatibility reasons, an object of this class is serialized as follows.
* <ul>
* <p>
* The method {@link ObjectOutputStream#defaultWriteObject defaultWriteObject()}
* is called first to serialize the object except the field {@code descriptor}
* which is declared as transient. The field {@code descriptor} is serialized
@ -180,7 +180,7 @@ public class MBeanFeatureInfo implements Serializable, DescriptorRead {
* {@link ObjectOutputStream#writeObject writeObject(Object obj)} is called
* to serialize directly the field {@code descriptor}.
* </ul>
* </ul>
*
* @since 1.6
*/
private void writeObject(ObjectOutputStream out) throws IOException {
@ -206,7 +206,7 @@ public class MBeanFeatureInfo implements Serializable, DescriptorRead {
* Deserializes an {@link MBeanFeatureInfo} from an {@link ObjectInputStream}.
* @serialData
* For compatibility reasons, an object of this class is deserialized as follows.
* <ul>
* <p>
* The method {@link ObjectInputStream#defaultReadObject defaultReadObject()}
* is called first to deserialize the object except the field
* {@code descriptor}, which is not serialized in the default way. Then the method
@ -228,7 +228,7 @@ public class MBeanFeatureInfo implements Serializable, DescriptorRead {
* to {@link ImmutableDescriptor#EMPTY_DESCRIPTOR EMPTY_DESCRIPTOR}</li>
* <li>Any other value. A {@link StreamCorruptedException} is thrown.</li>
* </ul>
* </ul>
*
* @since 1.6
*/
private void readObject(ObjectInputStream in)

View File

@ -619,7 +619,7 @@ public class MBeanInfo implements Cloneable, Serializable, DescriptorRead {
* Serializes an {@link MBeanInfo} to an {@link ObjectOutputStream}.
* @serialData
* For compatibility reasons, an object of this class is serialized as follows.
* <ul>
* <p>
* The method {@link ObjectOutputStream#defaultWriteObject defaultWriteObject()}
* is called first to serialize the object except the field {@code descriptor}
* which is declared as transient. The field {@code descriptor} is serialized
@ -637,7 +637,7 @@ public class MBeanInfo implements Cloneable, Serializable, DescriptorRead {
* {@link ObjectOutputStream#writeObject writeObject(Object obj)} is called
* to serialize the field {@code descriptor} directly.
* </ul>
* </ul>
*
* @since 1.6
*/
private void writeObject(ObjectOutputStream out) throws IOException {
@ -661,7 +661,7 @@ public class MBeanInfo implements Cloneable, Serializable, DescriptorRead {
* Deserializes an {@link MBeanInfo} from an {@link ObjectInputStream}.
* @serialData
* For compatibility reasons, an object of this class is deserialized as follows.
* <ul>
* <p>
* The method {@link ObjectInputStream#defaultReadObject defaultReadObject()}
* is called first to deserialize the object except the field
* {@code descriptor}, which is not serialized in the default way. Then the method
@ -683,7 +683,7 @@ public class MBeanInfo implements Cloneable, Serializable, DescriptorRead {
* {@link ImmutableDescriptor#EMPTY_DESCRIPTOR EMPTY_DESCRIPTOR}.</li>
* <li>Any other value. A {@link StreamCorruptedException} is thrown.</li>
* </ul>
* </ul>
*
* @since 1.6
*/

View File

@ -244,7 +244,6 @@ import javax.management.loading.ClassLoaderRepository;
* the caller's permissions must imply {@link
* MBeanPermission#MBeanPermission(String,String,ObjectName,String)
* MBeanPermission(className, null, name, "unregisterMBean")}.</p>
* </p>
*
* </ul>
*

View File

@ -627,7 +627,7 @@ public interface MBeanServerConnection {
* for that attribute, although this is not guaranteed to work. (For
* example, the values of two attributes may have been rejected because
* they were inconsistent with each other. Setting one of them alone might
* be allowed.)<p>
* be allowed.)
*
* <p>Here is an example of calling this method and checking that it
* succeeded in setting all the requested attributes:</p>

View File

@ -86,7 +86,7 @@ package javax.management;
* be set to an array of ObjectNames containing the names of all MBeans
* being registered or unregistered.</li>
* </ul>
* </p>
*
* <p>
* MBeans which emit these group registration/unregistration notifications will
* declare them in their {@link MBeanInfo#getNotifications()

View File

@ -79,7 +79,7 @@ import javax.management.openmbean.TabularType;
public interface MisleadingMXBean {}
</pre>
<h3 id="MXBean-spec">MXBean specification</a></h3>
<h3 id="MXBean-spec">MXBean specification</h3>
<p>The MXBean concept provides a simple way to code an MBean
that only references a predefined set of types, the ones defined
@ -93,7 +93,7 @@ import javax.management.openmbean.TabularType;
Standard MBean concept. Here is how a managed object might be
represented as a Standard MBean, and as an MXBean:</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
<tr>
<th>Standard MBean</th><th>MXBean</th>
</tr>
@ -133,7 +133,7 @@ public interface MemoryPool<b>MXBean</b> {
<p>So, we might define <code>MemoryUsage</code> like this:</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
<tr>
<th>Standard MBean</th><th>MXBean</th>
</tr>
@ -195,7 +195,7 @@ public class MemoryUsage {
<p>This becomes clearer if we compare what the clients of the two
models might look like:</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
<tr>
<th>Standard MBean</th><th>MXBean</th>
</tr>
@ -232,7 +232,7 @@ String name = (String)
managed objects when you know the model beforehand, regardless
of whether you are using Standard MBeans or MXBeans:</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
<tr>
<th>Standard MBean</th><th>MXBean</th>
</tr>
@ -265,7 +265,7 @@ long used = usage.getUsed();
<p>Implementing the MemoryPool object works similarly for both
Standard MBeans and MXBeans.</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
<tr>
<th>Standard MBean</th><th>MXBean</th>
</tr>
@ -292,7 +292,7 @@ public class MemoryPool
<p>Registering the MBean in the MBean Server works in the same way
in both cases:</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Standard Bean vs. MXBean">
<tr>
<th>Standard MBean</th><th>MXBean</th>
</tr>
@ -478,13 +478,13 @@ public class MemoryPool
<p>The following table summarizes the type mapping rules.</p>
<table border="1" cellpadding="5">
<table border="1" cellpadding="5" summary="Type Mapping Rules">
<tr>
<th>Java type <em>J</em></th>
<th><em>opentype(J)</em></th>
<th><em>opendata(J)</em></th>
</tr>
<tbody cellvalign="top">
<tbody valign="top">
<tr>
<td>{@code int}, {@code boolean}, etc<br>
(the 8 primitive Java types)</td>
@ -785,7 +785,7 @@ public interface ModuleMXBean {
</blockquote>
then the item in the {@code CompositeType} is called {@code name}
and has type {@code SimpleType.BOOLEAN}.</p>
and has type {@code SimpleType.BOOLEAN}.
<p>Notice that the first character (or code point) is converted to
lower case. This follows the Java Beans convention, which for

View File

@ -112,7 +112,7 @@ class NumericValueExp extends QueryEval implements ValueExp {
public NumericValueExp() {
}
/** Creates a new NumericValue representing the numeric literal <val>.*/
/** Creates a new NumericValue representing the numeric literal @{code val}.*/
NumericValueExp(Number val)
{
this.val = val;

View File

@ -195,7 +195,7 @@ import java.util.Map;
* represents an ObjectName with two keys. The name of each key
* contains six characters, of which the first and last are spaces.
* The value associated with the key <code>"&nbsp;key1&nbsp;"</code>
* also begins and ends with a space.</p>
* also begins and ends with a space.
*
* <p>In addition to the restrictions on characters spelt out above,
* no part of an ObjectName may contain a newline character
@ -665,7 +665,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
* Construct an ObjectName from a domain and a Hashtable.
*
* @param domain Domain of the ObjectName.
* @param props Map containing couples <i>key</i> -> <i>value</i>.
* @param props Map containing couples <i>key</i> {@literal ->} <i>value</i>.
*
* @exception MalformedObjectNameException The <code>domain</code>
* contains an illegal character, or one of the keys or values in
@ -1549,7 +1549,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
* <li>a comma and an
* asterisk (<code>,*</code>) for an ObjectName that is a property
* list pattern with at least one key.
* </ul></p>
* </ul>
*
* @return The canonical form of the name.
*/

View File

@ -70,17 +70,19 @@ public interface PersistentMBean {
* <P>
* Persistence policy from the MBean and attribute descriptor is used to guide execution
* of this method. The MBean should be stored if 'persistPolicy' field is:
* <PRE> != "never"
* <PRE>{@literal != "never"
* = "always"
* = "onTimer" and now > 'lastPersistTime' + 'persistPeriod'
* = "NoMoreOftenThan" and now > 'lastPersistTime' + 'persistPeriod'
* = "onUnregister"
* <P>
* }</PRE>
* <p>
* Do not store the MBean if 'persistPolicy' field is:
* <PRE>{@literal
* = "never"
* = "onUpdate"
* = "onTimer" && now < 'lastPersistTime' + 'persistPeriod'
* <P></PRE>
* }</PRE>
*
* @exception MBeanException Wraps another exception or persistence is not supported
* @exception RuntimeOperationsException Wraps exceptions from the persistence mechanism

View File

@ -127,9 +127,9 @@ package javax.management;
* @param q2 Another query expression.
*
* @return The conjunction of the two arguments. The returned object
* will be serialized as an instance of the non-public class {@link
* will be serialized as an instance of the non-public class
* <a href="../../serialized-form.html#javax.management.AndQueryExp">
* javax.management.AndQueryExp</a>}.
* javax.management.AndQueryExp</a>.
*/
public static QueryExp and(QueryExp q1, QueryExp q2) {
return new AndQueryExp(q1, q2);
@ -143,9 +143,9 @@ package javax.management;
* @param q2 Another query expression.
*
* @return The disjunction of the two arguments. The returned object
* will be serialized as an instance of the non-public class {@link
* will be serialized as an instance of the non-public class
* <a href="../../serialized-form.html#javax.management.OrQueryExp">
* javax.management.OrQueryExp</a>}.
* javax.management.OrQueryExp</a>.
*/
public static QueryExp or(QueryExp q1, QueryExp q2) {
return new OrQueryExp(q1, q2);
@ -160,9 +160,9 @@ package javax.management;
*
* @return A "greater than" constraint on the arguments. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a>} with a {@code relOp} equal
* non-public class
* <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
* to {@link #GT}.
*/
public static QueryExp gt(ValueExp v1, ValueExp v2) {
@ -178,9 +178,9 @@ package javax.management;
*
* @return A "greater than or equal to" constraint on the
* arguments. The returned object will be serialized as an
* instance of the non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a>} with a {@code relOp} equal
* instance of the non-public class
* <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
* to {@link #GE}.
*/
public static QueryExp geq(ValueExp v1, ValueExp v2) {
@ -196,9 +196,9 @@ package javax.management;
*
* @return A "less than or equal to" constraint on the arguments.
* The returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a>} with a {@code relOp} equal
* non-public class
* <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
* to {@link #LE}.
*/
public static QueryExp leq(ValueExp v1, ValueExp v2) {
@ -214,9 +214,9 @@ package javax.management;
*
* @return A "less than" constraint on the arguments. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a>} with a {@code relOp} equal
* non-public class
* <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
* to {@link #LT}.
*/
public static QueryExp lt(ValueExp v1, ValueExp v2) {
@ -232,9 +232,9 @@ package javax.management;
*
* @return A "equal to" constraint on the arguments. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a>} with a {@code relOp} equal
* non-public class
* <a href="../../serialized-form.html#javax.management.BinaryRelQueryExp">
* javax.management.BinaryRelQueryExp</a> with a {@code relOp} equal
* to {@link #EQ}.
*/
public static QueryExp eq(ValueExp v1, ValueExp v2) {
@ -251,9 +251,9 @@ package javax.management;
*
* @return The constraint that v1 lies between v2 and v3. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BetweenQueryExp">
* javax.management.BetweenQueryExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.BetweenQueryExp">
* javax.management.BetweenQueryExp</a>.
*/
public static QueryExp between(ValueExp v1, ValueExp v2, ValueExp v3) {
return new BetweenQueryExp(v1, v2, v3);
@ -279,9 +279,9 @@ package javax.management;
*
* @return A query expression that represents the matching
* constraint on the string argument. The returned object will
* be serialized as an instance of the non-public class {@link <a
* href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>}.
* be serialized as an instance of the non-public class
* <a href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>.
*/
public static QueryExp match(AttributeValueExp a, StringValueExp s) {
return new MatchQueryExp(a, s);
@ -319,9 +319,9 @@ package javax.management;
*
* @return An attribute expression for the attribute named name.
* The returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.QualifiedAttributeValueExp">
* javax.management.QualifiedAttributeValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.QualifiedAttributeValueExp">
* javax.management.QualifiedAttributeValueExp</a>.
*/
public static AttributeValueExp attr(String className, String name) {
return new QualifiedAttributeValueExp(className, name);
@ -338,9 +338,8 @@ package javax.management;
*
* @return A class attribute expression. The returned object
* will be serialized as an instance of the non-public class
* {@link <a
* href="../../serialized-form.html#javax.management.ClassAttributeValueExp">
* javax.management.ClassAttributeValueExp</a>}.
* <a href="../../serialized-form.html#javax.management.ClassAttributeValueExp">
* javax.management.ClassAttributeValueExp</a>.
*/
public static AttributeValueExp classattr() {
return new ClassAttributeValueExp();
@ -352,9 +351,9 @@ package javax.management;
* @param queryExp The constraint to negate.
*
* @return A negated constraint. The returned object will be
* serialized as an instance of the non-public class {@link <a
* href="../../serialized-form.html#javax.management.NotQueryExp">
* javax.management.NotQueryExp</a>}.
* serialized as an instance of the non-public class
* <a href="../../serialized-form.html#javax.management.NotQueryExp">
* javax.management.NotQueryExp</a>.
*/
public static QueryExp not(QueryExp queryExp) {
return new NotQueryExp(queryExp);
@ -368,9 +367,9 @@ package javax.management;
*
* @return A QueryExp that represents the constraint. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.InQueryExp">
* javax.management.InQueryExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.InQueryExp">
* javax.management.InQueryExp</a>.
*/
public static QueryExp in(ValueExp val, ValueExp valueList[]) {
return new InQueryExp(val, valueList);
@ -395,9 +394,9 @@ package javax.management;
*
* @return A ValueExp object containing the argument. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>.
*/
public static ValueExp value(Number val) {
return new NumericValueExp(val);
@ -411,9 +410,9 @@ package javax.management;
*
* @return A ValueExp object containing the argument. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>.
*/
public static ValueExp value(int val) {
return new NumericValueExp((long) val);
@ -427,9 +426,9 @@ package javax.management;
*
* @return A ValueExp object containing the argument. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>.
*/
public static ValueExp value(long val) {
return new NumericValueExp(val);
@ -443,9 +442,9 @@ package javax.management;
*
* @return A ValueExp object containing the argument. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>.
*/
public static ValueExp value(float val) {
return new NumericValueExp((double) val);
@ -459,9 +458,9 @@ package javax.management;
*
* @return A ValueExp object containing the argument. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.NumericValueExp">
* javax.management.NumericValueExp</a>.
*/
public static ValueExp value(double val) {
return new NumericValueExp(val);
@ -475,9 +474,9 @@ package javax.management;
*
* @return A ValueExp object containing the argument. The
* returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BooleanValueExp">
* javax.management.BooleanValueExp</a>}.
* non-public class
* <a href="../../serialized-form.html#javax.management.BooleanValueExp">
* javax.management.BooleanValueExp</a>.
*/
public static ValueExp value(boolean val) {
return new BooleanValueExp(val);
@ -492,9 +491,9 @@ package javax.management;
*
* @return A ValueExp representing the sum or concatenation of
* the two arguments. The returned object will be serialized as
* an instance of the non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a>} with an {@code op} equal to
* an instance of the non-public class
* <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a> with an {@code op} equal to
* {@link #PLUS}.
*/
public static ValueExp plus(ValueExp value1, ValueExp value2) {
@ -510,9 +509,9 @@ package javax.management;
*
* @return A ValueExp representing the product. The returned
* object will be serialized as an instance of the non-public
* class {@link <a
* href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a>} with an {@code op} equal to
* class
* <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a> with an {@code op} equal to
* {@link #TIMES}.
*/
public static ValueExp times(ValueExp value1,ValueExp value2) {
@ -528,9 +527,9 @@ package javax.management;
*
* @return A ValueExp representing the difference between two
* arguments. The returned object will be serialized as an
* instance of the non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a>} with an {@code op} equal to
* instance of the non-public class
* <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a> with an {@code op} equal to
* {@link #MINUS}.
*/
public static ValueExp minus(ValueExp value1, ValueExp value2) {
@ -546,9 +545,9 @@ package javax.management;
*
* @return A ValueExp representing the quotient of two arguments.
* The returned object will be serialized as an instance of the
* non-public class {@link <a
* href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a>} with an {@code op} equal to
* non-public class
* <a href="../../serialized-form.html#javax.management.BinaryOpValueExp">
* javax.management.BinaryOpValueExp</a> with an {@code op} equal to
* {@link #DIV}.
*/
public static ValueExp div(ValueExp value1, ValueExp value2) {
@ -566,9 +565,9 @@ package javax.management;
*
* @return The constraint that a matches s. The returned object
* will be serialized as an instance of the non-public class
* {@link <a
* href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>}.
*
* <a href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>.
*/
public static QueryExp initialSubString(AttributeValueExp a, StringValueExp s) {
return new MatchQueryExp(a,
@ -585,9 +584,9 @@ package javax.management;
*
* @return The constraint that a matches s. The returned object
* will be serialized as an instance of the non-public class
* {@link <a
* href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>}.
*
* <a href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>.
*/
public static QueryExp anySubString(AttributeValueExp a, StringValueExp s) {
return new MatchQueryExp(a,
@ -605,9 +604,9 @@ package javax.management;
*
* @return The constraint that a matches s. The returned object
* will be serialized as an instance of the non-public class
* {@link <a
* href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>}.
*
* <a href="../../serialized-form.html#javax.management.MatchQueryExp">
* javax.management.MatchQueryExp</a>.
*/
public static QueryExp finalSubString(AttributeValueExp a, StringValueExp s) {
return new MatchQueryExp(a,
@ -630,9 +629,9 @@ package javax.management;
* of the class of which selected MBeans should be instances.
* @return a query expression that represents an inheritance
* constraint on an MBean class. The returned object will be
* serialized as an instance of the non-public class {@link <a
* href="../../serialized-form.html#javax.management.InstanceOfQueryExp">
* javax.management.InstanceOfQueryExp</a>}.
* serialized as an instance of the non-public class
* <a href="../../serialized-form.html#javax.management.InstanceOfQueryExp">
* javax.management.InstanceOfQueryExp</a>.
* @since 1.6
*/
public static QueryExp isInstanceOf(StringValueExp classNameValue) {

View File

@ -145,17 +145,17 @@ import javax.management.ServiceNotFoundException;
* This optional attribute specifies a list of one or more parameters for the
* MBean to be instantiated. This list describes the parameters to be passed the MBean's constructor.
* Use the following syntax to specify each item in
* <VAR>arglist</VAR>:</DD>
* <VAR>arglist</VAR>:
* <DL>
* <P>
* <DT>&lt;<CODE>ARG TYPE=</CODE><VAR>argumentType</VAR> <CODE>VALUE=</CODE><VAR>value</VAR>&gt;</DT>
* <P>
* <DD>where:</DD>
* <DD>where:
* <UL>
* <LI><VAR>argumentType</VAR> is the type of the argument that will be passed as parameter to the MBean's constructor.</UL>
* </DD>
* </DL>
* <P>The arguments' type in the argument list should be a Java primitive type or a Java basic type
* (<CODE>java.lang.Boolean, java.lang.Byte, java.lang.Short, java.lang.Long, java.lang.Integer, java.lang.Float, java.lang.Double, java.lang.String</CODE>).
* </DD>
* </DL>
*
* When an m-let text file is loaded, an

View File

@ -149,7 +149,7 @@ class MLetParser {
}
/**
* Scan an html file for <mlet> tags
* Scan an html file for {@literal <mlet>} tags.
*/
public List<MLetContent> parse(URL url) throws IOException {
String mth = "parse";

View File

@ -799,7 +799,7 @@ public class DescriptorSupport
* the given object is also a Descriptor, and if the two Descriptors have
* the same field names (possibly differing in case) and the same
* associated values. The respective values for a field in the two
* Descriptors are equal if the following conditions hold:</p>
* Descriptors are equal if the following conditions hold:
*
* <ul>
* <li>If one value is null then the other must be too.</li>
@ -871,7 +871,6 @@ public class DescriptorSupport
* done on the <i>"export"</i> field.
* <P>
* Otherwise this implementation returns false if:
* <P>
* <UL>
* <LI> name and descriptorType fieldNames are not defined, or
* null, or empty, or not String
@ -879,14 +878,14 @@ public class DescriptorSupport
* are null or not String
* <LI> persistPeriod, currencyTimeLimit, lastUpdatedTimeStamp,
* lastReturnedTimeStamp if defined, are null, or not a Numeric
* String or not a Numeric Value >= -1
* String or not a Numeric Value {@literal >= -1}
* <LI> log fieldName, if defined, is null, or not a Boolean or
* not a String with value "t", "f", "true", "false". These String
* values must not be case sensitive.
* <LI> visibility fieldName, if defined, is null, or not a
* Numeric String or a not Numeric Value >= 1 and &lt;= 4
* Numeric String or a not Numeric Value {@literal >= 1 and <= 4}
* <LI> severity fieldName, if defined, is null, or not a Numeric
* String or not a Numeric Value >= 0 and &lt;= 6<br>
* String or not a Numeric Value {@literal >= 0 and <= 6}<br>
* <LI> persistPolicy fieldName, if defined, is null, or not one of
* the following strings:<br>
* "OnUpdate", "OnTimer", "NoMoreOftenThan", "OnUnregister", "Always",
@ -1270,8 +1269,8 @@ public class DescriptorSupport
}
/**
* Returns <pv>a human readable string representing the
* descriptor</pv>. The string will be in the format of
* Returns a human readable string representing the
* descriptor. The string will be in the format of
* "fieldName=fieldValue,fieldName2=fieldValue2,..."<br>
*
* If there are no fields in the descriptor, then an empty String

View File

@ -57,7 +57,7 @@ import javax.management.RuntimeOperationsException;
* Note that when the Type in this table is Number, a String that is the decimal
* representation of a Long can also be used.</P>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="ModelMBeanAttributeInfo Fields">
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
* <tr><td>name</td><td>String</td>
* <td>Attribute name.</td></tr>

View File

@ -58,7 +58,7 @@ import javax.management.RuntimeOperationsException;
* Note that when the Type in this table is Number, a String that is the decimal
* representation of a Long can also be used.</P>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="ModelMBeanConstructorInfo Fields">
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
* <tr><td>name</td><td>String</td>
* <td>Constructor name.</td></tr>

View File

@ -165,7 +165,7 @@ public interface ModelMBeanInfo
* following. Note that when the Type in this table is Number, a String
* that is the decimal representation of a Long can also be used.</P>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="ModelMBean Fields">
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
* <tr><td>name</td><td>String</td>
* <td>MBean name.</td></tr>

View File

@ -127,7 +127,6 @@ public interface ModelMBeanNotificationBroadcaster extends NotificationBroadcast
* <P>
* @param oldValue The original value for the Attribute
* @param newValue The current value for the Attribute
*<P>
* <PRE>
* The constructed attributeChangeNotification will be:
* type "jmx.attribute.change"

View File

@ -56,7 +56,7 @@ import javax.management.RuntimeOperationsException;
* Note that when the Type in this table is Number, a String that is the decimal
* representation of a Long can also be used.</P>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="ModelMBeanNotificationInfo Fields">
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
* <tr><td>name</td><td>String</td>
* <td>Notification name.</td></tr>

View File

@ -59,7 +59,7 @@ import javax.management.RuntimeOperationsException;
* Note that when the Type in this table is Number, a String that is the decimal
* representation of a Long can also be used.</P>
*
* <table border="1" cellpadding="5">
* <table border="1" cellpadding="5" summary="ModelMBeanOperationInfo Fields">
* <tr><th>Name</th><th>Type</th><th>Meaning</th></tr>
* <tr><td>name</td><td>String</td>
* <td>Operation name.</td></tr>

View File

@ -421,19 +421,19 @@ public class RequiredModelMBean
* is used to guide execution of this method. The MBean should be
* stored if 'persistPolicy' field is:</p>
*
* <PRE> != "never"
* <PRE>{@literal != "never"
* = "always"
* = "onTimer" and now > 'lastPersistTime' + 'persistPeriod'
* = "NoMoreOftenThan" and now > 'lastPersistTime' + 'persistPeriod'
* = "onUnregister"
* </PRE>
* }</PRE>
*
* <p>Do not store the MBean if 'persistPolicy' field is:</p>
* <PRE>
* <PRE>{@literal
* = "never"
* = "onUpdate"
* = "onTimer" && now < 'lastPersistTime' + 'persistPeriod'
* </PRE>
* }</PRE>
*
* @exception MBeanException Wraps another exception, or
* persistence is not supported
@ -469,11 +469,14 @@ public class RequiredModelMBean
* <li><b>&gt;0</b> Represents the number of seconds that the
* 'value' field is valid.
* The 'value' field is no longer valid when
* 'lastUpdatedTimeStamp' + 'currencyTimeLimit' &gt; Now.</li>
* 'lastUpdatedTimeStamp' + 'currencyTimeLimit' &gt; Now.
* <ul>
* <li>When 'value' is valid, 'valid' is returned.</li>
* <li>When 'value' is no longer valid then null is returned and
* 'value' and 'lastUpdatedTimeStamp' fields are cleared.</li>
* </ul>
* </li>
* </ul>
* <li>When 'value' is valid, 'valid' is returned.</li>
* <li>When 'value' is no longer valid then null is returned and
* 'value' and 'lastUpdatedTimeStamp' fields are cleared.</li>
*
**/
private Object resolveForCacheValue(Descriptor descr)
@ -1842,17 +1845,17 @@ public class RequiredModelMBean
* <Li> != "never"</Li>
* <Li> = "always"</Li>
* <Li> = "onUpdate"</Li>
* <Li> = "onTimer" and now &gt; 'lastPersistTime' + 'persistPeriod'</Li>
* <Li> = "NoMoreOftenThan" and now &gt; 'lastPersistTime' +
* 'persistPeriod'</Li>
* <Li> {@literal = "onTimer" and now > 'lastPersistTime' + 'persistPeriod'}</Li>
* <Li> {@literal = "NoMoreOftenThan" and now > 'lastPersistTime' +
* 'persistPeriod'}</Li>
* </UL>
* Do not store the MBean if 'persistPolicy' field is:
* <UL>
* <Li> = "never"</Li>
* <Li> = "onTimer" && now &lt; 'lastPersistTime' + 'persistPeriod'</Li>
* <Li> = {@literal = "onTimer" && now < 'lastPersistTime' + 'persistPeriod'}</Li>
* <Li> = "onUnregister"</Li>
* <Li> = "NoMoreOftenThan" and now &lt; 'lastPersistTime' +
* 'persistPeriod'</Li>
* <Li> = {@literal = "NoMoreOftenThan" and now < 'lastPersistTime' +
* 'persistPeriod'}</Li>
* </UL>
*
* <p>The ModelMBeanInfo of the Model MBean is stored in a file.

View File

@ -1609,7 +1609,7 @@ public abstract class Monitor
* the thread instantiating this DaemonThreadFactory. Each new
* thread is created as a daemon thread with priority
* Thread.NORM_PRIORITY. New threads have names accessible via
* Thread.getName() of "JMX Monitor <pool-name> Pool [Thread-M]",
* Thread.getName() of "{@literal JMX Monitor <pool-name> Pool [Thread-M]}",
* where M is the sequence number of the thread created by this
* factory.
*/

View File

@ -33,7 +33,7 @@ import java.lang.reflect.Array;
* all <i>open data</i> values which are n-dimensional arrays of <i>open data</i> values.
* <p>
* Examples of valid {@code ArrayType} instances are:
* <pre>
* <pre>{@code
* // 2-dimension array of java.lang.String
* ArrayType<String[][]> a1 = new ArrayType<String[][]>(2, SimpleType.STRING);
*
@ -90,7 +90,7 @@ import java.lang.reflect.Array;
*
* // 3-dimension array of java.lang.String
* ArrayType<String[][][]> a19 = new ArrayType<String[][][]>(1, a18);
* </pre>
* }</pre>
*
*
* @since 1.5
@ -241,23 +241,23 @@ public class ArrayType<T> extends OpenType<T> {
* </ul>
* <p>
* As an example, the following piece of code:
* <pre>
* <pre>{@code
* ArrayType<String[][][]> t = new ArrayType<String[][][]>(3, SimpleType.STRING);
* System.out.println("array class name = " + t.getClassName());
* System.out.println("element class name = " + t.getElementOpenType().getClassName());
* System.out.println("array type name = " + t.getTypeName());
* System.out.println("array type description = " + t.getDescription());
* </pre>
* }</pre>
* would produce the following output:
* <pre>
* <pre>{@code
* array class name = [[[Ljava.lang.String;
* element class name = java.lang.String
* array type name = [[[Ljava.lang.String;
* array type description = 3-dimension array of java.lang.String
* </pre>
* }</pre>
* And the following piece of code which is equivalent to the one listed
* above would also produce the same output:
* <pre>
* <pre>{@code
* ArrayType<String[]> t1 = new ArrayType<String[]>(1, SimpleType.STRING);
* ArrayType<String[][]> t2 = new ArrayType<String[][]>(1, t1);
* ArrayType<String[][][]> t3 = new ArrayType<String[][][]>(1, t2);
@ -265,7 +265,7 @@ public class ArrayType<T> extends OpenType<T> {
* System.out.println("element class name = " + t3.getElementOpenType().getClassName());
* System.out.println("array type name = " + t3.getTypeName());
* System.out.println("array type description = " + t3.getDescription());
* </pre>
* }</pre>
*
* @param dimension the dimension of arrays described by this <tt>ArrayType</tt> instance;
* must be greater than or equal to 1.
@ -334,20 +334,20 @@ public class ArrayType<T> extends OpenType<T> {
* </ul>
* <p>
* As an example, the following piece of code:
* <pre>
* <pre>{@code
* ArrayType<int[]> t = new ArrayType<int[]>(SimpleType.INTEGER, true);
* System.out.println("array class name = " + t.getClassName());
* System.out.println("element class name = " + t.getElementOpenType().getClassName());
* System.out.println("array type name = " + t.getTypeName());
* System.out.println("array type description = " + t.getDescription());
* </pre>
* }</pre>
* would produce the following output:
* <pre>
* <pre>{@code
* array class name = [I
* element class name = java.lang.Integer
* array type name = [I
* array type description = 1-dimension array of int
* </pre>
* }</pre>
*
* @param elementType the {@code SimpleType} of the element values
* contained in the arrays described by this
@ -533,7 +533,7 @@ public class ArrayType<T> extends OpenType<T> {
* <li>if this <code>ArrayType</code> instance describes an array of
* classes implementing the {@code TabularData} interface or the
* {@code CompositeData} interface, <var>obj</var> is assignable to
* such a declared array, and each element contained in <var>obj</var>
* such a declared array, and each element contained in {<var>obj</var>
* is either null or a valid value for the element's open type specified
* by this <code>ArrayType</code> instance.</li>
* </ul>
@ -776,7 +776,7 @@ public class ArrayType<T> extends OpenType<T> {
* object or two equal but not identical objects.
* <p>
* As an example, the following piece of code:
* <pre>
* <pre>{@code
* ArrayType<String[]> t1 = ArrayType.getArrayType(SimpleType.STRING);
* ArrayType<String[][]> t2 = ArrayType.getArrayType(t1);
* ArrayType<String[][][]> t3 = ArrayType.getArrayType(t2);
@ -784,14 +784,14 @@ public class ArrayType<T> extends OpenType<T> {
* System.out.println("element class name = " + t3.getElementOpenType().getClassName());
* System.out.println("array type name = " + t3.getTypeName());
* System.out.println("array type description = " + t3.getDescription());
* </pre>
* }</pre>
* would produce the following output:
* <pre>
* <pre>{@code
* array class name = [[[Ljava.lang.String;
* element class name = java.lang.String
* array type name = [[[Ljava.lang.String;
* array type description = 3-dimension array of java.lang.String
* </pre>
* }</pre>
*
* @param elementType the <i>open type</i> of element values contained
* in the arrays described by this <tt>ArrayType</tt>
@ -819,20 +819,20 @@ public class ArrayType<T> extends OpenType<T> {
* same object or two equal but not identical objects.
* <p>
* As an example, the following piece of code:
* <pre>
* <pre>{@code
* ArrayType<int[][][]> t = ArrayType.getPrimitiveArrayType(int[][][].class);
* System.out.println("array class name = " + t.getClassName());
* System.out.println("element class name = " + t.getElementOpenType().getClassName());
* System.out.println("array type name = " + t.getTypeName());
* System.out.println("array type description = " + t.getDescription());
* </pre>
* }</pre>
* would produce the following output:
* <pre>
* <pre>{@code
* array class name = [[[I
* element class name = java.lang.Integer
* array type name = [[[I
* array type description = 3-dimension array of int
* </pre>
* }</pre>
*
* @param arrayClass a primitive array class such as {@code int[].class},
* {@code boolean[][].class}, etc. The {@link

View File

@ -80,7 +80,7 @@ import java.lang.reflect.Proxy;
</pre>
</blockquote>
A call to {@code nn.getNumber()} will then return <b>5</b>.</p>
A call to {@code nn.getNumber()} will then return <b>5</b>.
<p>If the first letter of the property defined by a getter is a
capital, then this handler will look first for an item in the

View File

@ -40,7 +40,7 @@ import java.util.Iterator;
/**
* The <code>CompositeType</code> class is the <i>open type</i> class
* whose instances describe the types of {@link CompositeData <code>CompositeData</code>} values.
* whose instances describe the types of {@link CompositeData CompositeData} values.
*
*
* @since 1.5

View File

@ -138,8 +138,8 @@ public class OpenMBeanAttributeInfoSupport
*
* <p>The {@code descriptor} can contain entries that will define
* the values returned by certain methods of this class, as
* explained in the {@link <a href="package-summary.html#constraints">
* package description</a>}.
* explained in the <a href="package-summary.html#constraints">
* package description</a>.
*
* @param name cannot be a null or empty string.
*
@ -162,8 +162,7 @@ public class OpenMBeanAttributeInfoSupport
* @throws IllegalArgumentException if {@code name} or {@code
* description} are null or empty string, or {@code openType} is
* null, or the descriptor entries are invalid as described in the
* {@link <a href="package-summary.html#constraints">package
* description</a>}.
* <a href="package-summary.html#constraints">package description</a>.
*
* @since 1.6
*/

View File

@ -111,16 +111,16 @@ public class OpenMBeanParameterInfoSupport
}
/**
* <p>Constructs an {@code OpenMBeanParameterInfoSupport} instance,
* Constructs an {@code OpenMBeanParameterInfoSupport} instance,
* which describes the parameter used in one or more operations or
* constructors of a class of open MBeans, with the specified
* {@code name}, {@code openType}, {@code description},
* and {@code descriptor}.</p>
* and {@code descriptor}.
*
* <p>The {@code descriptor} can contain entries that will define
* the values returned by certain methods of this class, as
* explained in the {@link <a href="package-summary.html#constraints">
* package description</a>}.
* explained in the <a href="package-summary.html#constraints">
* package description</a>.
*
* @param name cannot be a null or empty string.
*
@ -134,8 +134,8 @@ public class OpenMBeanParameterInfoSupport
* @throws IllegalArgumentException if {@code name} or {@code
* description} are null or empty string, or {@code openType} is
* null, or the descriptor entries are invalid as described in the
* {@link <a href="package-summary.html#constraints">package
* description</a>}.
* <a href="package-summary.html#constraints">package
* description</a>.
*
* @since 1.6
*/

View File

@ -45,8 +45,8 @@ import javax.management.ObjectName;
/**
* The <code>SimpleType</code> class is the <i>open type</i> class whose instances describe
* all <i>open data</i> values which are neither arrays,
* nor {@link CompositeData <code>CompositeData</code>} values,
* nor {@link TabularData <code>TabularData</code>} values.
* nor {@link CompositeData CompositeData} values,
* nor {@link TabularData TabularData} values.
* It predefines all its possible instances as static fields, and has no public constructor.
* <p>
* Given a <code>SimpleType</code> instance describing values whose Java class name is <i>className</i>,

View File

@ -40,7 +40,7 @@ import java.util.List;
/**
* The <code>TabularType</code> class is the <i> open type</i> class
* whose instances describe the types of {@link TabularData <code>TabularData</code>} values.
* whose instances describe the types of {@link TabularData TabularData} values.
*
* @since 1.5
*/
@ -89,8 +89,8 @@ public class TabularType extends OpenType<TabularData> {
* cannot be null or empty. Each element should be an item name defined in <var>rowType</var>
* (no null or empty string allowed).
* It is important to note that the <b>order</b> of the item names in <var>indexNames</var>
* is used by the methods {@link TabularData#get(java.lang.Object[]) <code>get</code>} and
* {@link TabularData#remove(java.lang.Object[]) <code>remove</code>} of class
* is used by the methods {@link TabularData#get(java.lang.Object[]) get} and
* {@link TabularData#remove(java.lang.Object[]) remove} of class
* <code>TabularData</code> to match their array of values parameter to items.
* <br>&nbsp;
* @throws IllegalArgumentException if <var>rowType</var> is null,

View File

@ -236,7 +236,7 @@ public interface Relation {
* Retrieves MBeans referenced in the various roles of the relation.
*
* @return a HashMap mapping:
* <P> ObjectName -> ArrayList of String (role names)
* <P> ObjectName {@literal ->} ArrayList of String (role names)
*/
public Map<ObjectName,List<String>> getReferencedMBeans();

View File

@ -2306,8 +2306,7 @@ public class RelationService extends NotificationBroadcasterSupport
* @param relationId relation id
*
* @return a HashMap mapping:
* <P> ObjectName -> ArrayList of String (role
* names)
* <P> ObjectName {@literal ->} ArrayList of String (role names)
*
* @exception IllegalArgumentException if null parameter
* @exception RelationNotFoundException if no relation for given

View File

@ -770,7 +770,7 @@ public interface RelationServiceMBean {
* @param relationId relation id
*
* @return a HashMap mapping:
* <P> ObjectName -> ArrayList of String (role
* <P> ObjectName {@literal ->} ArrayList of String (role
* names)
*
* @exception IllegalArgumentException if null parameter

View File

@ -590,7 +590,7 @@ public class RelationSupport
* Retrieves MBeans referenced in the various roles of the relation.
*
* @return a HashMap mapping:
* <P> ObjectName -> ArrayList of String (role names)
* <P> ObjectName {@literal ->} ArrayList of String (role names)
*/
public Map<ObjectName,List<String>> getReferencedMBeans() {

View File

@ -40,7 +40,7 @@ import javax.management.ObjectName;
*
* <p>The notification type is one of the following:</p>
*
* <table>
* <table summary="JMXConnectionNotification Types">
*
* <tr>
* <th align=left>Type</th>

View File

@ -76,7 +76,7 @@ public interface JMXConnector extends Closeable {
* <p>If <code>connect</code> has already been called successfully
* on this object, calling it again has no effect. If, however,
* {@link #close} was called after <code>connect</code>, the new
* <code>connect</code> will throw an <code>IOException</code>.<p>
* <code>connect</code> will throw an <code>IOException</code>.
*
* <p>Otherwise, either <code>connect</code> has never been called
* on this object, or it has been called but produced an

View File

@ -50,7 +50,7 @@ public interface JMXConnectorProvider {
* @param environment a read-only Map containing named attributes
* to determine how the connection is made. Keys in this map must
* be Strings. The appropriate type of each associated value
* depends on the attribute.</p>
* depends on the attribute.
*
* @return a <code>JMXConnector</code> representing the new
* connector client. Each successful call to this method produces

View File

@ -1613,7 +1613,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
/**
* Construct a new IOException with a nested exception.
* The nested exception is set only if JDK >= 1.4
* The nested exception is set only if JDK {@literal >= 1.4}
*/
private static IOException newIOException(String message,
Throwable cause) {

View File

@ -1688,17 +1688,17 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
* this method will attempt to connect the stub to an ORB as
* follows:
* <ul>
* <p>This method looks in the provided <var>environment</var> for
* <li>This method looks in the provided <var>environment</var> for
* the "java.naming.corba.orb" property. If it is found, the
* referenced object (an {@link org.omg.CORBA.ORB ORB}) is used to
* connect the stub. Otherwise, a new org.omg.CORBA.ORB is created
* by calling {@link
* org.omg.CORBA.ORB#init(String[], Properties)
* org.omg.CORBA.ORB.init((String[])null,(Properties)null)}
* <p>The new created ORB is kept in a static
* org.omg.CORBA.ORB.init((String[])null,(Properties)null)}</li>
* <li>The new created ORB is kept in a static
* {@link WeakReference} and can be reused for connecting other
* stubs. However, no reference is ever kept on the ORB provided
* in the <var>environment</var> map, if any.
* in the <var>environment</var> map, if any.</li>
* </ul>
* @param rmiServer A RMI Server Stub.
* @param environment An environment map, possibly containing an ORB.

View File

@ -820,7 +820,7 @@ public class RMIConnectorServer extends JMXConnectorServer {
/**
* Construct a new IOException with a nested exception.
* The nested exception is set only if JDK >= 1.4
* The nested exception is set only if JDK {@literal >= 1.4}
*/
private static IOException newIOException(String message,
Throwable cause) {

View File

@ -117,7 +117,7 @@ public abstract class RMIServerImpl implements Closeable, RMIServer {
* server.</p>
*
* @return the default <code>ClassLoader</code> used by this
* connector server.</p>
* connector server.
*
* @see #setDefaultClassLoader
*/

View File

@ -233,11 +233,14 @@ public class ByteVector {
* automatically enlarged if necessary.
*
* @param s
* a String.
* a String whose UTF8 encoded length must be less than 65536.
* @return this byte vector.
*/
public ByteVector putUTF8(final String s) {
int charLength = s.length();
if (charLength > 65535) {
throw new IllegalArgumentException();
}
int len = length;
if (len + 2 + charLength > data.length) {
enlarge(2 + charLength);
@ -267,6 +270,9 @@ public class ByteVector {
byteLength += 2;
}
}
if (byteLength > 65535) {
throw new IllegalArgumentException();
}
data[length] = (byte) (byteLength >>> 8);
data[length + 1] = (byte) byteLength;
if (length + 2 + byteLength > data.length) {

View File

@ -1266,7 +1266,7 @@ public class ClassReader {
u += 2;
// generates the first (implicit) stack map frame
if (FRAMES && (stackMap != 0 || unzip)) {
if (FRAMES && stackMap != 0) {
/*
* for the first explicit frame the offset is not offset_delta + 1
* but only offset_delta; setting the implicit frame offset to -1
@ -1283,8 +1283,6 @@ public class ClassReader {
if (unzip) {
getImplicitFrame(context);
}
}
if (FRAMES && stackMap != 0) {
/*
* Finds labels for UNINITIALIZED frame types. Instead of decoding
* each element of the stack map table, we look for 3 consecutive
@ -1322,17 +1320,19 @@ public class ClassReader {
}
}
// visits the frame(s) for this offset, if any
// visits the frame for this offset, if any
while (FRAMES && frame != null
&& (frame.offset == offset || frame.offset == -1)) {
// if there is a frame for this offset, makes the visitor visit
// it, and reads the next frame if there is one.
if (!zip || unzip) {
mv.visitFrame(Opcodes.F_NEW, frame.localCount, frame.local,
frame.stackCount, frame.stack);
} else if (frame.offset != -1) {
mv.visitFrame(frame.mode, frame.localDiff, frame.local,
frame.stackCount, frame.stack);
if (frame.offset != -1) {
if (!zip || unzip) {
mv.visitFrame(Opcodes.F_NEW, frame.localCount,
frame.local, frame.stackCount, frame.stack);
} else {
mv.visitFrame(frame.mode, frame.localDiff, frame.local,
frame.stackCount, frame.stack);
}
}
if (frameCount > 0) {
stackMap = readFrame(stackMap, zip, unzip, frame);
@ -1434,6 +1434,7 @@ public class ClassReader {
case ClassWriter.FIELDORMETH_INSN:
case ClassWriter.ITFMETH_INSN: {
int cpIndex = items[readUnsignedShort(u + 1)];
boolean itf = b[cpIndex - 1] == ClassWriter.IMETH;
String iowner = readClass(cpIndex, c);
cpIndex = items[readUnsignedShort(cpIndex + 2)];
String iname = readUTF8(cpIndex, c);
@ -1441,7 +1442,7 @@ public class ClassReader {
if (opcode < Opcodes.INVOKEVIRTUAL) {
mv.visitFieldInsn(opcode, iowner, iname, idesc);
} else {
mv.visitMethodInsn(opcode, iowner, iname, idesc);
mv.visitMethodInsn(opcode, iowner, iname, idesc, itf);
}
if (opcode == Opcodes.INVOKEINTERFACE) {
u += 5;

View File

@ -516,12 +516,12 @@ public class ClassWriter extends ClassVisitor {
* <tt>true</tt> if the maximum stack size and number of local variables
* must be automatically computed.
*/
private final boolean computeMaxs;
private boolean computeMaxs;
/**
* <tt>true</tt> if the stack map frames must be recomputed from scratch.
*/
private final boolean computeFrames;
private boolean computeFrames;
/**
* <tt>true</tt> if the stack map tables of this class are invalid. The
@ -988,9 +988,22 @@ public class ClassWriter extends ClassVisitor {
attrs.put(this, null, 0, -1, -1, out);
}
if (invalidFrames) {
ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);
new ClassReader(out.data).accept(cw, ClassReader.SKIP_FRAMES);
return cw.toByteArray();
anns = null;
ianns = null;
attrs = null;
innerClassesCount = 0;
innerClasses = null;
bootstrapMethodsCount = 0;
bootstrapMethods = null;
firstField = null;
lastField = null;
firstMethod = null;
lastMethod = null;
computeMaxs = false;
computeFrames = true;
invalidFrames = false;
new ClassReader(out.data).accept(this, ClassReader.SKIP_FRAMES);
return toByteArray();
}
return out.data;
}

View File

@ -78,7 +78,8 @@ public final class Handle {
final int tag;
/**
* The internal name of the field or method designed by this handle.
* The internal name of the class that owns the field or method designated
* by this handle.
*/
final String owner;
@ -105,8 +106,8 @@ public final class Handle {
* {@link Opcodes#H_NEWINVOKESPECIAL} or
* {@link Opcodes#H_INVOKEINTERFACE}.
* @param owner
* the internal name of the field or method designed by this
* handle.
* the internal name of the class that owns the field or method
* designated by this handle.
* @param name
* the name of the field or method designated by this handle.
* @param desc
@ -135,9 +136,11 @@ public final class Handle {
}
/**
* Returns the internal name of the field or method designed by this handle.
* Returns the internal name of the class that owns the field or method
* designated by this handle.
*
* @return the internal name of the field or method designed by this handle.
* @return the internal name of the class that owns the field or method
* designated by this handle.
*/
public String getOwner() {
return owner;

View File

@ -68,11 +68,11 @@ package jdk.internal.org.objectweb.asm;
* <tt>visitTryCatchBlock</tt> | <tt>visitTryCatchBlockAnnotation</tt> |
* <tt>visitLocalVariable</tt> | <tt>visitLocalVariableAnnotation</tt> |
* <tt>visitLineNumber</tt> )* <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In
* addition, the <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt>
* methods must be called in the sequential order of the bytecode instructions
* of the visited code, <tt>visitInsnAnnotation</tt> must be called <i>after</i>
* the annotated instruction, <tt>visitTryCatchBlock</tt> must be called
* <i>before</i> the labels passed as arguments have been visited,
* addition, the <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt> methods must
* be called in the sequential order of the bytecode instructions of the visited
* code, <tt>visitInsnAnnotation</tt> must be called <i>after</i> the annotated
* instruction, <tt>visitTryCatchBlock</tt> must be called <i>before</i> the
* labels passed as arguments have been visited,
* <tt>visitTryCatchBlockAnnotation</tt> must be called <i>after</i> the
* corresponding try catch block has been visited, and the
* <tt>visitLocalVariable</tt>, <tt>visitLocalVariableAnnotation</tt> and
@ -274,13 +274,9 @@ public abstract class MethodVisitor {
* compressed form (all frames must use the same format, i.e. you must not
* mix expanded and compressed frames within a single method):
* <ul>
* <li>In expanded form, all frames must have the F_NEW type, and a first
* frame corresponding to the method signature must be explicitly visited
* before the first instruction.</li>
* <li>In expanded form, all frames must have the F_NEW type.</li>
* <li>In compressed form, frames are basically "deltas" from the state of
* the previous frame (the first frame, corresponding to the method's
* parameters and access flags, is implicit in this form, and must not be
* visited):
* the previous frame:
* <ul>
* <li>{@link Opcodes#F_SAME} representing frame with exactly the same
* locals as the previous frame and with the empty stack.</li>
@ -296,8 +292,14 @@ public abstract class MethodVisitor {
* same as the locals in the previous frame, except that the last 1-3 locals
* are absent and with the empty stack (<code>nLocals</code> is 1, 2 or 3).</li>
* <li>{@link Opcodes#F_FULL} representing complete frame data.</li>
* </ul></li>
* </ul>
* </li>
* </ul>
* <br>
* In both cases the first frame, corresponding to the method's parameters
* and access flags, is implicit and must not be visited. Also, it is
* illegal to visit two or more frames for the same code location (i.e., at
* least one instruction must be visited between two calls to visitFrame).
*
* @param type
* the type of this stack map frame. Must be
@ -466,13 +468,52 @@ public abstract class MethodVisitor {
* @param desc
* the method's descriptor (see {@link Type Type}).
*/
@Deprecated
public void visitMethodInsn(int opcode, String owner, String name,
String desc) {
if (api >= Opcodes.ASM5) {
boolean itf = opcode == Opcodes.INVOKEINTERFACE;
visitMethodInsn(opcode, owner, name, desc, itf);
return;
}
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc);
}
}
/**
* Visits a method instruction. A method instruction is an instruction that
* invokes a method.
*
* @param opcode
* the opcode of the type instruction to be visited. This opcode
* is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
* INVOKEINTERFACE.
* @param owner
* the internal name of the method's owner class (see
* {@link Type#getInternalName() getInternalName}).
* @param name
* the method's name.
* @param desc
* the method's descriptor (see {@link Type Type}).
* @param itf
* if the method's owner class is an interface.
*/
public void visitMethodInsn(int opcode, String owner, String name,
String desc, boolean itf) {
if (api < Opcodes.ASM5) {
if (itf != (opcode == Opcodes.INVOKEINTERFACE)) {
throw new IllegalArgumentException(
"INVOKESPECIAL/STATIC on interfaces require ASM 5");
}
visitMethodInsn(opcode, owner, name, desc);
return;
}
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
}
/**
* Visits an invokedynamic instruction.
*

View File

@ -71,7 +71,7 @@ class MethodWriter extends MethodVisitor {
/**
* Pseudo access flag used to denote constructors.
*/
static final int ACC_CONSTRUCTOR = 262144;
static final int ACC_CONSTRUCTOR = 0x80000;
/**
* Frame has exactly the same locals as the previous stack map frame and
@ -297,11 +297,6 @@ class MethodWriter extends MethodVisitor {
*/
private int[] previousFrame;
/**
* Index of the next element to be added in {@link #frame}.
*/
private int frameIndex;
/**
* The current stack map frame. The first element contains the offset of the
* instruction to which the frame corresponds, the second element is the
@ -496,6 +491,9 @@ class MethodWriter extends MethodVisitor {
cw.lastMethod = this;
this.cw = cw;
this.access = access;
if ("<init>".equals(name)) {
this.access |= ACC_CONSTRUCTOR;
}
this.name = cw.newUTF8(name);
this.desc = cw.newUTF8(desc);
this.descriptor = desc;
@ -511,9 +509,6 @@ class MethodWriter extends MethodVisitor {
}
this.compute = computeFrames ? FRAMES : (computeMaxs ? MAXS : NOTHING);
if (computeMaxs || computeFrames) {
if (computeFrames && "<init>".equals(name)) {
this.access |= ACC_CONSTRUCTOR;
}
// updates maxLocals
int size = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
if ((access & Opcodes.ACC_STATIC) != 0) {
@ -649,8 +644,11 @@ class MethodWriter extends MethodVisitor {
}
if (type == Opcodes.F_NEW) {
if (previousFrame == null) {
visitImplicitFirstFrame();
}
currentLocals = nLocal;
startFrame(code.length, nLocal, nStack);
int frameIndex = startFrame(code.length, nLocal, nStack);
for (int i = 0; i < nLocal; ++i) {
if (local[i] instanceof String) {
frame[frameIndex++] = Frame.OBJECT
@ -914,9 +912,8 @@ class MethodWriter extends MethodVisitor {
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
final String name, final String desc, final boolean itf) {
lastCodeOffset = code.length;
boolean itf = opcode == Opcodes.INVOKEINTERFACE;
Item i = cw.newMethodItem(owner, name, desc, itf);
int argSize = i.intVal;
// Label currentBlock = this.currentBlock;
@ -954,7 +951,7 @@ class MethodWriter extends MethodVisitor {
}
}
// adds the instruction to the bytecode of the method
if (itf) {
if (opcode == Opcodes.INVOKEINTERFACE) {
if (argSize == 0) {
argSize = Type.getArgumentsAndReturnSizes(desc);
i.intVal = argSize;
@ -1528,8 +1525,8 @@ class MethodWriter extends MethodVisitor {
}
code.data[end] = (byte) Opcodes.ATHROW;
// emits a frame for this unreachable block
startFrame(start, 0, 1);
frame[frameIndex++] = Frame.OBJECT
int frameIndex = startFrame(start, 0, 1);
frame[frameIndex] = Frame.OBJECT
| cw.addType("java/lang/Throwable");
endFrame();
// removes the start-end range from the exception
@ -1756,7 +1753,7 @@ class MethodWriter extends MethodVisitor {
}
}
// visits the frame and its content
startFrame(f.owner.position, nLocal, nStack);
int frameIndex = startFrame(f.owner.position, nLocal, nStack);
for (i = 0; nLocal > 0; ++i, --nLocal) {
t = locals[i];
frame[frameIndex++] = t;
@ -1774,6 +1771,67 @@ class MethodWriter extends MethodVisitor {
endFrame();
}
/**
* Visit the implicit first frame of this method.
*/
private void visitImplicitFirstFrame() {
// There can be at most descriptor.length() + 1 locals
int frameIndex = startFrame(0, descriptor.length() + 1, 0);
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & ACC_CONSTRUCTOR) == 0) {
frame[frameIndex++] = Frame.OBJECT | cw.addType(cw.thisName);
} else {
frame[frameIndex++] = 6; // Opcodes.UNINITIALIZED_THIS;
}
}
int i = 1;
loop: while (true) {
int j = i;
switch (descriptor.charAt(i++)) {
case 'Z':
case 'C':
case 'B':
case 'S':
case 'I':
frame[frameIndex++] = 1; // Opcodes.INTEGER;
break;
case 'F':
frame[frameIndex++] = 2; // Opcodes.FLOAT;
break;
case 'J':
frame[frameIndex++] = 4; // Opcodes.LONG;
break;
case 'D':
frame[frameIndex++] = 3; // Opcodes.DOUBLE;
break;
case '[':
while (descriptor.charAt(i) == '[') {
++i;
}
if (descriptor.charAt(i) == 'L') {
++i;
while (descriptor.charAt(i) != ';') {
++i;
}
}
frame[frameIndex++] = Frame.OBJECT
| cw.addType(descriptor.substring(j, ++i));
break;
case 'L':
while (descriptor.charAt(i) != ';') {
++i;
}
frame[frameIndex++] = Frame.OBJECT
| cw.addType(descriptor.substring(j + 1, i++));
break;
default:
break loop;
}
}
frame[1] = frameIndex - 3;
endFrame();
}
/**
* Starts the visit of a stack map frame.
*
@ -1783,8 +1841,9 @@ class MethodWriter extends MethodVisitor {
* the number of local variables in the frame.
* @param nStack
* the number of stack elements in the frame.
* @return the index of the next element to be written in this frame.
*/
private void startFrame(final int offset, final int nLocal, final int nStack) {
private int startFrame(final int offset, final int nLocal, final int nStack) {
int n = 3 + nLocal + nStack;
if (frame == null || frame.length < n) {
frame = new int[n];
@ -1792,7 +1851,7 @@ class MethodWriter extends MethodVisitor {
frame[0] = offset;
frame[1] = nLocal;
frame[2] = nStack;
frameIndex = 3;
return 3;
}
/**
@ -2110,7 +2169,8 @@ class MethodWriter extends MethodVisitor {
*/
final void put(final ByteVector out) {
final int FACTOR = ClassWriter.TO_ACC_SYNTHETIC;
int mask = Opcodes.ACC_DEPRECATED | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
int mask = ACC_CONSTRUCTOR | Opcodes.ACC_DEPRECATED
| ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
| ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / FACTOR);
out.putShort(access & ~mask).putShort(name).putShort(desc);
if (classReaderOffset != 0) {

View File

@ -442,10 +442,31 @@ public abstract class AdviceAdapter extends GeneratorAdapter implements Opcodes
}
}
@Deprecated
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
mv.visitMethodInsn(opcode, owner, name, desc);
if (api >= Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc);
return;
}
doVisitMethodInsn(opcode, owner, name, desc,
opcode == Opcodes.INVOKEINTERFACE);
}
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc, itf);
return;
}
doVisitMethodInsn(opcode, owner, name, desc, itf);
}
private void doVisitMethodInsn(int opcode, final String owner,
final String name, final String desc, final boolean itf) {
mv.visitMethodInsn(opcode, owner, name, desc, itf);
if (constructor) {
Type[] types = Type.getArgumentTypes(desc);
for (int i = 0; i < types.length; i++) {

View File

@ -165,10 +165,15 @@ public class AnalyzerAdapter extends MethodVisitor {
* @param mv
* the method visitor to which this adapter delegates calls. May
* be <tt>null</tt>.
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public AnalyzerAdapter(final String owner, final int access,
final String name, final String desc, final MethodVisitor mv) {
this(Opcodes.ASM5, owner, access, name, desc, mv);
if (getClass() != AnalyzerAdapter.class) {
throw new IllegalStateException();
}
}
/**
@ -331,11 +336,32 @@ public class AnalyzerAdapter extends MethodVisitor {
execute(opcode, 0, desc);
}
@Deprecated
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
if (api >= Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc);
return;
}
doVisitMethodInsn(opcode, owner, name, desc,
opcode == Opcodes.INVOKEINTERFACE);
}
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc, itf);
return;
}
doVisitMethodInsn(opcode, owner, name, desc, itf);
}
private void doVisitMethodInsn(int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc);
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
if (this.locals == null) {
labels = null;

View File

@ -149,9 +149,30 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
}
}
@Deprecated
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
if (api >= Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc);
return;
}
doVisitMethodInsn(opcode, owner, name, desc,
opcode == Opcodes.INVOKEINTERFACE);
}
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc, itf);
return;
}
doVisitMethodInsn(opcode, owner, name, desc, itf);
}
private void doVisitMethodInsn(int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (opcode == INVOKEINTERFACE) {
minSize += 5;
maxSize += 5;
@ -160,7 +181,7 @@ public class CodeSizeEvaluator extends MethodVisitor implements Opcodes {
maxSize += 3;
}
if (mv != null) {
mv.visitMethodInsn(opcode, owner, name, desc);
mv.visitMethodInsn(opcode, owner, name, desc, itf);
}
}

View File

@ -284,10 +284,15 @@ public class GeneratorAdapter extends LocalVariablesSorter {
* the method's name.
* @param desc
* the method's descriptor (see {@link Type Type}).
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public GeneratorAdapter(final MethodVisitor mv, final int access,
final String name, final String desc) {
this(Opcodes.ASM5, mv, access, name, desc);
if (getClass() != GeneratorAdapter.class) {
throw new IllegalStateException();
}
}
/**
@ -1400,11 +1405,11 @@ public class GeneratorAdapter extends LocalVariablesSorter {
* the method to be invoked.
*/
private void invokeInsn(final int opcode, final Type type,
final Method method) {
final Method method, final boolean itf) {
String owner = type.getSort() == Type.ARRAY ? type.getDescriptor()
: type.getInternalName();
mv.visitMethodInsn(opcode, owner, method.getName(),
method.getDescriptor());
method.getDescriptor(), itf);
}
/**
@ -1416,7 +1421,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
* the method to be invoked.
*/
public void invokeVirtual(final Type owner, final Method method) {
invokeInsn(Opcodes.INVOKEVIRTUAL, owner, method);
invokeInsn(Opcodes.INVOKEVIRTUAL, owner, method, false);
}
/**
@ -1428,7 +1433,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
* the constructor to be invoked.
*/
public void invokeConstructor(final Type type, final Method method) {
invokeInsn(Opcodes.INVOKESPECIAL, type, method);
invokeInsn(Opcodes.INVOKESPECIAL, type, method, false);
}
/**
@ -1440,7 +1445,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
* the method to be invoked.
*/
public void invokeStatic(final Type owner, final Method method) {
invokeInsn(Opcodes.INVOKESTATIC, owner, method);
invokeInsn(Opcodes.INVOKESTATIC, owner, method, false);
}
/**
@ -1452,7 +1457,7 @@ public class GeneratorAdapter extends LocalVariablesSorter {
* the method to be invoked.
*/
public void invokeInterface(final Type owner, final Method method) {
invokeInsn(Opcodes.INVOKEINTERFACE, owner, method);
invokeInsn(Opcodes.INVOKEINTERFACE, owner, method, true);
}
/**

View File

@ -82,9 +82,14 @@ public class InstructionAdapter extends MethodVisitor {
*
* @param mv
* the method visitor to which this adapter delegates calls.
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public InstructionAdapter(final MethodVisitor mv) {
this(Opcodes.ASM5, mv);
if (getClass() != InstructionAdapter.class) {
throw new IllegalStateException();
}
}
/**
@ -536,18 +541,39 @@ public class InstructionAdapter extends MethodVisitor {
}
}
@Deprecated
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
if (api >= Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc);
return;
}
doVisitMethodInsn(opcode, owner, name, desc,
opcode == Opcodes.INVOKEINTERFACE);
}
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc, itf);
return;
}
doVisitMethodInsn(opcode, owner, name, desc, itf);
}
private void doVisitMethodInsn(int opcode, final String owner,
final String name, final String desc, final boolean itf) {
switch (opcode) {
case Opcodes.INVOKESPECIAL:
invokespecial(owner, name, desc);
invokespecial(owner, name, desc, itf);
break;
case Opcodes.INVOKEVIRTUAL:
invokevirtual(owner, name, desc);
invokevirtual(owner, name, desc, itf);
break;
case Opcodes.INVOKESTATIC:
invokestatic(owner, name, desc);
invokestatic(owner, name, desc, itf);
break;
case Opcodes.INVOKEINTERFACE:
invokeinterface(owner, name, desc);
@ -1014,24 +1040,78 @@ public class InstructionAdapter extends MethodVisitor {
mv.visitFieldInsn(Opcodes.PUTFIELD, owner, name, desc);
}
@Deprecated
public void invokevirtual(final String owner, final String name,
final String desc) {
if (api >= Opcodes.ASM5) {
invokevirtual(owner, name, desc, false);
return;
}
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc);
}
public void invokevirtual(final String owner, final String name,
final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
if (itf) {
throw new IllegalArgumentException(
"INVOKEVIRTUAL on interfaces require ASM 5");
}
invokevirtual(owner, name, desc);
return;
}
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, owner, name, desc, itf);
}
@Deprecated
public void invokespecial(final String owner, final String name,
final String desc) {
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc);
if (api >= Opcodes.ASM5) {
invokespecial(owner, name, desc, false);
return;
}
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc, false);
}
public void invokespecial(final String owner, final String name,
final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
if (itf) {
throw new IllegalArgumentException(
"INVOKESPECIAL on interfaces require ASM 5");
}
invokespecial(owner, name, desc);
return;
}
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, owner, name, desc, itf);
}
@Deprecated
public void invokestatic(final String owner, final String name,
final String desc) {
if (api < Opcodes.ASM5) {
invokestatic(owner, name, desc, false);
return;
}
mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc, false);
}
public void invokestatic(final String owner, final String name,
final String desc) {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc);
final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
if (itf) {
throw new IllegalArgumentException(
"INVOKESTATIC on interfaces require ASM 5");
}
invokestatic(owner, name, desc);
return;
}
mv.visitMethodInsn(Opcodes.INVOKESTATIC, owner, name, desc, itf);
}
public void invokeinterface(final String owner, final String name,
final String desc) {
mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, owner, name, desc);
mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, owner, name, desc, true);
}
public void invokedynamic(String name, String desc, Handle bsm,

View File

@ -136,11 +136,16 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
* the internal names of the method's exception classes (see
* {@link Type#getInternalName() getInternalName}). May be
* <tt>null</tt>.
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public JSRInlinerAdapter(final MethodVisitor mv, final int access,
final String name, final String desc, final String signature,
final String[] exceptions) {
this(Opcodes.ASM5, mv, access, name, desc, signature, exceptions);
if (getClass() != JSRInlinerAdapter.class) {
throw new IllegalStateException();
}
}
/**
@ -381,6 +386,17 @@ public class JSRInlinerAdapter extends MethodNode implements Opcodes {
// Use tail recursion here in the form of an outer while loop to
// avoid our stack growing needlessly:
index++;
// We implicitly assumed above that execution can always fall
// through to the next instruction after a JSR. But a subroutine may
// never return, in which case the code after the JSR is unreachable
// and can be anything. In particular, it can seem to fall off the
// end of the method, so we must handle this case here (we could
// instead detect whether execution can return or not from a JSR,
// but this is more complicated).
if (index >= instructions.size()) {
return;
}
}
}

View File

@ -120,10 +120,15 @@ public class LocalVariablesSorter extends MethodVisitor {
* the method's descriptor (see {@link Type Type}).
* @param mv
* the method visitor to which this adapter delegates calls.
* @throws IllegalStateException
* If a subclass calls this constructor.
*/
public LocalVariablesSorter(final int access, final String desc,
final MethodVisitor mv) {
this(Opcodes.ASM5, access, desc, mv);
if (getClass() != LocalVariablesSorter.class) {
throw new IllegalStateException();
}
}
/**
@ -323,6 +328,7 @@ public class LocalVariablesSorter extends MethodVisitor {
int local = newLocalMapping(type);
setLocalType(local, type);
setFrameLocal(local, t);
changed = true;
return local;
}

View File

@ -148,12 +148,41 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
remapper.mapDesc(desc));
}
@Deprecated
@Override
public void visitMethodInsn(int opcode, String owner, String name,
String desc) {
super.visitMethodInsn(opcode, remapper.mapType(owner),
remapper.mapMethodName(owner, name, desc),
remapper.mapMethodDesc(desc));
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
if (api >= Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc);
return;
}
doVisitMethodInsn(opcode, owner, name, desc,
opcode == Opcodes.INVOKEINTERFACE);
}
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc, final boolean itf) {
if (api < Opcodes.ASM5) {
super.visitMethodInsn(opcode, owner, name, desc, itf);
return;
}
doVisitMethodInsn(opcode, owner, name, desc, itf);
}
private void doVisitMethodInsn(int opcode, String owner, String name,
String desc, boolean itf) {
// Calling super.visitMethodInsn requires to call the correct version
// depending on this.api (otherwise infinite loops can occur). To
// simplify and to make it easier to automatically remove the backward
// compatibility code, we inline the code of the overridden method here.
// IMPORTANT: THIS ASSUMES THAT visitMethodInsn IS NOT OVERRIDDEN IN
// LocalVariableSorter.
if (mv != null) {
mv.visitMethodInsn(opcode, remapper.mapType(owner),
remapper.mapMethodName(owner, name, desc),
remapper.mapMethodDesc(desc), itf);
}
}
@Override

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