Index: gnu/classpath/RawData.java
===================================================================
RCS file: gnu/classpath/RawData.java
diff -N gnu/classpath/RawData.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnu/classpath/RawData.java	3 Apr 2003 05:36:13 -0000
@@ -0,0 +1,48 @@
+/* RawData.java -- Pointer to VM specific data
+   Copyright (C) 1999, 2000  Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+/* This file is originally part of libgcj. */
+
+package gnu.classpath;
+
+/** A type used to indicate special data used by native code that should not 
+    be marked by the garbage collector. */
+
+public final class RawData
+{
+   private RawData() { }
+}
Index: vm/reference/java/lang/Class.java
===================================================================
RCS file: /cvsroot/classpath/classpath/vm/reference/java/lang/Class.java,v
retrieving revision 1.24
diff -u -r1.24 Class.java
--- vm/reference/java/lang/Class.java	16 Mar 2003 13:57:49 -0000	1.24
+++ vm/reference/java/lang/Class.java	3 Apr 2003 05:36:15 -0000
@@ -42,11 +42,14 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.security.AllPermission;
 import java.security.Permissions;
 import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.Arrays;
 import gnu.java.lang.ClassHelper;
 
 /*
@@ -102,12 +105,15 @@
     unknownProtectionDomain = new ProtectionDomain(null, permissions);
   }
 
+  private transient final VMClass vmClass;
+
   /**
    * Class is non-instantiable from Java code; only the VM can create
    * instances of this class.
    */
   private Class()
   {
+    this.vmClass = vmClass.getInstance ();
   }
 
   /**
@@ -137,15 +143,11 @@
    * @throws ExceptionInInitializerError if the class loads, but an exception
    *         occurs during initialization
    */
-  //XXX This does not need to be native.
-  public static native Class forName(String name)
-    throws ClassNotFoundException;
-  /*
+  public static Class forName(String name) throws ClassNotFoundException
   {
     return forName(name, true,
                    VMSecurityManager.getClassContext()[1].getClassLoader());
   }
-  */
 
   /**
    * Use the specified classloader to load and link a class. If the loader
@@ -243,7 +245,10 @@
    * @return whether o is an instance of this class
    * @since 1.1
    */
-  public native boolean isInstance(Object o);
+  public boolean isInstance(Object o)
+  {
+    return vmClass.isInstance (o);
+  }
 
   /**
    * Discover whether an instance of the Class parameter would be an
@@ -259,7 +264,10 @@
    * @throws NullPointerException if c is null
    * @since 1.1
    */
-  public native boolean isAssignableFrom(Class c);
+  public boolean isAssignableFrom(Class c)
+  {
+    return vmClass.isAssignableFrom (c);
+  }
 
   /**
    * Check whether this class is an interface or not.  Array types are not
@@ -267,7 +275,10 @@
    *
    * @return whether this class is an interface or not
    */
-  public native boolean isInterface();
+  public boolean isInterface()
+  {
+    return vmClass.isInterface ();
+  }
 
   /**
    * Return whether this class is an array type.
@@ -299,7 +310,10 @@
    * @see Void#TYPE
    * @since 1.1
    */
-  public native boolean isPrimitive();
+  public boolean isPrimitive()
+  {
+    return vmClass.isPrimitive ();
+  }
 
   /**
    * Get the name of this class, separated by dots for package separators.
@@ -316,11 +330,14 @@
    * void                V
    * array type          [<em>element type</em>
    * class or interface, alone: &lt;dotted name&gt;
-   * class or interface, as element type: L&lt;dotten name&gt;;
+   * class or interface, as element type: L&lt;dotted name&gt;;
    *
    * @return the name of this class
    */
-  public native String getName();
+  public String getName()
+  { 
+    return vmClass.getName ();
+  }
 
   /**
    * Get the ClassLoader that loaded this class.  If it was loaded by the
@@ -343,7 +360,7 @@
     if (name.startsWith("java.") || name.startsWith("gnu.java."))
       return null;
 
-    ClassLoader loader = getClassLoader0();
+    ClassLoader loader = vmClass.getClassLoader();
     // Check if we may get the classloader
     SecurityManager sm = System.getSecurityManager();
     if (sm != null)
@@ -364,7 +381,10 @@
    *
    * @return the direct superclass of this class
    */
