rt/emul/mini/src/main/java/java/lang/Class.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 09 Jun 2014 19:17:41 +0200
changeset 1623 d9cdfd8ef694
parent 1621 dd848ea32287
child 1634 783acbc99199
permissions -rw-r--r--
Remove the dirty hacks with names. The fix with the compiler should be good enough.
     1 /*
     2  * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    25 
    26 package java.lang;
    27 
    28 import java.io.ByteArrayInputStream;
    29 import java.io.InputStream;
    30 import java.lang.annotation.Annotation;
    31 import java.lang.reflect.Array;
    32 import java.lang.reflect.Constructor;
    33 import java.lang.reflect.Field;
    34 import java.lang.reflect.Method;
    35 import java.lang.reflect.TypeVariable;
    36 import java.net.URL;
    37 import org.apidesign.bck2brwsr.core.Exported;
    38 import org.apidesign.bck2brwsr.core.JavaScriptBody;
    39 import org.apidesign.bck2brwsr.core.JavaScriptOnly;
    40 import org.apidesign.bck2brwsr.emul.reflect.AnnotationImpl;
    41 import org.apidesign.bck2brwsr.emul.reflect.MethodImpl;
    42 
    43 /**
    44  * Instances of the class {@code Class} represent classes and
    45  * interfaces in a running Java application.  An enum is a kind of
    46  * class and an annotation is a kind of interface.  Every array also
    47  * belongs to a class that is reflected as a {@code Class} object
    48  * that is shared by all arrays with the same element type and number
    49  * of dimensions.  The primitive Java types ({@code boolean},
    50  * {@code byte}, {@code char}, {@code short},
    51  * {@code int}, {@code long}, {@code float}, and
    52  * {@code double}), and the keyword {@code void} are also
    53  * represented as {@code Class} objects.
    54  *
    55  * <p> {@code Class} has no public constructor. Instead {@code Class}
    56  * objects are constructed automatically by the Java Virtual Machine as classes
    57  * are loaded and by calls to the {@code defineClass} method in the class
    58  * loader.
    59  *
    60  * <p> The following example uses a {@code Class} object to print the
    61  * class name of an object:
    62  *
    63  * <p> <blockquote><pre>
    64  *     void printClassName(Object obj) {
    65  *         System.out.println("The class of " + obj +
    66  *                            " is " + obj.getClass().getName());
    67  *     }
    68  * </pre></blockquote>
    69  *
    70  * <p> It is also possible to get the {@code Class} object for a named
    71  * type (or for void) using a class literal.  See Section 15.8.2 of
    72  * <cite>The Java&trade; Language Specification</cite>.
    73  * For example:
    74  *
    75  * <p> <blockquote>
    76  *     {@code System.out.println("The name of class Foo is: "+Foo.class.getName());}
    77  * </blockquote>
    78  *
    79  * @param <T> the type of the class modeled by this {@code Class}
    80  * object.  For example, the type of {@code String.class} is {@code
    81  * Class<String>}.  Use {@code Class<?>} if the class being modeled is
    82  * unknown.
    83  *
    84  * @author  unascribed
    85  * @see     java.lang.ClassLoader#defineClass(byte[], int, int)
    86  * @since   JDK1.0
    87  */
    88 public final
    89     class Class<T> implements java.io.Serializable,
    90                               java.lang.reflect.GenericDeclaration,
    91                               java.lang.reflect.Type,
    92                               java.lang.reflect.AnnotatedElement {
    93     private static final int ANNOTATION= 0x00002000;
    94     private static final int ENUM      = 0x00004000;
    95     private static final int SYNTHETIC = 0x00001000;
    96 
    97     /*
    98      * Constructor. Only the Java Virtual Machine creates Class
    99      * objects.
   100      */
   101     private Class() {}
   102 
   103 
   104     /**
   105      * Converts the object to a string. The string representation is the
   106      * string "class" or "interface", followed by a space, and then by the
   107      * fully qualified name of the class in the format returned by
   108      * {@code getName}.  If this {@code Class} object represents a
   109      * primitive type, this method returns the name of the primitive type.  If
   110      * this {@code Class} object represents void this method returns
   111      * "void".
   112      *
   113      * @return a string representation of this class object.
   114      */
   115     public String toString() {
   116         return (isInterface() ? "interface " : (isPrimitive() ? "" : "class "))
   117             + getName();
   118     }
   119 
   120 
   121     /**
   122      * Returns the {@code Class} object associated with the class or
   123      * interface with the given string name.  Invoking this method is
   124      * equivalent to:
   125      *
   126      * <blockquote>
   127      *  {@code Class.forName(className, true, currentLoader)}
   128      * </blockquote>
   129      *
   130      * where {@code currentLoader} denotes the defining class loader of
   131      * the current class.
   132      *
   133      * <p> For example, the following code fragment returns the
   134      * runtime {@code Class} descriptor for the class named
   135      * {@code java.lang.Thread}:
   136      *
   137      * <blockquote>
   138      *   {@code Class t = Class.forName("java.lang.Thread")}
   139      * </blockquote>
   140      * <p>
   141      * A call to {@code forName("X")} causes the class named
   142      * {@code X} to be initialized.
   143      *
   144      * @param      className   the fully qualified name of the desired class.
   145      * @return     the {@code Class} object for the class with the
   146      *             specified name.
   147      * @exception LinkageError if the linkage fails
   148      * @exception ExceptionInInitializerError if the initialization provoked
   149      *            by this method fails
   150      * @exception ClassNotFoundException if the class cannot be located
   151      */
   152     public static Class<?> forName(String className)
   153     throws ClassNotFoundException {
   154         if (className.startsWith("[")) {
   155             Class<?> arrType = defineArray(className, null);
   156             Class<?> c = arrType;
   157             while (c != null && c.isArray()) {
   158                 c = c.getComponentType0(); // verify component type is sane
   159             }
   160             return arrType;
   161         }
   162         try {
   163             Class<?> c = loadCls(className, className.replace('.', '_'));
   164             if (c == null) {
   165                 throw new ClassNotFoundException(className);
   166             }
   167             return c;
   168         } catch (Throwable ex) {
   169             throw new ClassNotFoundException(className, ex);
   170         }
   171     }
   172 
   173 
   174     /**
   175      * Returns the {@code Class} object associated with the class or
   176      * interface with the given string name, using the given class loader.
   177      * Given the fully qualified name for a class or interface (in the same
   178      * format returned by {@code getName}) this method attempts to
   179      * locate, load, and link the class or interface.  The specified class
   180      * loader is used to load the class or interface.  If the parameter
   181      * {@code loader} is null, the class is loaded through the bootstrap
   182      * class loader.  The class is initialized only if the
   183      * {@code initialize} parameter is {@code true} and if it has
   184      * not been initialized earlier.
   185      *
   186      * <p> If {@code name} denotes a primitive type or void, an attempt
   187      * will be made to locate a user-defined class in the unnamed package whose
   188      * name is {@code name}. Therefore, this method cannot be used to
   189      * obtain any of the {@code Class} objects representing primitive
   190      * types or void.
   191      *
   192      * <p> If {@code name} denotes an array class, the component type of
   193      * the array class is loaded but not initialized.
   194      *
   195      * <p> For example, in an instance method the expression:
   196      *
   197      * <blockquote>
   198      *  {@code Class.forName("Foo")}
   199      * </blockquote>
   200      *
   201      * is equivalent to:
   202      *
   203      * <blockquote>
   204      *  {@code Class.forName("Foo", true, this.getClass().getClassLoader())}
   205      * </blockquote>
   206      *
   207      * Note that this method throws errors related to loading, linking or
   208      * initializing as specified in Sections 12.2, 12.3 and 12.4 of <em>The
   209      * Java Language Specification</em>.
   210      * Note that this method does not check whether the requested class
   211      * is accessible to its caller.
   212      *
   213      * <p> If the {@code loader} is {@code null}, and a security
   214      * manager is present, and the caller's class loader is not null, then this
   215      * method calls the security manager's {@code checkPermission} method
   216      * with a {@code RuntimePermission("getClassLoader")} permission to
   217      * ensure it's ok to access the bootstrap class loader.
   218      *
   219      * @param name       fully qualified name of the desired class
   220      * @param initialize whether the class must be initialized
   221      * @param loader     class loader from which the class must be loaded
   222      * @return           class object representing the desired class
   223      *
   224      * @exception LinkageError if the linkage fails
   225      * @exception ExceptionInInitializerError if the initialization provoked
   226      *            by this method fails
   227      * @exception ClassNotFoundException if the class cannot be located by
   228      *            the specified class loader
   229      *
   230      * @see       java.lang.Class#forName(String)
   231      * @see       java.lang.ClassLoader
   232      * @since     1.2
   233      */
   234     public static Class<?> forName(String name, boolean initialize,
   235                                    ClassLoader loader)
   236         throws ClassNotFoundException
   237     {
   238         return forName(name);
   239     }
   240     
   241     @JavaScriptBody(args = {"n", "c" }, body =
   242         "var m = vm[c];\n"
   243       + "if (!m) {\n"
   244       + "  var l = vm.loadClass ? vm.loadClass : exports ? exports.loadClass : null;\n"
   245       + "  if (l) {\n"
   246       + "    l(n);\n"
   247       + "  }\n"
   248       + "  if (vm[c]) m = vm[c];\n"
   249       + "  else if (exports[c]) m = exports[c];\n"
   250       + "}\n"
   251       + "if (!m) return null;"
   252       + "m(false);"
   253       + "return m.$class;"
   254     )
   255     private static native Class<?> loadCls(String n, String c);
   256 
   257 
   258     /**
   259      * Creates a new instance of the class represented by this {@code Class}
   260      * object.  The class is instantiated as if by a {@code new}
   261      * expression with an empty argument list.  The class is initialized if it
   262      * has not already been initialized.
   263      *
   264      * <p>Note that this method propagates any exception thrown by the
   265      * nullary constructor, including a checked exception.  Use of
   266      * this method effectively bypasses the compile-time exception
   267      * checking that would otherwise be performed by the compiler.
   268      * The {@link
   269      * java.lang.reflect.Constructor#newInstance(java.lang.Object...)
   270      * Constructor.newInstance} method avoids this problem by wrapping
   271      * any exception thrown by the constructor in a (checked) {@link
   272      * java.lang.reflect.InvocationTargetException}.
   273      *
   274      * @return     a newly allocated instance of the class represented by this
   275      *             object.
   276      * @exception  IllegalAccessException  if the class or its nullary
   277      *               constructor is not accessible.
   278      * @exception  InstantiationException
   279      *               if this {@code Class} represents an abstract class,
   280      *               an interface, an array class, a primitive type, or void;
   281      *               or if the class has no nullary constructor;
   282      *               or if the instantiation fails for some other reason.
   283      * @exception  ExceptionInInitializerError if the initialization
   284      *               provoked by this method fails.
   285      * @exception  SecurityException
   286      *             If a security manager, <i>s</i>, is present and any of the
   287      *             following conditions is met:
   288      *
   289      *             <ul>
   290      *
   291      *             <li> invocation of
   292      *             {@link SecurityManager#checkMemberAccess
   293      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
   294      *             creation of new instances of this class
   295      *
   296      *             <li> the caller's class loader is not the same as or an
   297      *             ancestor of the class loader for the current class and
   298      *             invocation of {@link SecurityManager#checkPackageAccess
   299      *             s.checkPackageAccess()} denies access to the package
   300      *             of this class
   301      *
   302      *             </ul>
   303      *
   304      */
   305     @JavaScriptBody(args = { "self", "illegal" }, body =
   306           "\nvar c = self.cnstr;"
   307         + "\nif (c['cons__V']) {"
   308         + "\n  if ((c['cons__V'].access & 0x1) != 0) {"
   309         + "\n    var inst = c();"
   310         + "\n    c['cons__V'].call(inst);"
   311         + "\n    return inst;"
   312         + "\n  }"
   313         + "\n  return illegal;"
   314         + "\n}"
   315         + "\nreturn null;"
   316     )
   317     private static native Object newInstance0(Class<?> self, Object illegal);
   318     
   319     public T newInstance()
   320         throws InstantiationException, IllegalAccessException
   321     {
   322         Object illegal = new Object();
   323         Object inst = newInstance0(this, illegal);
   324         if (inst == null) {
   325             throw new InstantiationException(getName());
   326         }
   327         if (inst == illegal) {
   328             throw new IllegalAccessException();
   329         }
   330         return (T)inst;
   331     }
   332 
   333     /**
   334      * Determines if the specified {@code Object} is assignment-compatible
   335      * with the object represented by this {@code Class}.  This method is
   336      * the dynamic equivalent of the Java language {@code instanceof}
   337      * operator. The method returns {@code true} if the specified
   338      * {@code Object} argument is non-null and can be cast to the
   339      * reference type represented by this {@code Class} object without
   340      * raising a {@code ClassCastException.} It returns {@code false}
   341      * otherwise.
   342      *
   343      * <p> Specifically, if this {@code Class} object represents a
   344      * declared class, this method returns {@code true} if the specified
   345      * {@code Object} argument is an instance of the represented class (or
   346      * of any of its subclasses); it returns {@code false} otherwise. If
   347      * this {@code Class} object represents an array class, this method
   348      * returns {@code true} if the specified {@code Object} argument
   349      * can be converted to an object of the array class by an identity
   350      * conversion or by a widening reference conversion; it returns
   351      * {@code false} otherwise. If this {@code Class} object
   352      * represents an interface, this method returns {@code true} if the
   353      * class or any superclass of the specified {@code Object} argument
   354      * implements this interface; it returns {@code false} otherwise. If
   355      * this {@code Class} object represents a primitive type, this method
   356      * returns {@code false}.
   357      *
   358      * @param   obj the object to check
   359      * @return  true if {@code obj} is an instance of this class
   360      *
   361      * @since JDK1.1
   362      */
   363     public boolean isInstance(Object obj) {
   364         if (obj == null) {
   365             return false;
   366         }
   367         if (isArray()) {
   368             return isAssignableFrom(obj.getClass());
   369         }
   370         
   371         String prop = "$instOf_" + getName().replace('.', '_');
   372         return hasProperty(obj, prop);
   373     }
   374     
   375     @JavaScriptBody(args = { "who", "prop" }, body = 
   376         "if (who[prop]) return true; else return false;"
   377     )
   378     private static native boolean hasProperty(Object who, String prop);
   379 
   380 
   381     /**
   382      * Determines if the class or interface represented by this
   383      * {@code Class} object is either the same as, or is a superclass or
   384      * superinterface of, the class or interface represented by the specified
   385      * {@code Class} parameter. It returns {@code true} if so;
   386      * otherwise it returns {@code false}. If this {@code Class}
   387      * object represents a primitive type, this method returns
   388      * {@code true} if the specified {@code Class} parameter is
   389      * exactly this {@code Class} object; otherwise it returns
   390      * {@code false}.
   391      *
   392      * <p> Specifically, this method tests whether the type represented by the
   393      * specified {@code Class} parameter can be converted to the type
   394      * represented by this {@code Class} object via an identity conversion
   395      * or via a widening reference conversion. See <em>The Java Language
   396      * Specification</em>, sections 5.1.1 and 5.1.4 , for details.
   397      *
   398      * @param cls the {@code Class} object to be checked
   399      * @return the {@code boolean} value indicating whether objects of the
   400      * type {@code cls} can be assigned to objects of this class
   401      * @exception NullPointerException if the specified Class parameter is
   402      *            null.
   403      * @since JDK1.1
   404      */
   405     public boolean isAssignableFrom(Class<?> cls) {
   406         if (this == cls) {
   407             return true;
   408         }
   409         
   410         if (isArray()) {
   411             final Class<?> cmpType = cls.getComponentType();
   412             if (isPrimitive()) {
   413                 return this == cmpType;
   414             }
   415             return cmpType != null && getComponentType().isAssignableFrom(cmpType);
   416         }
   417         if (isPrimitive()) {
   418             return false;
   419         } else {
   420             if (cls.isPrimitive()) {
   421                 return false;
   422             }
   423             String prop = "$instOf_" + getName().replace('.', '_');
   424             return hasCnstrProperty(cls, prop);
   425         }
   426     }
   427 
   428     @JavaScriptBody(args = { "who", "prop" }, body = 
   429         "if (who.cnstr.prototype[prop]) return true; else return false;"
   430     )
   431     private static native boolean hasCnstrProperty(Object who, String prop);
   432     
   433     
   434     /**
   435      * Determines if the specified {@code Class} object represents an
   436      * interface type.
   437      *
   438      * @return  {@code true} if this object represents an interface;
   439      *          {@code false} otherwise.
   440      */
   441     public boolean isInterface() {
   442         return (getAccess() & 0x200) != 0;
   443     }
   444     
   445     @JavaScriptBody(args = {}, body = "return this.access;")
   446     private native int getAccess();
   447 
   448 
   449     /**
   450      * Determines if this {@code Class} object represents an array class.
   451      *
   452      * @return  {@code true} if this object represents an array class;
   453      *          {@code false} otherwise.
   454      * @since   JDK1.1
   455      */
   456     public boolean isArray() {
   457         return hasProperty(this, "array"); // NOI18N
   458     }
   459 
   460 
   461     /**
   462      * Determines if the specified {@code Class} object represents a
   463      * primitive type.
   464      *
   465      * <p> There are nine predefined {@code Class} objects to represent
   466      * the eight primitive types and void.  These are created by the Java
   467      * Virtual Machine, and have the same names as the primitive types that
   468      * they represent, namely {@code boolean}, {@code byte},
   469      * {@code char}, {@code short}, {@code int},
   470      * {@code long}, {@code float}, and {@code double}.
   471      *
   472      * <p> These objects may only be accessed via the following public static
   473      * final variables, and are the only {@code Class} objects for which
   474      * this method returns {@code true}.
   475      *
   476      * @return true if and only if this class represents a primitive type
   477      *
   478      * @see     java.lang.Boolean#TYPE
   479      * @see     java.lang.Character#TYPE
   480      * @see     java.lang.Byte#TYPE
   481      * @see     java.lang.Short#TYPE
   482      * @see     java.lang.Integer#TYPE
   483      * @see     java.lang.Long#TYPE
   484      * @see     java.lang.Float#TYPE
   485      * @see     java.lang.Double#TYPE
   486      * @see     java.lang.Void#TYPE
   487      * @since JDK1.1
   488      */
   489     @JavaScriptBody(args = {}, body = 
   490            "if (this.primitive) return true;"
   491         + "else return false;"
   492     )
   493     public native boolean isPrimitive();
   494 
   495     /**
   496      * Returns true if this {@code Class} object represents an annotation
   497      * type.  Note that if this method returns true, {@link #isInterface()}
   498      * would also return true, as all annotation types are also interfaces.
   499      *
   500      * @return {@code true} if this class object represents an annotation
   501      *      type; {@code false} otherwise
   502      * @since 1.5
   503      */
   504     public boolean isAnnotation() {
   505         return (getModifiers() & ANNOTATION) != 0;
   506     }
   507 
   508     /**
   509      * Returns {@code true} if this class is a synthetic class;
   510      * returns {@code false} otherwise.
   511      * @return {@code true} if and only if this class is a synthetic class as
   512      *         defined by the Java Language Specification.
   513      * @since 1.5
   514      */
   515     public boolean isSynthetic() {
   516         return (getModifiers() & SYNTHETIC) != 0;
   517     }
   518 
   519     /**
   520      * Returns the  name of the entity (class, interface, array class,
   521      * primitive type, or void) represented by this {@code Class} object,
   522      * as a {@code String}.
   523      *
   524      * <p> If this class object represents a reference type that is not an
   525      * array type then the binary name of the class is returned, as specified
   526      * by
   527      * <cite>The Java&trade; Language Specification</cite>.
   528      *
   529      * <p> If this class object represents a primitive type or void, then the
   530      * name returned is a {@code String} equal to the Java language
   531      * keyword corresponding to the primitive type or void.
   532      *
   533      * <p> If this class object represents a class of arrays, then the internal
   534      * form of the name consists of the name of the element type preceded by
   535      * one or more '{@code [}' characters representing the depth of the array
   536      * nesting.  The encoding of element type names is as follows:
   537      *
   538      * <blockquote><table summary="Element types and encodings">
   539      * <tr><th> Element Type <th> &nbsp;&nbsp;&nbsp; <th> Encoding
   540      * <tr><td> boolean      <td> &nbsp;&nbsp;&nbsp; <td align=center> Z
   541      * <tr><td> byte         <td> &nbsp;&nbsp;&nbsp; <td align=center> B
   542      * <tr><td> char         <td> &nbsp;&nbsp;&nbsp; <td align=center> C
   543      * <tr><td> class or interface
   544      *                       <td> &nbsp;&nbsp;&nbsp; <td align=center> L<i>classname</i>;
   545      * <tr><td> double       <td> &nbsp;&nbsp;&nbsp; <td align=center> D
   546      * <tr><td> float        <td> &nbsp;&nbsp;&nbsp; <td align=center> F
   547      * <tr><td> int          <td> &nbsp;&nbsp;&nbsp; <td align=center> I
   548      * <tr><td> long         <td> &nbsp;&nbsp;&nbsp; <td align=center> J
   549      * <tr><td> short        <td> &nbsp;&nbsp;&nbsp; <td align=center> S
   550      * </table></blockquote>
   551      *
   552      * <p> The class or interface name <i>classname</i> is the binary name of
   553      * the class specified above.
   554      *
   555      * <p> Examples:
   556      * <blockquote><pre>
   557      * String.class.getName()
   558      *     returns "java.lang.String"
   559      * byte.class.getName()
   560      *     returns "byte"
   561      * (new Object[3]).getClass().getName()
   562      *     returns "[Ljava.lang.Object;"
   563      * (new int[3][4][5][6][7][8][9]).getClass().getName()
   564      *     returns "[[[[[[[I"
   565      * </pre></blockquote>
   566      *
   567      * @return  the name of the class or interface
   568      *          represented by this object.
   569      */
   570     public String getName() {
   571         return jvmName().replace('/', '.');
   572     }
   573 
   574     @JavaScriptBody(args = {}, body = "return this.jvmName;")
   575     private native String jvmName();
   576 
   577     
   578     /**
   579      * Returns an array of {@code TypeVariable} objects that represent the
   580      * type variables declared by the generic declaration represented by this
   581      * {@code GenericDeclaration} object, in declaration order.  Returns an
   582      * array of length 0 if the underlying generic declaration declares no type
   583      * variables.
   584      *
   585      * @return an array of {@code TypeVariable} objects that represent
   586      *     the type variables declared by this generic declaration
   587      * @throws java.lang.reflect.GenericSignatureFormatError if the generic
   588      *     signature of this generic declaration does not conform to
   589      *     the format specified in
   590      *     <cite>The Java&trade; Virtual Machine Specification</cite>
   591      * @since 1.5
   592      */
   593     public TypeVariable<Class<T>>[] getTypeParameters() {
   594         throw new UnsupportedOperationException();
   595     }
   596  
   597     /**
   598      * Returns the {@code Class} representing the superclass of the entity
   599      * (class, interface, primitive type or void) represented by this
   600      * {@code Class}.  If this {@code Class} represents either the
   601      * {@code Object} class, an interface, a primitive type, or void, then
   602      * null is returned.  If this object represents an array class then the
   603      * {@code Class} object representing the {@code Object} class is
   604      * returned.
   605      *
   606      * @return the superclass of the class represented by this object.
   607      */
   608     @JavaScriptBody(args = {}, body = "return this.superclass;")
   609     public native Class<? super T> getSuperclass();
   610 
   611     /**
   612      * Returns the Java language modifiers for this class or interface, encoded
   613      * in an integer. The modifiers consist of the Java Virtual Machine's
   614      * constants for {@code public}, {@code protected},
   615      * {@code private}, {@code final}, {@code static},
   616      * {@code abstract} and {@code interface}; they should be decoded
   617      * using the methods of class {@code Modifier}.
   618      *
   619      * <p> If the underlying class is an array class, then its
   620      * {@code public}, {@code private} and {@code protected}
   621      * modifiers are the same as those of its component type.  If this
   622      * {@code Class} represents a primitive type or void, its
   623      * {@code public} modifier is always {@code true}, and its
   624      * {@code protected} and {@code private} modifiers are always
   625      * {@code false}. If this object represents an array class, a
   626      * primitive type or void, then its {@code final} modifier is always
   627      * {@code true} and its interface modifier is always
   628      * {@code false}. The values of its other modifiers are not determined
   629      * by this specification.
   630      *
   631      * <p> The modifier encodings are defined in <em>The Java Virtual Machine
   632      * Specification</em>, table 4.1.
   633      *
   634      * @return the {@code int} representing the modifiers for this class
   635      * @see     java.lang.reflect.Modifier
   636      * @since JDK1.1
   637      */
   638     public int getModifiers() {
   639         return getAccess();
   640     }
   641 
   642     /**
   643      * If the class or interface represented by this {@code Class} object
   644      * is a member of another class, returns the {@code Class} object
   645      * representing the class in which it was declared.  This method returns
   646      * null if this class or interface is not a member of any other class.  If
   647      * this {@code Class} object represents an array class, a primitive
   648      * type, or void,then this method returns null.
   649      *
   650      * @return the declaring class for this class
   651      * @since JDK1.1
   652      */
   653     public Class<?> getDeclaringClass() {
   654         throw new SecurityException();
   655     }
   656 
   657     /**
   658      * Returns the simple name of the underlying class as given in the
   659      * source code. Returns an empty string if the underlying class is
   660      * anonymous.
   661      *
   662      * <p>The simple name of an array is the simple name of the
   663      * component type with "[]" appended.  In particular the simple
   664      * name of an array whose component type is anonymous is "[]".
   665      *
   666      * @return the simple name of the underlying class
   667      * @since 1.5
   668      */
   669     public String getSimpleName() {
   670         if (isArray())
   671             return getComponentType().getSimpleName()+"[]";
   672 
   673         String simpleName = getSimpleBinaryName();
   674         if (simpleName == null) { // top level class
   675             simpleName = getName();
   676             return simpleName.substring(simpleName.lastIndexOf(".")+1); // strip the package name
   677         }
   678         // According to JLS3 "Binary Compatibility" (13.1) the binary
   679         // name of non-package classes (not top level) is the binary
   680         // name of the immediately enclosing class followed by a '$' followed by:
   681         // (for nested and inner classes): the simple name.
   682         // (for local classes): 1 or more digits followed by the simple name.
   683         // (for anonymous classes): 1 or more digits.
   684 
   685         // Since getSimpleBinaryName() will strip the binary name of
   686         // the immediatly enclosing class, we are now looking at a
   687         // string that matches the regular expression "\$[0-9]*"
   688         // followed by a simple name (considering the simple of an
   689         // anonymous class to be the empty string).
   690 
   691         // Remove leading "\$[0-9]*" from the name
   692         int length = simpleName.length();
   693         if (length < 1 || simpleName.charAt(0) != '$')
   694             throw new IllegalStateException("Malformed class name");
   695         int index = 1;
   696         while (index < length && isAsciiDigit(simpleName.charAt(index)))
   697             index++;
   698         // Eventually, this is the empty string iff this is an anonymous class
   699         return simpleName.substring(index);
   700     }
   701 
   702     /**
   703      * Returns the "simple binary name" of the underlying class, i.e.,
   704      * the binary name without the leading enclosing class name.
   705      * Returns {@code null} if the underlying class is a top level
   706      * class.
   707      */
   708     private String getSimpleBinaryName() {
   709         Class<?> enclosingClass = null; // XXX getEnclosingClass();
   710         if (enclosingClass == null) // top level class
   711             return null;
   712         // Otherwise, strip the enclosing class' name
   713         try {
   714             return getName().substring(enclosingClass.getName().length());
   715         } catch (IndexOutOfBoundsException ex) {
   716             throw new IllegalStateException("Malformed class name");
   717         }
   718     }
   719 
   720     /**
   721      * Returns an array containing {@code Field} objects reflecting all
   722      * the accessible public fields of the class or interface represented by
   723      * this {@code Class} object.  The elements in the array returned are
   724      * not sorted and are not in any particular order.  This method returns an
   725      * array of length 0 if the class or interface has no accessible public
   726      * fields, or if it represents an array class, a primitive type, or void.
   727      *
   728      * <p> Specifically, if this {@code Class} object represents a class,
   729      * this method returns the public fields of this class and of all its
   730      * superclasses.  If this {@code Class} object represents an
   731      * interface, this method returns the fields of this interface and of all
   732      * its superinterfaces.
   733      *
   734      * <p> The implicit length field for array class is not reflected by this
   735      * method. User code should use the methods of class {@code Array} to
   736      * manipulate arrays.
   737      *
   738      * <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.3.
   739      *
   740      * @return the array of {@code Field} objects representing the
   741      * public fields
   742      * @exception  SecurityException
   743      *             If a security manager, <i>s</i>, is present and any of the
   744      *             following conditions is met:
   745      *
   746      *             <ul>
   747      *
   748      *             <li> invocation of
   749      *             {@link SecurityManager#checkMemberAccess
   750      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
   751      *             access to the fields within this class
   752      *
   753      *             <li> the caller's class loader is not the same as or an
   754      *             ancestor of the class loader for the current class and
   755      *             invocation of {@link SecurityManager#checkPackageAccess
   756      *             s.checkPackageAccess()} denies access to the package
   757      *             of this class
   758      *
   759      *             </ul>
   760      *
   761      * @since JDK1.1
   762      */
   763     public Field[] getFields() throws SecurityException {
   764         throw new SecurityException();
   765     }
   766 
   767     /**
   768      * Returns an array containing {@code Method} objects reflecting all
   769      * the public <em>member</em> methods of the class or interface represented
   770      * by this {@code Class} object, including those declared by the class
   771      * or interface and those inherited from superclasses and
   772      * superinterfaces.  Array classes return all the (public) member methods
   773      * inherited from the {@code Object} class.  The elements in the array
   774      * returned are not sorted and are not in any particular order.  This
   775      * method returns an array of length 0 if this {@code Class} object
   776      * represents a class or interface that has no public member methods, or if
   777      * this {@code Class} object represents a primitive type or void.
   778      *
   779      * <p> The class initialization method {@code <clinit>} is not
   780      * included in the returned array. If the class declares multiple public
   781      * member methods with the same parameter types, they are all included in
   782      * the returned array.
   783      *
   784      * <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.4.
   785      *
   786      * @return the array of {@code Method} objects representing the
   787      * public methods of this class
   788      * @exception  SecurityException
   789      *             If a security manager, <i>s</i>, is present and any of the
   790      *             following conditions is met:
   791      *
   792      *             <ul>
   793      *
   794      *             <li> invocation of
   795      *             {@link SecurityManager#checkMemberAccess
   796      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
   797      *             access to the methods within this class
   798      *
   799      *             <li> the caller's class loader is not the same as or an
   800      *             ancestor of the class loader for the current class and
   801      *             invocation of {@link SecurityManager#checkPackageAccess
   802      *             s.checkPackageAccess()} denies access to the package
   803      *             of this class
   804      *
   805      *             </ul>
   806      *
   807      * @since JDK1.1
   808      */
   809     public Method[] getMethods() throws SecurityException {
   810         return MethodImpl.findMethods(this, 0x01);
   811     }
   812 
   813     /**
   814      * Returns a {@code Field} object that reflects the specified public
   815      * member field of the class or interface represented by this
   816      * {@code Class} object. The {@code name} parameter is a
   817      * {@code String} specifying the simple name of the desired field.
   818      *
   819      * <p> The field to be reflected is determined by the algorithm that
   820      * follows.  Let C be the class represented by this object:
   821      * <OL>
   822      * <LI> If C declares a public field with the name specified, that is the
   823      *      field to be reflected.</LI>
   824      * <LI> If no field was found in step 1 above, this algorithm is applied
   825      *      recursively to each direct superinterface of C. The direct
   826      *      superinterfaces are searched in the order they were declared.</LI>
   827      * <LI> If no field was found in steps 1 and 2 above, and C has a
   828      *      superclass S, then this algorithm is invoked recursively upon S.
   829      *      If C has no superclass, then a {@code NoSuchFieldException}
   830      *      is thrown.</LI>
   831      * </OL>
   832      *
   833      * <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.3.
   834      *
   835      * @param name the field name
   836      * @return  the {@code Field} object of this class specified by
   837      * {@code name}
   838      * @exception NoSuchFieldException if a field with the specified name is
   839      *              not found.
   840      * @exception NullPointerException if {@code name} is {@code null}
   841      * @exception  SecurityException
   842      *             If a security manager, <i>s</i>, is present and any of the
   843      *             following conditions is met:
   844      *
   845      *             <ul>
   846      *
   847      *             <li> invocation of
   848      *             {@link SecurityManager#checkMemberAccess
   849      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
   850      *             access to the field
   851      *
   852      *             <li> the caller's class loader is not the same as or an
   853      *             ancestor of the class loader for the current class and
   854      *             invocation of {@link SecurityManager#checkPackageAccess
   855      *             s.checkPackageAccess()} denies access to the package
   856      *             of this class
   857      *
   858      *             </ul>
   859      *
   860      * @since JDK1.1
   861      */
   862     public Field getField(String name)
   863         throws SecurityException {
   864         throw new SecurityException();
   865     }
   866     
   867     
   868     /**
   869      * Returns a {@code Method} object that reflects the specified public
   870      * member method of the class or interface represented by this
   871      * {@code Class} object. The {@code name} parameter is a
   872      * {@code String} specifying the simple name of the desired method. The
   873      * {@code parameterTypes} parameter is an array of {@code Class}
   874      * objects that identify the method's formal parameter types, in declared
   875      * order. If {@code parameterTypes} is {@code null}, it is
   876      * treated as if it were an empty array.
   877      *
   878      * <p> If the {@code name} is "{@code <init>};"or "{@code <clinit>}" a
   879      * {@code NoSuchMethodException} is raised. Otherwise, the method to
   880      * be reflected is determined by the algorithm that follows.  Let C be the
   881      * class represented by this object:
   882      * <OL>
   883      * <LI> C is searched for any <I>matching methods</I>. If no matching
   884      *      method is found, the algorithm of step 1 is invoked recursively on
   885      *      the superclass of C.</LI>
   886      * <LI> If no method was found in step 1 above, the superinterfaces of C
   887      *      are searched for a matching method. If any such method is found, it
   888      *      is reflected.</LI>
   889      * </OL>
   890      *
   891      * To find a matching method in a class C:&nbsp; If C declares exactly one
   892      * public method with the specified name and exactly the same formal
   893      * parameter types, that is the method reflected. If more than one such
   894      * method is found in C, and one of these methods has a return type that is
   895      * more specific than any of the others, that method is reflected;
   896      * otherwise one of the methods is chosen arbitrarily.
   897      *
   898      * <p>Note that there may be more than one matching method in a
   899      * class because while the Java language forbids a class to
   900      * declare multiple methods with the same signature but different
   901      * return types, the Java virtual machine does not.  This
   902      * increased flexibility in the virtual machine can be used to
   903      * implement various language features.  For example, covariant
   904      * returns can be implemented with {@linkplain
   905      * java.lang.reflect.Method#isBridge bridge methods}; the bridge
   906      * method and the method being overridden would have the same
   907      * signature but different return types.
   908      *
   909      * <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.4.
   910      *
   911      * @param name the name of the method
   912      * @param parameterTypes the list of parameters
   913      * @return the {@code Method} object that matches the specified
   914      * {@code name} and {@code parameterTypes}
   915      * @exception NoSuchMethodException if a matching method is not found
   916      *            or if the name is "&lt;init&gt;"or "&lt;clinit&gt;".
   917      * @exception NullPointerException if {@code name} is {@code null}
   918      * @exception  SecurityException
   919      *             If a security manager, <i>s</i>, is present and any of the
   920      *             following conditions is met:
   921      *
   922      *             <ul>
   923      *
   924      *             <li> invocation of
   925      *             {@link SecurityManager#checkMemberAccess
   926      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
   927      *             access to the method
   928      *
   929      *             <li> the caller's class loader is not the same as or an
   930      *             ancestor of the class loader for the current class and
   931      *             invocation of {@link SecurityManager#checkPackageAccess
   932      *             s.checkPackageAccess()} denies access to the package
   933      *             of this class
   934      *
   935      *             </ul>
   936      *
   937      * @since JDK1.1
   938      */
   939     public Method getMethod(String name, Class<?>... parameterTypes)
   940         throws SecurityException, NoSuchMethodException {
   941         Method m = MethodImpl.findMethod(this, name, parameterTypes);
   942         if (m == null) {
   943             StringBuilder sb = new StringBuilder();
   944             sb.append(getName()).append('.').append(name).append('(');
   945             String sep = "";
   946             for (int i = 0; i < parameterTypes.length; i++) {
   947                 sb.append(sep).append(parameterTypes[i].getName());
   948                 sep = ", ";
   949             }
   950             sb.append(')');
   951             throw new NoSuchMethodException(sb.toString());
   952         }
   953         return m;
   954     }
   955     
   956     /**
   957      * Returns an array of {@code Method} objects reflecting all the
   958      * methods declared by the class or interface represented by this
   959      * {@code Class} object. This includes public, protected, default
   960      * (package) access, and private methods, but excludes inherited methods.
   961      * The elements in the array returned are not sorted and are not in any
   962      * particular order.  This method returns an array of length 0 if the class
   963      * or interface declares no methods, or if this {@code Class} object
   964      * represents a primitive type, an array class, or void.  The class
   965      * initialization method {@code <clinit>} is not included in the
   966      * returned array. If the class declares multiple public member methods
   967      * with the same parameter types, they are all included in the returned
   968      * array.
   969      *
   970      * <p> See <em>The Java Language Specification</em>, section 8.2.
   971      *
   972      * @return    the array of {@code Method} objects representing all the
   973      * declared methods of this class
   974      * @exception  SecurityException
   975      *             If a security manager, <i>s</i>, is present and any of the
   976      *             following conditions is met:
   977      *
   978      *             <ul>
   979      *
   980      *             <li> invocation of
   981      *             {@link SecurityManager#checkMemberAccess
   982      *             s.checkMemberAccess(this, Member.DECLARED)} denies
   983      *             access to the declared methods within this class
   984      *
   985      *             <li> the caller's class loader is not the same as or an
   986      *             ancestor of the class loader for the current class and
   987      *             invocation of {@link SecurityManager#checkPackageAccess
   988      *             s.checkPackageAccess()} denies access to the package
   989      *             of this class
   990      *
   991      *             </ul>
   992      *
   993      * @since JDK1.1
   994      */
   995     public Method[] getDeclaredMethods() throws SecurityException {
   996         throw new SecurityException();
   997     }
   998     
   999     /**
  1000      * Returns an array of {@code Field} objects reflecting all the fields
  1001      * declared by the class or interface represented by this
  1002      * {@code Class} object. This includes public, protected, default
  1003      * (package) access, and private fields, but excludes inherited fields.
  1004      * The elements in the array returned are not sorted and are not in any
  1005      * particular order.  This method returns an array of length 0 if the class
  1006      * or interface declares no fields, or if this {@code Class} object
  1007      * represents a primitive type, an array class, or void.
  1008      *
  1009      * <p> See <em>The Java Language Specification</em>, sections 8.2 and 8.3.
  1010      *
  1011      * @return    the array of {@code Field} objects representing all the
  1012      * declared fields of this class
  1013      * @exception  SecurityException
  1014      *             If a security manager, <i>s</i>, is present and any of the
  1015      *             following conditions is met:
  1016      *
  1017      *             <ul>
  1018      *
  1019      *             <li> invocation of
  1020      *             {@link SecurityManager#checkMemberAccess
  1021      *             s.checkMemberAccess(this, Member.DECLARED)} denies
  1022      *             access to the declared fields within this class
  1023      *
  1024      *             <li> the caller's class loader is not the same as or an
  1025      *             ancestor of the class loader for the current class and
  1026      *             invocation of {@link SecurityManager#checkPackageAccess
  1027      *             s.checkPackageAccess()} denies access to the package
  1028      *             of this class
  1029      *
  1030      *             </ul>
  1031      *
  1032      * @since JDK1.1
  1033      */
  1034     public Field[] getDeclaredFields() throws SecurityException {
  1035         throw new SecurityException();
  1036     }
  1037 
  1038     /**
  1039      * <b>Bck2Brwsr</b> emulation can only seek public methods, otherwise it
  1040      * throws a {@code SecurityException}.
  1041      * <p>
  1042      * Returns a {@code Method} object that reflects the specified
  1043      * declared method of the class or interface represented by this
  1044      * {@code Class} object. The {@code name} parameter is a
  1045      * {@code String} that specifies the simple name of the desired
  1046      * method, and the {@code parameterTypes} parameter is an array of
  1047      * {@code Class} objects that identify the method's formal parameter
  1048      * types, in declared order.  If more than one method with the same
  1049      * parameter types is declared in a class, and one of these methods has a
  1050      * return type that is more specific than any of the others, that method is
  1051      * returned; otherwise one of the methods is chosen arbitrarily.  If the
  1052      * name is "&lt;init&gt;"or "&lt;clinit&gt;" a {@code NoSuchMethodException}
  1053      * is raised.
  1054      *
  1055      * @param name the name of the method
  1056      * @param parameterTypes the parameter array
  1057      * @return    the {@code Method} object for the method of this class
  1058      * matching the specified name and parameters
  1059      * @exception NoSuchMethodException if a matching method is not found.
  1060      * @exception NullPointerException if {@code name} is {@code null}
  1061      * @exception  SecurityException
  1062      *             If a security manager, <i>s</i>, is present and any of the
  1063      *             following conditions is met:
  1064      *
  1065      *             <ul>
  1066      *
  1067      *             <li> invocation of
  1068      *             {@link SecurityManager#checkMemberAccess
  1069      *             s.checkMemberAccess(this, Member.DECLARED)} denies
  1070      *             access to the declared method
  1071      *
  1072      *             <li> the caller's class loader is not the same as or an
  1073      *             ancestor of the class loader for the current class and
  1074      *             invocation of {@link SecurityManager#checkPackageAccess
  1075      *             s.checkPackageAccess()} denies access to the package
  1076      *             of this class
  1077      *
  1078      *             </ul>
  1079      *
  1080      * @since JDK1.1
  1081      */
  1082     public Method getDeclaredMethod(String name, Class<?>... parameterTypes)
  1083     throws NoSuchMethodException, SecurityException {
  1084         try {
  1085             return getMethod(name, parameterTypes);
  1086         } catch (NoSuchMethodException ex) {
  1087             throw new SecurityException();
  1088         }
  1089     }
  1090 
  1091     /**
  1092      * Returns a {@code Field} object that reflects the specified declared
  1093      * field of the class or interface represented by this {@code Class}
  1094      * object. The {@code name} parameter is a {@code String} that
  1095      * specifies the simple name of the desired field.  Note that this method
  1096      * will not reflect the {@code length} field of an array class.
  1097      *
  1098      * @param name the name of the field
  1099      * @return the {@code Field} object for the specified field in this
  1100      * class
  1101      * @exception NoSuchFieldException if a field with the specified name is
  1102      *              not found.
  1103      * @exception NullPointerException if {@code name} is {@code null}
  1104      * @exception  SecurityException
  1105      *             If a security manager, <i>s</i>, is present and any of the
  1106      *             following conditions is met:
  1107      *
  1108      *             <ul>
  1109      *
  1110      *             <li> invocation of
  1111      *             {@link SecurityManager#checkMemberAccess
  1112      *             s.checkMemberAccess(this, Member.DECLARED)} denies
  1113      *             access to the declared field
  1114      *
  1115      *             <li> the caller's class loader is not the same as or an
  1116      *             ancestor of the class loader for the current class and
  1117      *             invocation of {@link SecurityManager#checkPackageAccess
  1118      *             s.checkPackageAccess()} denies access to the package
  1119      *             of this class
  1120      *
  1121      *             </ul>
  1122      *
  1123      * @since JDK1.1
  1124      */
  1125     public Field getDeclaredField(String name)
  1126     throws SecurityException {
  1127         throw new SecurityException();
  1128     }
  1129     
  1130     /**
  1131      * Returns an array containing {@code Constructor} objects reflecting
  1132      * all the public constructors of the class represented by this
  1133      * {@code Class} object.  An array of length 0 is returned if the
  1134      * class has no public constructors, or if the class is an array class, or
  1135      * if the class reflects a primitive type or void.
  1136      *
  1137      * Note that while this method returns an array of {@code
  1138      * Constructor<T>} objects (that is an array of constructors from
  1139      * this class), the return type of this method is {@code
  1140      * Constructor<?>[]} and <em>not</em> {@code Constructor<T>[]} as
  1141      * might be expected.  This less informative return type is
  1142      * necessary since after being returned from this method, the
  1143      * array could be modified to hold {@code Constructor} objects for
  1144      * different classes, which would violate the type guarantees of
  1145      * {@code Constructor<T>[]}.
  1146      *
  1147      * @return the array of {@code Constructor} objects representing the
  1148      *  public constructors of this class
  1149      * @exception  SecurityException
  1150      *             If a security manager, <i>s</i>, is present and any of the
  1151      *             following conditions is met:
  1152      *
  1153      *             <ul>
  1154      *
  1155      *             <li> invocation of
  1156      *             {@link SecurityManager#checkMemberAccess
  1157      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
  1158      *             access to the constructors within this class
  1159      *
  1160      *             <li> the caller's class loader is not the same as or an
  1161      *             ancestor of the class loader for the current class and
  1162      *             invocation of {@link SecurityManager#checkPackageAccess
  1163      *             s.checkPackageAccess()} denies access to the package
  1164      *             of this class
  1165      *
  1166      *             </ul>
  1167      *
  1168      * @since JDK1.1
  1169      */
  1170     public Constructor<?>[] getConstructors() throws SecurityException {
  1171         return MethodImpl.findConstructors(this, 0x01);
  1172     }
  1173 
  1174     /**
  1175      * Returns a {@code Constructor} object that reflects the specified
  1176      * public constructor of the class represented by this {@code Class}
  1177      * object. The {@code parameterTypes} parameter is an array of
  1178      * {@code Class} objects that identify the constructor's formal
  1179      * parameter types, in declared order.
  1180      *
  1181      * If this {@code Class} object represents an inner class
  1182      * declared in a non-static context, the formal parameter types
  1183      * include the explicit enclosing instance as the first parameter.
  1184      *
  1185      * <p> The constructor to reflect is the public constructor of the class
  1186      * represented by this {@code Class} object whose formal parameter
  1187      * types match those specified by {@code parameterTypes}.
  1188      *
  1189      * @param parameterTypes the parameter array
  1190      * @return the {@code Constructor} object of the public constructor that
  1191      * matches the specified {@code parameterTypes}
  1192      * @exception NoSuchMethodException if a matching method is not found.
  1193      * @exception  SecurityException
  1194      *             If a security manager, <i>s</i>, is present and any of the
  1195      *             following conditions is met:
  1196      *
  1197      *             <ul>
  1198      *
  1199      *             <li> invocation of
  1200      *             {@link SecurityManager#checkMemberAccess
  1201      *             s.checkMemberAccess(this, Member.PUBLIC)} denies
  1202      *             access to the constructor
  1203      *
  1204      *             <li> the caller's class loader is not the same as or an
  1205      *             ancestor of the class loader for the current class and
  1206      *             invocation of {@link SecurityManager#checkPackageAccess
  1207      *             s.checkPackageAccess()} denies access to the package
  1208      *             of this class
  1209      *
  1210      *             </ul>
  1211      *
  1212      * @since JDK1.1
  1213      */
  1214     public Constructor<T> getConstructor(Class<?>... parameterTypes)
  1215     throws NoSuchMethodException, SecurityException {
  1216         Constructor c = MethodImpl.findConstructor(this, parameterTypes);
  1217         if (c == null) {
  1218             StringBuilder sb = new StringBuilder();
  1219             sb.append(getName()).append('(');
  1220             String sep = "";
  1221             for (int i = 0; i < parameterTypes.length; i++) {
  1222                 sb.append(sep).append(parameterTypes[i].getName());
  1223                 sep = ", ";
  1224             }
  1225             sb.append(')');
  1226             throw new NoSuchMethodException(sb.toString());
  1227         }
  1228         return c;
  1229     }
  1230 
  1231     /**
  1232      * Returns an array of {@code Constructor} objects reflecting all the
  1233      * constructors declared by the class represented by this
  1234      * {@code Class} object. These are public, protected, default
  1235      * (package) access, and private constructors.  The elements in the array
  1236      * returned are not sorted and are not in any particular order.  If the
  1237      * class has a default constructor, it is included in the returned array.
  1238      * This method returns an array of length 0 if this {@code Class}
  1239      * object represents an interface, a primitive type, an array class, or
  1240      * void.
  1241      *
  1242      * <p> See <em>The Java Language Specification</em>, section 8.2.
  1243      *
  1244      * @return    the array of {@code Constructor} objects representing all the
  1245      * declared constructors of this class
  1246      * @exception  SecurityException
  1247      *             If a security manager, <i>s</i>, is present and any of the
  1248      *             following conditions is met:
  1249      *
  1250      *             <ul>
  1251      *
  1252      *             <li> invocation of
  1253      *             {@link SecurityManager#checkMemberAccess
  1254      *             s.checkMemberAccess(this, Member.DECLARED)} denies
  1255      *             access to the declared constructors within this class
  1256      *
  1257      *             <li> the caller's class loader is not the same as or an
  1258      *             ancestor of the class loader for the current class and
  1259      *             invocation of {@link SecurityManager#checkPackageAccess
  1260      *             s.checkPackageAccess()} denies access to the package
  1261      *             of this class
  1262      *
  1263      *             </ul>
  1264      *
  1265      * @since JDK1.1
  1266      */
  1267     public Constructor<?>[] getDeclaredConstructors() throws SecurityException {
  1268         throw new SecurityException();
  1269     }
  1270     /**
  1271      * Returns a {@code Constructor} object that reflects the specified
  1272      * constructor of the class or interface represented by this
  1273      * {@code Class} object.  The {@code parameterTypes} parameter is
  1274      * an array of {@code Class} objects that identify the constructor's
  1275      * formal parameter types, in declared order.
  1276      *
  1277      * If this {@code Class} object represents an inner class
  1278      * declared in a non-static context, the formal parameter types
  1279      * include the explicit enclosing instance as the first parameter.
  1280      *
  1281      * @param parameterTypes the parameter array
  1282      * @return    The {@code Constructor} object for the constructor with the
  1283      * specified parameter list
  1284      * @exception NoSuchMethodException if a matching method is not found.
  1285      * @exception  SecurityException
  1286      *             If a security manager, <i>s</i>, is present and any of the
  1287      *             following conditions is met:
  1288      *
  1289      *             <ul>
  1290      *
  1291      *             <li> invocation of
  1292      *             {@link SecurityManager#checkMemberAccess
  1293      *             s.checkMemberAccess(this, Member.DECLARED)} denies
  1294      *             access to the declared constructor
  1295      *
  1296      *             <li> the caller's class loader is not the same as or an
  1297      *             ancestor of the class loader for the current class and
  1298      *             invocation of {@link SecurityManager#checkPackageAccess
  1299      *             s.checkPackageAccess()} denies access to the package
  1300      *             of this class
  1301      *
  1302      *             </ul>
  1303      *
  1304      * @since JDK1.1
  1305      */
  1306     public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes)
  1307     throws NoSuchMethodException, SecurityException {
  1308         return getConstructor(parameterTypes);
  1309     }
  1310     
  1311     
  1312     /**
  1313      * Character.isDigit answers {@code true} to some non-ascii
  1314      * digits.  This one does not.
  1315      */
  1316     private static boolean isAsciiDigit(char c) {
  1317         return '0' <= c && c <= '9';
  1318     }
  1319 
  1320     /**
  1321      * Returns the canonical name of the underlying class as
  1322      * defined by the Java Language Specification.  Returns null if
  1323      * the underlying class does not have a canonical name (i.e., if
  1324      * it is a local or anonymous class or an array whose component
  1325      * type does not have a canonical name).
  1326      * @return the canonical name of the underlying class if it exists, and
  1327      * {@code null} otherwise.
  1328      * @since 1.5
  1329      */
  1330     public String getCanonicalName() {
  1331         if (isArray()) {
  1332             String canonicalName = getComponentType().getCanonicalName();
  1333             if (canonicalName != null)
  1334                 return canonicalName + "[]";
  1335             else
  1336                 return null;
  1337         }
  1338 //        if (isLocalOrAnonymousClass())
  1339 //            return null;
  1340 //        Class<?> enclosingClass = getEnclosingClass();
  1341         Class<?> enclosingClass = null;
  1342         if (enclosingClass == null) { // top level class
  1343             return getName();
  1344         } else {
  1345             String enclosingName = enclosingClass.getCanonicalName();
  1346             if (enclosingName == null)
  1347                 return null;
  1348             return enclosingName + "." + getSimpleName();
  1349         }
  1350     }
  1351 
  1352     /**
  1353      * Finds a resource with a given name.  The rules for searching resources
  1354      * associated with a given class are implemented by the defining
  1355      * {@linkplain ClassLoader class loader} of the class.  This method
  1356      * delegates to this object's class loader.  If this object was loaded by
  1357      * the bootstrap class loader, the method delegates to {@link
  1358      * ClassLoader#getSystemResourceAsStream}.
  1359      *
  1360      * <p> Before delegation, an absolute resource name is constructed from the
  1361      * given resource name using this algorithm:
  1362      *
  1363      * <ul>
  1364      *
  1365      * <li> If the {@code name} begins with a {@code '/'}
  1366      * (<tt>'&#92;u002f'</tt>), then the absolute name of the resource is the
  1367      * portion of the {@code name} following the {@code '/'}.
  1368      *
  1369      * <li> Otherwise, the absolute name is of the following form:
  1370      *
  1371      * <blockquote>
  1372      *   {@code modified_package_name/name}
  1373      * </blockquote>
  1374      *
  1375      * <p> Where the {@code modified_package_name} is the package name of this
  1376      * object with {@code '/'} substituted for {@code '.'}
  1377      * (<tt>'&#92;u002e'</tt>).
  1378      *
  1379      * </ul>
  1380      *
  1381      * @param  name name of the desired resource
  1382      * @return      A {@link java.io.InputStream} object or {@code null} if
  1383      *              no resource with this name is found
  1384      * @throws  NullPointerException If {@code name} is {@code null}
  1385      * @since  JDK1.1
  1386      */
  1387      public InputStream getResourceAsStream(String name) {
  1388         name = resolveName(name);
  1389         byte[] arr = ClassLoader.getResourceAsStream0(name, 0);
  1390         return arr == null ? null : new ByteArrayInputStream(arr);
  1391      }
  1392     
  1393     /**
  1394      * Finds a resource with a given name.  The rules for searching resources
  1395      * associated with a given class are implemented by the defining
  1396      * {@linkplain ClassLoader class loader} of the class.  This method
  1397      * delegates to this object's class loader.  If this object was loaded by
  1398      * the bootstrap class loader, the method delegates to {@link
  1399      * ClassLoader#getSystemResource}.
  1400      *
  1401      * <p> Before delegation, an absolute resource name is constructed from the
  1402      * given resource name using this algorithm:
  1403      *
  1404      * <ul>
  1405      *
  1406      * <li> If the {@code name} begins with a {@code '/'}
  1407      * (<tt>'&#92;u002f'</tt>), then the absolute name of the resource is the
  1408      * portion of the {@code name} following the {@code '/'}.
  1409      *
  1410      * <li> Otherwise, the absolute name is of the following form:
  1411      *
  1412      * <blockquote>
  1413      *   {@code modified_package_name/name}
  1414      * </blockquote>
  1415      *
  1416      * <p> Where the {@code modified_package_name} is the package name of this
  1417      * object with {@code '/'} substituted for {@code '.'}
  1418      * (<tt>'&#92;u002e'</tt>).
  1419      *
  1420      * </ul>
  1421      *
  1422      * @param  name name of the desired resource
  1423      * @return      A  {@link java.net.URL} object or {@code null} if no
  1424      *              resource with this name is found
  1425      * @since  JDK1.1
  1426      */
  1427     public java.net.URL getResource(String name) {
  1428         return newResourceURL(name, getResourceAsStream(name));
  1429     }
  1430 
  1431     static URL newResourceURL(String name, InputStream is) {
  1432         return is == null ? null : newResourceURL0(URL.class, "res:/" + name, is);
  1433     }
  1434     
  1435     @JavaScriptBody(args = { "url", "spec", "is" }, body = 
  1436         "var u = url.cnstr(true);\n"
  1437       + "u.constructor.cons__VLjava_lang_String_2Ljava_io_InputStream_2.call(u, spec, is);\n"
  1438       + "return u;"
  1439     )
  1440     private static native URL newResourceURL0(Class<URL> url, String spec, InputStream is);
  1441 
  1442    /**
  1443      * Add a package name prefix if the name is not absolute Remove leading "/"
  1444      * if name is absolute
  1445      */
  1446     private String resolveName(String name) {
  1447         if (name == null) {
  1448             return name;
  1449         }
  1450         if (!name.startsWith("/")) {
  1451             Class<?> c = this;
  1452             while (c.isArray()) {
  1453                 c = c.getComponentType();
  1454             }
  1455             String baseName = c.getName();
  1456             int index = baseName.lastIndexOf('.');
  1457             if (index != -1) {
  1458                 name = baseName.substring(0, index).replace('.', '/')
  1459                     +"/"+name;
  1460             }
  1461         } else {
  1462             name = name.substring(1);
  1463         }
  1464         return name;
  1465     }
  1466     
  1467     /**
  1468      * Returns the class loader for the class.  Some implementations may use
  1469      * null to represent the bootstrap class loader. This method will return
  1470      * null in such implementations if this class was loaded by the bootstrap
  1471      * class loader.
  1472      *
  1473      * <p> If a security manager is present, and the caller's class loader is
  1474      * not null and the caller's class loader is not the same as or an ancestor of
  1475      * the class loader for the class whose class loader is requested, then
  1476      * this method calls the security manager's {@code checkPermission}
  1477      * method with a {@code RuntimePermission("getClassLoader")}
  1478      * permission to ensure it's ok to access the class loader for the class.
  1479      *
  1480      * <p>If this object
  1481      * represents a primitive type or void, null is returned.
  1482      *
  1483      * @return  the class loader that loaded the class or interface
  1484      *          represented by this object.
  1485      * @throws SecurityException
  1486      *    if a security manager exists and its
  1487      *    {@code checkPermission} method denies
  1488      *    access to the class loader for the class.
  1489      * @see java.lang.ClassLoader
  1490      * @see SecurityManager#checkPermission
  1491      * @see java.lang.RuntimePermission
  1492      */
  1493     public ClassLoader getClassLoader() {
  1494         return ClassLoader.getSystemClassLoader();
  1495     }
  1496 
  1497     /**
  1498      * Determines the interfaces implemented by the class or interface
  1499      * represented by this object.
  1500      *
  1501      * <p> If this object represents a class, the return value is an array
  1502      * containing objects representing all interfaces implemented by the
  1503      * class. The order of the interface objects in the array corresponds to
  1504      * the order of the interface names in the {@code implements} clause
  1505      * of the declaration of the class represented by this object. For
  1506      * example, given the declaration:
  1507      * <blockquote>
  1508      * {@code class Shimmer implements FloorWax, DessertTopping { ... }}
  1509      * </blockquote>
  1510      * suppose the value of {@code s} is an instance of
  1511      * {@code Shimmer}; the value of the expression:
  1512      * <blockquote>
  1513      * {@code s.getClass().getInterfaces()[0]}
  1514      * </blockquote>
  1515      * is the {@code Class} object that represents interface
  1516      * {@code FloorWax}; and the value of:
  1517      * <blockquote>
  1518      * {@code s.getClass().getInterfaces()[1]}
  1519      * </blockquote>
  1520      * is the {@code Class} object that represents interface
  1521      * {@code DessertTopping}.
  1522      *
  1523      * <p> If this object represents an interface, the array contains objects
  1524      * representing all interfaces extended by the interface. The order of the
  1525      * interface objects in the array corresponds to the order of the interface
  1526      * names in the {@code extends} clause of the declaration of the
  1527      * interface represented by this object.
  1528      *
  1529      * <p> If this object represents a class or interface that implements no
  1530      * interfaces, the method returns an array of length 0.
  1531      *
  1532      * <p> If this object represents a primitive type or void, the method
  1533      * returns an array of length 0.
  1534      *
  1535      * @return an array of interfaces implemented by this class.
  1536      */
  1537     public native Class<?>[] getInterfaces();
  1538     
  1539     /**
  1540      * Returns the {@code Class} representing the component type of an
  1541      * array.  If this class does not represent an array class this method
  1542      * returns null.
  1543      *
  1544      * @return the {@code Class} representing the component type of this
  1545      * class if this class is an array
  1546      * @see     java.lang.reflect.Array
  1547      * @since JDK1.1
  1548      */
  1549     public Class<?> getComponentType() {
  1550         if (isArray()) {
  1551             try {
  1552                 Class<?> c = getComponentTypeByFnc();
  1553                 return c != null ? c : getComponentType0();
  1554             } catch (ClassNotFoundException cnfe) {
  1555                 throw new IllegalStateException(cnfe);
  1556             }
  1557         }
  1558         return null;
  1559     }
  1560     
  1561     @JavaScriptBody(args = {  }, body = 
  1562         "if (this.fnc) {\n"
  1563       + "  var c = this.fnc(false).constructor.$class;\n"
  1564 //      + "  java.lang.System.out.println('will call: ' + (!!this.fnc) + ' res: ' + c.jvmName);\n"
  1565       + "  if (c) return c;\n"
  1566       + "}\n"
  1567       + "return null;"
  1568     )
  1569     private native Class<?> getComponentTypeByFnc();
  1570 
  1571     private Class<?> getComponentType0() throws ClassNotFoundException {
  1572         String n = getName().substring(1);
  1573         switch (n.charAt(0)) {
  1574             case 'L': 
  1575                 n = n.substring(1, n.length() - 1);
  1576                 return Class.forName(n);
  1577             case 'I':
  1578                 return Integer.TYPE;
  1579             case 'J':
  1580                 return Long.TYPE;
  1581             case 'D':
  1582                 return Double.TYPE;
  1583             case 'F':
  1584                 return Float.TYPE;
  1585             case 'B':
  1586                 return Byte.TYPE;
  1587             case 'Z':
  1588                 return Boolean.TYPE;
  1589             case 'S':
  1590                 return Short.TYPE;
  1591             case 'V':
  1592                 return Void.TYPE;
  1593             case 'C':
  1594                 return Character.TYPE;
  1595             case '[':
  1596                 return defineArray(n, null);
  1597             default:
  1598                 throw new ClassNotFoundException("Unknown component type of " + getName());
  1599         }
  1600     }
  1601     
  1602     @JavaScriptBody(args = { "sig", "fnc" }, body = 
  1603         "if (!sig) sig = '[Ljava/lang/Object;';\n" +
  1604         "var c = Array[sig];\n" +
  1605         "if (!c) {\n" +
  1606         "  c = vm.java_lang_Class(true);\n" +
  1607         "  c.jvmName = sig;\n" +
  1608         "  c.superclass = vm.java_lang_Object(false).$class;\n" +
  1609         "  c.array = true;\n" +
  1610         "  Array[sig] = c;\n" +
  1611         "}\n" +
  1612         "if (!c.fnc) c.fnc = fnc;\n" +
  1613         "return c;"
  1614     )
  1615     private static native Class<?> defineArray(String sig, Object fnc);
  1616     
  1617     /**
  1618      * Returns true if and only if this class was declared as an enum in the
  1619      * source code.
  1620      *
  1621      * @return true if and only if this class was declared as an enum in the
  1622      *     source code
  1623      * @since 1.5
  1624      */
  1625     public boolean isEnum() {
  1626         // An enum must both directly extend java.lang.Enum and have
  1627         // the ENUM bit set; classes for specialized enum constants
  1628         // don't do the former.
  1629         return (this.getModifiers() & ENUM) != 0 &&
  1630         this.getSuperclass() == java.lang.Enum.class;
  1631     }
  1632 
  1633     /**
  1634      * Casts an object to the class or interface represented
  1635      * by this {@code Class} object.
  1636      *
  1637      * @param obj the object to be cast
  1638      * @return the object after casting, or null if obj is null
  1639      *
  1640      * @throws ClassCastException if the object is not
  1641      * null and is not assignable to the type T.
  1642      *
  1643      * @since 1.5
  1644      */
  1645     public T cast(Object obj) {
  1646         if (obj != null && !isInstance(obj))
  1647             throw new ClassCastException(cannotCastMsg(obj));
  1648         return (T) obj;
  1649     }
  1650 
  1651     private String cannotCastMsg(Object obj) {
  1652         return "Cannot cast " + obj.getClass().getName() + " to " + getName();
  1653     }
  1654 
  1655     /**
  1656      * Casts this {@code Class} object to represent a subclass of the class
  1657      * represented by the specified class object.  Checks that that the cast
  1658      * is valid, and throws a {@code ClassCastException} if it is not.  If
  1659      * this method succeeds, it always returns a reference to this class object.
  1660      *
  1661      * <p>This method is useful when a client needs to "narrow" the type of
  1662      * a {@code Class} object to pass it to an API that restricts the
  1663      * {@code Class} objects that it is willing to accept.  A cast would
  1664      * generate a compile-time warning, as the correctness of the cast
  1665      * could not be checked at runtime (because generic types are implemented
  1666      * by erasure).
  1667      *
  1668      * @return this {@code Class} object, cast to represent a subclass of
  1669      *    the specified class object.
  1670      * @throws ClassCastException if this {@code Class} object does not
  1671      *    represent a subclass of the specified class (here "subclass" includes
  1672      *    the class itself).
  1673      * @since 1.5
  1674      */
  1675     public <U> Class<? extends U> asSubclass(Class<U> clazz) {
  1676         if (clazz.isAssignableFrom(this))
  1677             return (Class<? extends U>) this;
  1678         else
  1679             throw new ClassCastException(this.toString());
  1680     }
  1681 
  1682     @JavaScriptBody(args = { "ac" }, 
  1683         body = 
  1684           "if (this.anno) {\n"
  1685         + "  var r = this.anno['L' + ac.jvmName + ';'];\n"
  1686         + "  if (typeof r === 'undefined') r = null;\n"
  1687         + "  return r;\n"
  1688         + "} else return null;\n"
  1689     )
  1690     private Object getAnnotationData(Class<?> annotationClass) {
  1691         throw new UnsupportedOperationException();
  1692     }
  1693     /**
  1694      * @throws NullPointerException {@inheritDoc}
  1695      * @since 1.5
  1696      */
  1697     public <A extends Annotation> A getAnnotation(Class<A> annotationClass) {
  1698         Object data = getAnnotationData(annotationClass);
  1699         return data == null ? null : AnnotationImpl.create(annotationClass, data);
  1700     }
  1701 
  1702     /**
  1703      * @throws NullPointerException {@inheritDoc}
  1704      * @since 1.5
  1705      */
  1706     @JavaScriptBody(args = { "ac" }, 
  1707         body = "if (this.anno && this.anno['L' + ac.jvmName + ';']) { return true; }"
  1708         + "else return false;"
  1709     )
  1710     public boolean isAnnotationPresent(
  1711         Class<? extends Annotation> annotationClass) {
  1712         if (annotationClass == null)
  1713             throw new NullPointerException();
  1714 
  1715         return getAnnotation(annotationClass) != null;
  1716     }
  1717 
  1718     @JavaScriptBody(args = {}, body = "return this.anno;")
  1719     private Object getAnnotationData() {
  1720         throw new UnsupportedOperationException();
  1721     }
  1722 
  1723     /**
  1724      * @since 1.5
  1725      */
  1726     public Annotation[] getAnnotations() {
  1727         Object data = getAnnotationData();
  1728         return data == null ? new Annotation[0] : AnnotationImpl.create(data);
  1729     }
  1730 
  1731     /**
  1732      * @since 1.5
  1733      */
  1734     public Annotation[] getDeclaredAnnotations()  {
  1735         throw new UnsupportedOperationException();
  1736     }
  1737 
  1738     @JavaScriptBody(args = "type", body = ""
  1739         + "var c = vm.java_lang_Class(true);"
  1740         + "c.jvmName = type;"
  1741         + "c.primitive = true;"
  1742         + "return c;"
  1743     )
  1744     native static Class getPrimitiveClass(String type);
  1745 
  1746     @JavaScriptBody(args = {}, body = 
  1747         "return this['desiredAssertionStatus'] ? this['desiredAssertionStatus'] : false;"
  1748     )
  1749     public native boolean desiredAssertionStatus();
  1750 
  1751     public boolean equals(Object obj) {
  1752         if (isPrimitive() && obj instanceof Class) {
  1753             Class c = ((Class)obj);
  1754             return c.isPrimitive() && getName().equals(c.getName());
  1755         }
  1756         return super.equals(obj);
  1757     }
  1758     
  1759     static void registerNatives() {
  1760         boolean assertsOn = false;
  1761         //       assert assertsOn = true;
  1762         if (assertsOn) {
  1763             try {
  1764                 Array.get(null, 0);
  1765             } catch (Throwable ex) {
  1766                 // ignore
  1767             }
  1768         }
  1769     }
  1770 
  1771     @JavaScriptBody(args = {}, body = "var p = vm.java_lang_Object(false);"
  1772             + "p.toString = function() { return this.toString__Ljava_lang_String_2(); };"
  1773     )
  1774     static native void registerToString();
  1775     
  1776     @JavaScriptBody(args = {"self"}, body
  1777             = "var c = self.constructor.$class;\n"
  1778             + "return c ? c : null;\n"
  1779     )
  1780     static native Class<?> classFor(Object self);
  1781     
  1782     @Exported
  1783     @JavaScriptBody(args = { "self" }, body
  1784             = "if (self['$hashCode']) return self['$hashCode'];\n"
  1785             + "var h = self['computeHashCode__I'] ? self['computeHashCode__I']() : Math.random() * Math.pow(2, 31);\n"
  1786             + "return self['$hashCode'] = h & h;"
  1787     )
  1788     static native int defaultHashCode(Object self);
  1789 
  1790     @JavaScriptBody(args = "self", body
  1791             = "\nif (!self['$instOf_java_lang_Cloneable']) {"
  1792             + "\n  return null;"
  1793             + "\n} else {"
  1794             + "\n  var clone = self.constructor(true);"
  1795             + "\n  var props = Object.getOwnPropertyNames(self);"
  1796             + "\n  for (var i = 0; i < props.length; i++) {"
  1797             + "\n    var p = props[i];"
  1798             + "\n    clone[p] = self[p];"
  1799             + "\n  };"
  1800             + "\n  return clone;"
  1801             + "\n}"
  1802     )
  1803     static native Object clone(Object self) throws CloneNotSupportedException;
  1804 
  1805     @JavaScriptOnly(name = "toJS", value = "function(v) {\n"
  1806         + "  if (v === null) return null;\n"
  1807         + "  if (Object.prototype.toString.call(v) === '[object Array]') {\n"
  1808         + "    return vm.org_apidesign_bck2brwsr_emul_lang_System(false).convArray__Ljava_lang_Object_2Ljava_lang_Object_2(v);\n"
  1809         + "  }\n"
  1810         + "  return v.valueOf();\n"
  1811         + "}\n"
  1812     )
  1813     static native int toJS();
  1814 
  1815     @Exported
  1816     @JavaScriptOnly(name = "activate__Ljava_io_Closeable_2Lorg_apidesign_html_boot_spi_Fn$Presenter_2", value = "function() {\n"
  1817         + "  return vm.org_apidesign_bck2brwsr_emul_lang_System(false).activate__Ljava_io_Closeable_2();"
  1818         + "}\n"
  1819     )
  1820     static native int activate();
  1821     
  1822     private static Object bck2BrwsrCnvrt(Object o) {
  1823         if (o instanceof Throwable) {
  1824             return o;
  1825         }
  1826         final String msg = msg(o);
  1827         if (msg == null || msg.startsWith("TypeError")) {
  1828             return new NullPointerException(msg);
  1829         }
  1830         return new Throwable(msg);
  1831     }
  1832 
  1833     @JavaScriptBody(args = {"o"}, body = "return o ? o.toString() : null;")
  1834     private static native String msg(Object o);
  1835 
  1836     @Exported
  1837     @JavaScriptOnly(name = "bck2BrwsrThrwrbl", value = "c.bck2BrwsrCnvrt__Ljava_lang_Object_2Ljava_lang_Object_2")
  1838     private static void bck2BrwsrCnvrtVM() {
  1839     }
  1840     
  1841 }