diff options
| author | Matthias Klose <doko@gcc.gnu.org> | 2008-06-28 13:29:13 +0000 |
|---|---|---|
| committer | Matthias Klose <doko@gcc.gnu.org> | 2008-06-28 13:29:13 +0000 |
| commit | e0441a5bfb29083a532307ba2b1fd6d6d13944ba (patch) | |
| tree | 602cd7aa7c947386134690d8e0f6b53abcdeacb9 /libjava/classpath/gnu/java/lang | |
| parent | 15c151967dd1cde61b79d26374f608f63a29d411 (diff) | |
| download | gcc-e0441a5bfb29083a532307ba2b1fd6d6d13944ba.zip gcc-e0441a5bfb29083a532307ba2b1fd6d6d13944ba.tar.gz gcc-e0441a5bfb29083a532307ba2b1fd6d6d13944ba.tar.bz2 | |
Import GNU Classpath (classpath-0_97_2-release).
libjava/
2008-06-28 Matthias Klose <doko@ubuntu.com>
Import GNU Classpath (classpath-0_97_2-release).
* Regenerate class and header files.
* Regenerate auto* files.
* gcj/javaprims.h: Define jobjectRefType.
* jni.cc (_Jv_JNI_GetObjectRefType): New (stub only).
(_Jv_JNIFunctions): Initialize GetObjectRefType.
* gnu/classpath/jdwp/VMVirtualMachine.java,
java/security/VMSecureRandom.java: Merge from classpath.
* HACKING: Fix typo.
* ChangeLog-2007: New file.
* configure.ac: Set JAVAC, pass --disable-regen-headers to classpath.
libjava/classpath/
2008-06-28 Matthias Klose <doko@ubuntu.com>
* m4/ac_prog_javac.m4: Disable check for JAVAC, when
not configured with --enable-java-maintainer-mode.
* aclocal.m4, configure: Regenerate.
* native/jni/gstreamer-peer/Makefile.am: Do not link with
libclasspathnative.
* native/jni/gstreamer-peer/Makefile.in: Regenerate.
* tools/Makefile.am, lib/Makefile.am: Use JAVAC for setting
JCOMPILER, drop flags not understood by gcj.
From-SVN: r137223
Diffstat (limited to 'libjava/classpath/gnu/java/lang')
| -rw-r--r-- | libjava/classpath/gnu/java/lang/MainThread.java | 2 | ||||
| -rw-r--r-- | libjava/classpath/gnu/java/lang/management/BeanImpl.java | 93 | ||||
| -rw-r--r-- | libjava/classpath/gnu/java/lang/reflect/TypeSignature.java | 4 |
3 files changed, 89 insertions, 10 deletions
diff --git a/libjava/classpath/gnu/java/lang/MainThread.java b/libjava/classpath/gnu/java/lang/MainThread.java index ab529ef..7ad70cd 100644 --- a/libjava/classpath/gnu/java/lang/MainThread.java +++ b/libjava/classpath/gnu/java/lang/MainThread.java @@ -69,7 +69,7 @@ public class MainThread { try { - mainMethod.invoke(null,args); + mainMethod.invoke(null,(Object) args); } catch(IllegalAccessException e) { diff --git a/libjava/classpath/gnu/java/lang/management/BeanImpl.java b/libjava/classpath/gnu/java/lang/management/BeanImpl.java index 59e79a5..a651e35 100644 --- a/libjava/classpath/gnu/java/lang/management/BeanImpl.java +++ b/libjava/classpath/gnu/java/lang/management/BeanImpl.java @@ -44,8 +44,6 @@ import java.lang.management.ManagementPermission; import java.lang.reflect.Array; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.TypeVariable; - import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -59,13 +57,11 @@ import javax.management.MBeanException; import javax.management.MBeanInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanParameterInfo; -import javax.management.MBeanInfo; import javax.management.NotCompliantMBeanException; import javax.management.ReflectionException; import javax.management.StandardMBean; import javax.management.openmbean.ArrayType; -import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeDataSupport; import javax.management.openmbean.CompositeType; import javax.management.openmbean.OpenDataException; @@ -80,7 +76,6 @@ import javax.management.openmbean.OpenMBeanOperationInfoSupport; import javax.management.openmbean.OpenMBeanParameterInfo; import javax.management.openmbean.OpenMBeanParameterInfoSupport; import javax.management.openmbean.OpenType; -import javax.management.openmbean.SimpleType; import javax.management.openmbean.TabularData; import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.TabularType; @@ -277,7 +272,7 @@ public class BeanImpl Method getter = null; try { - getter = vClass.getMethod("get" + field, null); + getter = vClass.getMethod("get" + field); } catch (NoSuchMethodException e) { @@ -285,7 +280,7 @@ public class BeanImpl } try { - values.add(getter.invoke(value, null)); + values.add(getter.invoke(value)); } catch (IllegalAccessException e) { @@ -323,6 +318,90 @@ public class BeanImpl return (MBeanInfo) openInfo; } + /** + * Override this method so as to prevent the description of a constructor's + * parameter being @code{null}. Open MBeans can not have @code{null} descriptions, + * but one will occur as the names of parameters aren't stored for reflection. + * + * @param constructor the constructor whose parameter needs describing. + * @param parameter the parameter to be described. + * @param sequenceNo the number of the parameter to describe. + * @return a description of the constructor's parameter. + */ + protected String getDescription(MBeanConstructorInfo constructor, + MBeanParameterInfo parameter, + int sequenceNo) + { + String desc = parameter.getDescription(); + if (desc == null) + return "param" + sequenceNo; + else + return desc; + } + + /** + * Override this method so as to prevent the description of an operation's + * parameter being @code{null}. Open MBeans can not have @code{null} descriptions, + * but one will occur as the names of parameters aren't stored for reflection. + * + * @param operation the operation whose parameter needs describing. + * @param parameter the parameter to be described. + * @param sequenceNo the number of the parameter to describe. + * @return a description of the operation's parameter. + */ + protected String getDescription(MBeanOperationInfo operation, + MBeanParameterInfo parameter, + int sequenceNo) + { + String desc = parameter.getDescription(); + if (desc == null) + return "param" + sequenceNo; + else + return desc; + } + + /** + * Override this method so as to prevent the name of a constructor's + * parameter being @code{null}. Open MBeans can not have @code{null} names, + * but one will occur as the names of parameters aren't stored for reflection. + * + * @param constructor the constructor whose parameter needs a name. + * @param parameter the parameter to be named. + * @param sequenceNo the number of the parameter to name. + * @return a description of the constructor's parameter. + */ + protected String getParameterName(MBeanConstructorInfo constructor, + MBeanParameterInfo parameter, + int sequenceNo) + { + String name = parameter.getName(); + if (name == null) + return "param" + sequenceNo; + else + return name; + } + + /** + * Override this method so as to prevent the name of an operation's + * parameter being @code{null}. Open MBeans can not have @code{null} names, + * but one will occur as the names of parameters aren't stored for reflection. + * + * @param operation the operation whose parameter needs a name. + * @param parameter the parameter to be named. + * @param sequenceNo the number of the parameter to name. + * @return a description of the operation's parameter. + */ + protected String getParameterName(MBeanOperationInfo operation, + MBeanParameterInfo parameter, + int sequenceNo) + { + String name = parameter.getName(); + if (name == null) + return "param" + sequenceNo; + else + return name; + } + public MBeanInfo getMBeanInfo() { super.getMBeanInfo(); diff --git a/libjava/classpath/gnu/java/lang/reflect/TypeSignature.java b/libjava/classpath/gnu/java/lang/reflect/TypeSignature.java index 842e5bd..78c1718 100644 --- a/libjava/classpath/gnu/java/lang/reflect/TypeSignature.java +++ b/libjava/classpath/gnu/java/lang/reflect/TypeSignature.java @@ -239,7 +239,7 @@ public class TypeSignature public static String getEncodingOfMethod(Method m) { Class[] paramTypes = m.getParameterTypes(); - StringBuffer buf = new StringBuffer().append('('); + StringBuilder buf = new StringBuilder("("); for (int i = 0; i < paramTypes.length; i++) buf.append(getEncodingOfClass(paramTypes[i].getName(), true)); buf.append(')').append(getEncodingOfClass(m.getReturnType().getName(), @@ -261,7 +261,7 @@ public class TypeSignature public static String getEncodingOfConstructor(Constructor c) { Class[] paramTypes = c.getParameterTypes(); - StringBuffer buf = new StringBuffer().append('('); + StringBuilder buf = new StringBuilder("("); for (int i = 0; i < paramTypes.length; i++) buf.append(getEncodingOfClass(paramTypes[i].getName(), true)); buf.append(")V"); |