-  public native Class getSuperclass();
+  public Class getSuperclass()
+  {
+    return vmClass.getSuperClass ();
+  }
 
   /**
    * Returns the <code>Package</code> in which this class is defined
@@ -391,7 +411,10 @@
    *
    * @return the interfaces this class directly implements
    */
-  public native Class[] getInterfaces();
+  public Class[] getInterfaces()
+  {
+    return vmClass.getInterface ();
+  }
 
   /**
    * If this is an array, get the Class representing the type of array.
@@ -405,43 +428,7 @@
    */
   public Class getComponentType()
   {
-    if (isArray())
-      try
-        {
-          String name = getName();
-          switch (name.charAt(1))
-            {
-            case 'B':
-              return byte.class;
-            case 'C':
-              return char.class;
-            case 'D':
-              return double.class;
-            case 'F':
-              return float.class;
-            case 'I':
-              return int.class;
-            case 'J':
-              return long.class;
-            case 'S':
-              return short.class;
-            case 'Z':
-              return boolean.class;
-            default:
-              return null;
-            case '[':
-              name = name.substring(1);
-              break;
-            case 'L':
-              name = name.substring(2, name.length() - 1);
-            }
-          return Class.forName(name, false, getClassLoader());
-        }
-      catch(ClassNotFoundException e)
-        {
-          // Shouldn't happen, but ignore it anyway.
-        }
-    return null;
+    return vmClass.getComponentType ();
   }
 
   /**
@@ -456,7 +443,10 @@
    * @see Modifer
    * @since 1.1
    */
-  public native int getModifiers();
+  public int getModifiers()
+  {
+    return vmClass.getModifiers ();
+  }
 
   /**
    * Get the signers of this class. This returns null if there are no signers,
@@ -481,13 +471,30 @@
   }
 
   /**
+   * Perform security checks common to all of the methods that
+   * get members of this Class.
+   */
+  private void memberAccessCheck(int which) {
+    SecurityManager sm = System.getSecurityManager();
+    if (sm != null) {
+      sm.checkMemberAccess(this, which);
+      Package pkg = getPackage();
+      if (pkg != null)
+	sm.checkPackageAccess(pkg.getName());
+    }
+  }
+
+  /**
    * If this is a nested or inner class, return the class that declared it.
    * If not, return null.
    *
    * @return the declaring class of this class
    * @since 1.1
    */
-  public native Class getDeclaringClass();
+  public Class getDeclaringClass()
+  {
+    return vmClass.getDeclaringClass ();
+  }
 
   /**
    * Get all the public member classes and interfaces declared in this
@@ -501,7 +508,22 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Class[] getClasses();
+  public Class[] getClasses() {
+    memberAccessCheck(Member.PUBLIC);
+    return internalGetClasses();
+  }
+
+  /**
+   * Like <code>getClasses()</code> but without the security checks.
+   */
+  private Class[] internalGetClasses() {
+    ArrayList list = new ArrayList();
+    list.add(Arrays.asList(getDeclaredClasses(true)));
+    Class superClass = getSuperclass();
+    if (superClass != null)
+      list.add(Arrays.asList(superClass.internalGetClasses()));
+    return (Class[])list.toArray(new Class[list.size()]);
+  }
 
   /**
    * Get all the public fields declared in this class or inherited from
@@ -515,7 +537,28 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Field[] getFields();
+  public Field[] getFields() {
+    memberAccessCheck(Member.PUBLIC);
+    return internalGetFields();
+  }
+
+  /**
+   * Like <code>getFields()</code> but without the security checks.
+   */
+  private Field[] internalGetFields() {
+    ArrayList list = new ArrayList();
+    list.add(Arrays.asList(getDeclaredFields(true)));
+    if (isInterface()) {
+      Class[] interfaces = getInterfaces();
+      for (int i = 0; i < interfaces.length; i++)
+	list.add(Arrays.asList(interfaces[i].internalGetFields()));
+    } else {
+      Class superClass = getSuperclass();
+      if (superClass != null)
+	list.add(Arrays.asList(superClass.internalGetFields()));
+    }
+    return (Field[])list.toArray(new Field[list.size()]);
+  }
 
   /**
    * Get all the public methods declared in this class or inherited from
@@ -533,7 +576,25 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Method[] getMethods();
+  public Method[] getMethods() {
+    memberAccessCheck(Member.PUBLIC);
+    return internalGetMethods();
+  }
+
+  /**
+   * Like <code>getMethods()</code> but without the security checks.
+   */
+  private Method[] internalGetMethods() {
+    ArrayList list = new ArrayList();
+    list.add(Arrays.asList(getDeclaredMethods(true)));
+    Class[] interfaces = getInterfaces();
+    for (int i = 0; i < interfaces.length; i++)
+      list.add(Arrays.asList(interfaces[i].internalGetMethods()));
+    Class superClass = getSuperclass();
+    if (superClass != null)
+      list.add(Arrays.asList(superClass.internalGetMethods()));
+    return (Method[])list.toArray(new Method[list.size()]);
+  }
 
   /**
    * Get all the public constructors of this class. This returns an array of
@@ -547,7 +608,10 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Constructor[] getConstructors();
+  public Constructor[] getConstructors() {
+    memberAccessCheck(Member.PUBLIC);
+    return getDeclaredConstructors(true);
+  }
 
   /**
    * Get a public field declared or inherited in this class, where name is
@@ -564,7 +628,26 @@
    * @see #getFields()
    * @since 1.1
    */
