By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

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

P: 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
Share this question for a faster answer!
Share on Google+

Post your reply

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