diff -r 25e350c6385f -r c40f70283620 emul/src/main/java/java/lang/Class.java --- a/emul/src/main/java/java/lang/Class.java Sat Dec 01 08:52:30 2012 +0100 +++ b/emul/src/main/java/java/lang/Class.java Sat Dec 01 12:15:12 2012 +0100 @@ -274,7 +274,9 @@ * {@code false} otherwise. * @since JDK1.1 */ - public native boolean isArray(); + public boolean isArray() { + return false; + } /** @@ -497,25 +499,25 @@ * @since 1.5 */ public String getCanonicalName() { - throw new UnsupportedOperationException(); -// if (isArray()) { -// String canonicalName = getComponentType().getCanonicalName(); -// if (canonicalName != null) -// return canonicalName + "[]"; -// else -// return null; -// } + if (isArray()) { + String canonicalName = getComponentType().getCanonicalName(); + if (canonicalName != null) + return canonicalName + "[]"; + else + return null; + } // if (isLocalOrAnonymousClass()) // return null; // Class enclosingClass = getEnclosingClass(); -// if (enclosingClass == null) { // top level class -// return getName(); -// } else { -// String enclosingName = enclosingClass.getCanonicalName(); -// if (enclosingName == null) -// return null; -// return enclosingName + "." + getSimpleName(); -// } + Class enclosingClass = null; + if (enclosingClass == null) { // top level class + return getName(); + } else { + String enclosingName = enclosingClass.getCanonicalName(); + if (enclosingName == null) + return null; + return enclosingName + "." + getSimpleName(); + } } /** @@ -676,7 +678,9 @@ * @see java.lang.reflect.Array * @since JDK1.1 */ - public native Class getComponentType(); + public Class getComponentType() { + return null; + } /** * Returns true if and only if this class was declared as an enum in the