-  public native Field getField(String name) throws NoSuchFieldException;
+  public Field getField(String name) throws NoSuchFieldException {
+    memberAccessCheck(Member.PUBLIC);
+    Field[] fields = getDeclaredFields(true);
+    for (int i = 0; i < fields.length; i++) {
+      Field field = fields[i];
+      if (field.getName().equals(name))
+	return field;
+    }
+    Class[] interfaces = getInterfaces();
+    for (int i = 0; i < interfaces.length; i++) {
+      try {
+	return interfaces[i].getField(name);
+      } catch (NoSuchFieldException e) {
+      }
+    }
+    Class superclass = getSuperclass();
+    if (superclass != null)
+      return superclass.getField(name);
+    throw new NoSuchFieldException();
+  }
 
   /**
    * Get a public method declared or inherited in this class, where name is
@@ -588,8 +671,62 @@
    * @see #getMethods()
    * @since 1.1
    */
-   public native Method getMethod(String name, Class[] args)
-     throws NoSuchMethodException;
+  public Method getMethod(String name, Class[] args)
+	throws NoSuchMethodException {
+    memberAccessCheck(Member.PUBLIC);
+    for (Class c = this; c != null; c = c.getSuperclass()) {
+      Method match = matchMethod(c.getDeclaredMethods(true), name, args);
+      if (match != null)
+	return match;
+    }
+    throw new NoSuchMethodException();
+  }
+
+  /** 
+   * Find the best matching method in <code>list</code> according to
+   * the definition of ``best matching'' used by <code>getMethod()</code>
+   *
+   * <p>
+   * Returns the method if any, otherwise <code>null</code>.
+   *
+   * @param list List of methods to search
+   * @param name Name of method
+   * @param args Method parameter types
+   * @see #getMethod()
+   */
+  private static Method matchMethod(Method[] list, String name, Class[] args) {
+    Method match = null;
+    for (int i = 0; i < list.length; i++) {
+      Method method = list[i];
+      if (!method.getName().equals(name))
+	continue;
+      if (!matchParameters(args, method.getParameterTypes()))
+	continue;
+      if (match == null
+	  || match.getReturnType().isAssignableFrom(method.getReturnType()))
+	match = method;
+    }
+    return match;
+  }
+
+  /**
+   * Check for an exact match between parameter type lists.
+   * Either list may be <code>null</code> to mean a list of
+   * length zero.
+   */
+  private static boolean matchParameters(Class[] types1, Class[] types2) {
+    if (types1 == null)
+      return types2 == null || types2.length == 0;
+    if (types2 == null)
+      return types1 == null || types1.length == 0;
+    if (types1.length != types2.length)
+      return false;
+    for (int i = 0; i < types1.length; i++) {
+      if (!types1[i].equals(types2[i]))
+	return false;
+    }
+    return true;
+  }
 
   /**
    * Get a public constructor declared in this class. If the constructor takes
@@ -605,8 +742,16 @@
    * @see #getConstructors()
    * @since 1.1
    */
