471,075 Members | 1,148 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

getDeclaredFields() not returning full list on IBM JAVA SE5?

1
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)) and in both cases, get the following list returned from calling getDeclaredFields() on java.lang.ClassLoader via this code snippet:

Field[] fields = loaderClass.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
System.out.println("fieldName = " + fieldName);
}

fieldName = private boolean java.lang.ClassLoader.initialized
fieldName = private java.lang.ClassLoader java.lang.ClassLoader.parent
fieldName = private java.util.Hashtable java.lang.ClassLoader.package2certs
fieldName = java.security.cert.Certificate[] java.lang.ClassLoader.nocerts
fieldName = private java.util.Vector java.lang.ClassLoader.classes
fieldName = private java.util.Set java.lang.ClassLoader.domains
fieldName = private java.util.HashMap java.lang.ClassLoader.packages
fieldName = private static sun.misc.URLClassPath java.lang.ClassLoader.bootstrapClassPath
fieldName = private static java.lang.ClassLoader java.lang.ClassLoader.scl
fieldName = private static boolean java.lang.ClassLoader.sclSet
fieldName = private java.security.ProtectionDomain java.lang.ClassLoader.defaultDomain
fieldName = private static java.util.Vector java.lang.ClassLoader.loadedLibraryNames
fieldName = private static java.util.Vector java.lang.ClassLoader.systemNativeLibraries
fieldName = private java.util.Vector java.lang.ClassLoader.nativeLibraries
fieldName = private static java.util.Stack java.lang.ClassLoader.nativeLibraryContext
fieldName = private static java.lang.String[] java.lang.ClassLoader.usr_paths
fieldName = private static java.lang.String[] java.lang.ClassLoader.sys_paths
fieldName = private boolean java.lang.ClassLoader.defaultAssertionStatus
fieldName = private java.util.Map java.lang.ClassLoader.packageAssertionStatus
fieldName = java.util.Map java.lang.ClassLoader.classAssertionStatus
fieldName = private boolean java.lang.ClassLoader.initialized
fieldName = private java.lang.ClassLoader java.lang.ClassLoader.parent
fieldName = private java.util.Hashtable java.lang.ClassLoader.package2certs
fieldName = java.security.cert.Certificate[] java.lang.ClassLoader.nocerts
fieldName = private java.util.Vector java.lang.ClassLoader.classes
fieldName = private java.util.Set java.lang.ClassLoader.domains
fieldName = private java.util.HashMap java.lang.ClassLoader.packages
fieldName = private static sun.misc.URLClassPath java.lang.ClassLoader.bootstrapClassPath
fieldName = private static java.lang.ClassLoader java.lang.ClassLoader.scl
fieldName = private static boolean java.lang.ClassLoader.sclSet
fieldName = private java.security.ProtectionDomain java.lang.ClassLoader.defaultDomain
fieldName = private static java.util.Vector java.lang.ClassLoader.loadedLibraryNames
fieldName = private static java.util.Vector java.lang.ClassLoader.systemNativeLibraries
fieldName = private java.util.Vector java.lang.ClassLoader.nativeLibraries
fieldName = private static java.util.Stack java.lang.ClassLoader.nativeLibraryContext
fieldName = private static java.lang.String[] java.lang.ClassLoader.usr_paths
fieldName = private static java.lang.String[] java.lang.ClassLoader.sys_paths
fieldName = private boolean java.lang.ClassLoader.defaultAssertionStatus
fieldName = private java.util.Map java.lang.ClassLoader.packageAssertionStatus
fieldName = java.util.Map java.lang.ClassLoader.classAssertionStatus

When I run the same code on AIX 5.2 with IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc64-64
I get:
FieldName string = static java.lang.ClassLoader java.lang.ClassLoader.systemClassLoader
FieldName string = private static java.lang.ClassLoader java.lang.ClassLoader.applicationClassLoader
FieldName string = private static boolean java.lang.ClassLoader.initSystemClassLoader
FieldName string = private long java.lang.ClassLoader.vmRef
FieldName string = java.lang.ClassLoader java.lang.ClassLoader.parent
FieldName string = private java.lang.Object java.lang.ClassLoader.assertionLock
FieldName string = private boolean java.lang.ClassLoader.defaultAssertionStatus
FieldName string = private java.util.Map java.lang.ClassLoader.packageAssertionStatus
FieldName string = private java.util.Map java.lang.ClassLoader.classAssertionStatus
FieldName string = private java.util.Hashtable java.lang.ClassLoader.genericRepository
FieldName string = private java.util.Hashtable java.lang.ClassLoader.annotationCache
FieldName string = private java.util.Hashtable java.lang.ClassLoader.packages
FieldName string = private java.lang.Object java.lang.ClassLoader.lazyInitLock
FieldName string = private java.util.Hashtable java.lang.ClassLoader.classSigners
FieldName string = private java.util.Hashtable java.lang.ClassLoader.packageSigners
FieldName string = private static java.security.cert.Certificate[] java.lang.ClassLoader.emptyCertificates
FieldName string = private java.security.ProtectionDomain java.lang.ClassLoader.defaultProtectionDomain
FieldName string = private java.util.Hashtable java.lang.ClassLoader.contexts

I'm actually searching for nativeLibraries and SystemNativeLibraries, which is present in the first instance and not the second. Is the IBM Java version organised differently?

Thanks
JW
Mar 2 '07 #1
0 3017

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Simon Harris | last post: by
reply views Thread by colinhumber | last post: by
3 posts views Thread by Jonathan Lukens | last post: by
49 posts views Thread by aarklon | last post: by
5 posts views Thread by Daniel | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.