-  public native Constructor getConstructor(Class[] args)
-    throws NoSuchMethodException;
+  public Constructor getConstructor(Class[] args) throws NoSuchMethodException {
+    memberAccessCheck(Member.PUBLIC);
+    Constructor[] constructors = getDeclaredConstructors(true);
+    for (int i = 0; i < constructors.length; i++) {
+      Constructor constructor = constructors[i];
+      if (matchParameters(args, constructor.getParameterTypes()))
+	return constructor;
+    }
+    throw new NoSuchMethodException();
+  }
 
   /**
    * Get all the declared member classes and interfaces in this class, but
@@ -620,7 +765,15 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Class[] getDeclaredClasses();
+  public Class[] getDeclaredClasses() {
+    memberAccessCheck(Member.DECLARED);
+    return getDeclaredClasses(false);
+  }
+
+  Class[] getDeclaredClasses (boolean publicOnly)
+  {
+    return vmClass.getDeclaredClasses (publicOnly);
+  }
 
   /**
    * Get all the declared fields in this class, but not those inherited from
@@ -634,7 +787,15 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Field[] getDeclaredFields();
+  public Field[] getDeclaredFields() {
+    memberAccessCheck(Member.DECLARED);
+    return getDeclaredFields(false);
+  }
+
+  Field[] getDeclaredFields (boolean publicOnly)
+  {
+    return vmClass.getDeclaredFields (publicOnly);
+  }
 
   /**
    * Get all the declared methods in this class, but not those inherited from
@@ -652,7 +813,15 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Method[] getDeclaredMethods();
+  public Method[] getDeclaredMethods() {
+    memberAccessCheck(Member.DECLARED);
+    return getDeclaredMethods(false);
+  }
+
+  Method[] getDeclaredMethods (boolean publicOnly)
+  {
+    return vmClass.getDeclaredMethods (publicOnly);
+  }
 
   /**
    * Get all the declared constructors of this class. This returns an array of
@@ -666,7 +835,15 @@
    * @throws SecurityException if the security check fails
    * @since 1.1
    */
-  public native Constructor[] getDeclaredConstructors();
+  public Constructor[] getDeclaredConstructors() {
+    memberAccessCheck(Member.DECLARED);
+    return getDeclaredConstructors(false);
+  }
+
+  Constructor[] getDeclaredConstructors (boolean publicOnly)
+  {
+    return vmClass.getDeclaredConstructors (publicOnly);
+  }
 
   /**
    * Get a field declared in this class, where name is its simple name. The
@@ -681,8 +858,15 @@
    * @see #getDeclaredFields()
    * @since 1.1
    */
-  public native Field getDeclaredField(String name)
-    throws NoSuchFieldException;
+  public Field getDeclaredField(String name) throws NoSuchFieldException {
+    memberAccessCheck(Member.DECLARED);
+    Field[] fields = getDeclaredFields(false);
+    for (int i = 0; i < fields.length; i++) {
+      if (fields[i].getName().equals(name))
+	return fields[i];
+    }
+    throw new NoSuchFieldException();
+  }
 
   /**
    * Get a method declared in this class, where name is its simple name. The
@@ -705,8 +889,14 @@
    * @see #getDeclaredMethods()
    * @since 1.1
    */
-   public native Method getDeclaredMethod(String name, Class[] args)
-     throws NoSuchMethodException;
+   public Method getDeclaredMethod(String name, Class[] args)
+		throws NoSuchMethodException {
+    memberAccessCheck(Member.DECLARED);
+    Method match = matchMethod(getDeclaredMethods(false), name, args);
+    if (match != null)
+      return match;
+    throw new NoSuchMethodException();
+  }
 
   /**
    * Get a constructor declared in this class. If the constructor takes no
@@ -722,8 +912,17 @@
    * @see #getDeclaredConstructors()
    * @since 1.1
    */
-  public native Constructor getDeclaredConstructor(Class[] args)
-    throws NoSuchMethodException;
+  public Constructor getDeclaredConstructor(Class[] args)
+		throws NoSuchMethodException {
+    memberAccessCheck(Member.DECLARED);
+    Constructor[] constructors = getDeclaredConstructors(false);
+    for (int i = 0; i < constructors.length; i++) {
+      Constructor constructor = constructors[i];
+      if (matchParameters(args, constructor.getParameterTypes()))
+	return constructor;
+    }
+    throw new NoSuchMethodException();
+  }
 
   /**
    * Get a resource using this class's package using the
@@ -874,10 +1073,4 @@
     return c.defaultAssertionStatus;
   }
 
-  /**
-   * Return the class loader of this class.
-   *
-   * @return the class loader
-   */
-  native ClassLoader getClassLoader0();
 } // class Class
Index: vm/reference/java/lang/VMClass.java
===================================================================
RCS file: vm/reference/java/lang/VMClass.java
diff -N vm/reference/java/lang/VMClass.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ vm/reference/java/lang/VMClass.java	3 Apr 2003 05:36:15 -0000
@@ -0,0 +1,318 @@
+/* VMClass.java -- VM Specific Class methods
+   Copyright (C) 2003 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang;
+
+import gnu.classpath.RawData;
+
+/*
+ * This class is a reference version, mainly for compiling a class library
+ * jar.  It is likely that VM implementers replace this with their own
+ * version that can communicate effectively with the VM.
+ */
+
+/**
+ *
+ * @author Archie Cobbs <archie@dellroad.org>
+ * @author C. Brian Jones <cbj@gnu.org>
+ */
+public final class VMClass 
+{
+  /*
+   * Class initialization mostly-in-Java copied from SableVM.
+   * The steps below follow the JVM spec, 2nd edition, sec. 2.17.5.
+   */
+  private int initializing_thread;
+  private boolean erroneous_state;
+
+  private native boolean isInitialized();
+  private native void setInitialized();
+  private native void step7();
+  private native void step8();
+
+  /**
+   * Pointer to VM internal class structure.
+   */
+
+  private final RawData vmData;  
+
+  private VMClass(RawData vmData) 
+  { 
+    this.vmData = vmData;
+  }
+
+  native VMClass getInstance();
+
+  private void initialize(int thread) throws InterruptedException
+  {
+    Error error;
+
+    /* 1 */
+    synchronized (this)
+    {
+      /* 2 */
+      while (initializing_thread != 0 && initializing_thread != thread)
+        wait();
+
+      /* 3 */
+      if (initializing_thread == thread)
+        return;
+
+      /* 4 */
+      if (isInitialized())
+        return;
+
+      /* 5 */
+      if (erroneous_state)
+        throw new NoClassDefFoundError();
+
+      /* 6 */
+      initializing_thread = thread;
+    }
+
+    /* 7 */
+    try {
+      step7();
+    }
+    catch(Error e) {
+      synchronized(this) {
+        erroneous_state = true;
+        initializing_thread = 0;
+        notifyAll();
+        throw e;
+      }
+    }
+
+    /* 8 */
+    try {
+      step8();
+
+      /* 9 */
+      synchronized(this) {
+        setInitialized();
+        initializing_thread = 0;
+        notifyAll();
+        return;
+      }
+    }
+
+    /* 10 */
+    catch(Exception e) {
+      try {
+        error = new ExceptionInInitializerError(e);
+      } catch (OutOfMemoryError e2) {
+        error = e2;
+      }
+    } catch(Error e) {
+      error = e;
+    }
+
+    /* 11 */
+    synchronized(this) {
+      erroneous_state = true;
+      initializing_thread = 0;
+      notifyAll();
+      throw error;
+    }
+  }
+
+  /**
+   * Discover whether an Object is an instance of this Class.  Think of it
+   * as almost like <code>o instanceof (this class)</code>.
+   *
+   * @param o the Object to check
+   * @return whether o is an instance of this class
+   * @since 1.1
+   */
+  native boolean isInstance(Object o);
+
+  /**
+   * Discover whether an instance of the Class parameter would be an
+   * instance of this Class as well.  Think of doing
+   * <code>isInstance(c.newInstance())</code> or even
+   * <code>c.newInstance() instanceof (this class)</code>. While this
+   * checks widening conversions for objects, it must be exact for primitive
+   * types.
+   *
+   * @param c the class to check
+   * @return whether an instance of c would be an instance of this class
+   *         as well
+   * @throws NullPointerException if c is null
+   * @since 1.1
+   */
+  native boolean isAssignableFrom(Class c);
+
+  /**
+   * Check whether this class is an interface or not.  Array types are not
+   * interfaces.
+   *
+   * @return whether this class is an interface or not
+   */
+  native boolean isInterface();
+
+  /**
+   * Return whether this class is a primitive type.  A primitive type class
+   * is a class representing a kind of "placeholder" for the various
+   * primitive types, or void.  You can access the various primitive type
+   * classes through java.lang.Boolean.TYPE, java.lang.Integer.TYPE, etc.,
+   * or through boolean.class, int.class, etc.
+   *
+   * @return whether this class is a primitive type
+   * @see Boolean#TYPE
+   * @see Byte#TYPE
+   * @see Character#TYPE
+   * @see Short#TYPE
+   * @see Integer#TYPE
+   * @see Long#TYPE
+   * @see Float#TYPE
+   * @see Double#TYPE
+   * @see Void#TYPE
+   * @since 1.1
+   */
+  native boolean isPrimitive();
+
+  /**
+   * Get the name of this class, separated by dots for package separators.
+   * Primitive types and arrays are encoded as:
+   * <pre>
+   * boolean             Z
+   * byte                B
+   * char                C
+   * short               S
+   * int                 I
+   * long                J
+   * float               F
+   * double              D
+   * void                V
+   * array type          [<em>element type</em>
+   * class or interface, alone: &lt;dotted name&gt;
+   * class or interface, as element type: L&lt;dotted name&gt;;
+   *
+   * @return the name of this class
+   */
+  native String getName();
+
+  /**
+   * Get the direct superclass of this class.  If this is an interface,
+   * Object, a primitive type, or void, it will return null. If this is an
+   * array type, it will return Object.
+   *
+   * @return the direct superclass of this class
+   */
+  native Class getSuperclass();
+
+  /**
+   * Get the interfaces this class <EM>directly</EM> implements, in the
+   * order that they were declared. This returns an empty array, not null,
+   * for Object, primitives, void, and classes or interfaces with no direct
+   * superinterface. Array types return Cloneable and Serializable.
+   *
+   * @return the interfaces this class directly implements
+   */
+  native Class[] getInterfaces();
+
+  /**
+   * If this is an array, get the Class representing the type of array.
+   * Examples: "[[Ljava.lang.String;" would return "[Ljava.lang.String;", and
+   * calling getComponentType on that would give "java.lang.String".  If
+   * this is not an array, returns null.
+   *
+   * @return the array type of this class, or null
+   * @see Array
+   * @since 1.1
+   */
+  native Class getComponentType();
+
+  /**
+   * Get the modifiers of this class.  These can be decoded using Modifier,
+   * and is limited to one of public, protected, or private, and any of
+   * final, static, abstract, or interface. An array class has the same
+   * public, protected, or private modifier as its component type, and is
+   * marked final but not an interface. Primitive types and void are marked
+   * public and final, but not an interface.
+   *
+   * @return the modifiers of this class
+   * @see Modifer
+   * @since 1.1
+   */
+  native int getModifiers();
+
+  /**
+   * If this is a nested or inner class, return the class that declared it.
+   * If not, return null.
+   *
+   * @return the declaring class of this class
+   * @since 1.1
+   */
+  native Class getDeclaringClass();
+
+  /**
+   * Like <code>getDeclaredClasses()</code> but without the security checks.
+   *
+   * @param pulicOnly Only public classes should be returned
+   */
+  native Class[] getDeclaredClasses(boolean publicOnly);
+
+  /**
+   * Like <code>getDeclaredFields()</code> but without the security checks.
+   *
+   * @param pulicOnly Only public fields should be returned
+   */
+  native Field[] getDeclaredFields(boolean publicOnly);
+
+  /**
+   * Like <code>getDeclaredMethods()</code> but without the security checks.
+   *
+   * @param pulicOnly Only public methods should be returned
+   */
+  native Method[] getDeclaredMethods(boolean publicOnly);
+
+  /**
+   * Like <code>getDeclaredConstructors()</code> but without
+   * the security checks.
+   *
+   * @param pulicOnly Only public constructors should be returned
+   */
+  native Constructor[] getDeclaredConstructors(boolean publicOnly);
+
+  /**
+   * Return the class loader of this class.
+   *
+   * @return the class loader
+   */
+  native ClassLoader getClassLoader();
+} // class Class
