1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 only, as
8  * published by the Free Software Foundation.  Oracle designates this
9  * particular file as subject to the "Classpath" exception as provided
10  * by Oracle in the LICENSE file that accompanied this code.
11  *
12  * This code is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * version 2 for more details (a copy is included in the LICENSE file that
16  * accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License version
19  * 2 along with this work; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23  * or visit www.oracle.com if you need additional information or have any
24  * questions.
25  */
26 
27 package java.lang;
28 
29 import android.compat.annotation.UnsupportedAppUsage;
30 
31 @SuppressWarnings({"unchecked", "deprecation", "all"})
32 public final class Class<T>
33         implements java.io.Serializable,
34                 java.lang.reflect.GenericDeclaration,
35                 java.lang.reflect.Type,
36                 java.lang.reflect.AnnotatedElement {
37 
38     @UnsupportedAppUsage
Class()39     private Class() {
40         throw new RuntimeException("Stub!");
41     }
42 
toString()43     public java.lang.String toString() {
44         throw new RuntimeException("Stub!");
45     }
46 
toGenericString()47     public java.lang.String toGenericString() {
48         throw new RuntimeException("Stub!");
49     }
50 
forName(java.lang.String className)51     public static java.lang.Class<?> forName(java.lang.String className)
52             throws java.lang.ClassNotFoundException {
53         throw new RuntimeException("Stub!");
54     }
55 
forName( java.lang.String name, boolean initialize, java.lang.ClassLoader loader)56     public static java.lang.Class<?> forName(
57             java.lang.String name, boolean initialize, java.lang.ClassLoader loader)
58             throws java.lang.ClassNotFoundException {
59         throw new RuntimeException("Stub!");
60     }
61 
classForName( java.lang.String className, boolean shouldInitialize, java.lang.ClassLoader classLoader)62     static native java.lang.Class<?> classForName(
63             java.lang.String className, boolean shouldInitialize, java.lang.ClassLoader classLoader)
64             throws java.lang.ClassNotFoundException;
65 
newInstance()66     public native T newInstance()
67             throws java.lang.IllegalAccessException, java.lang.InstantiationException;
68 
isInstance(java.lang.Object obj)69     public boolean isInstance(java.lang.Object obj) {
70         throw new RuntimeException("Stub!");
71     }
72 
isAssignableFrom(java.lang.Class<?> cls)73     public boolean isAssignableFrom(java.lang.Class<?> cls) {
74         throw new RuntimeException("Stub!");
75     }
76 
isInterface()77     public boolean isInterface() {
78         throw new RuntimeException("Stub!");
79     }
80 
isArray()81     public boolean isArray() {
82         throw new RuntimeException("Stub!");
83     }
84 
isPrimitive()85     public boolean isPrimitive() {
86         throw new RuntimeException("Stub!");
87     }
88 
isFinalizable()89     public boolean isFinalizable() {
90         throw new RuntimeException("Stub!");
91     }
92 
isAnnotation()93     public boolean isAnnotation() {
94         throw new RuntimeException("Stub!");
95     }
96 
isSynthetic()97     public boolean isSynthetic() {
98         throw new RuntimeException("Stub!");
99     }
100 
getName()101     public java.lang.String getName() {
102         throw new RuntimeException("Stub!");
103     }
104 
getNameNative()105     private native java.lang.String getNameNative();
106 
getClassLoader()107     public java.lang.ClassLoader getClassLoader() {
108         throw new RuntimeException("Stub!");
109     }
110 
getTypeParameters()111     public synchronized java.lang.reflect.TypeVariable<java.lang.Class<T>>[] getTypeParameters() {
112         throw new RuntimeException("Stub!");
113     }
114 
getSuperclass()115     public java.lang.Class<? super T> getSuperclass() {
116         throw new RuntimeException("Stub!");
117     }
118 
getGenericSuperclass()119     public java.lang.reflect.Type getGenericSuperclass() {
120         throw new RuntimeException("Stub!");
121     }
122 
getPackage()123     public java.lang.Package getPackage() {
124         throw new RuntimeException("Stub!");
125     }
126 
getPackageName$()127     public java.lang.String getPackageName$() {
128         throw new RuntimeException("Stub!");
129     }
130 
getInterfaces()131     public java.lang.Class<?>[] getInterfaces() {
132         throw new RuntimeException("Stub!");
133     }
134 
getInterfacesInternal()135     private native java.lang.Class<?>[] getInterfacesInternal();
136 
getGenericInterfaces()137     public java.lang.reflect.Type[] getGenericInterfaces() {
138         throw new RuntimeException("Stub!");
139     }
140 
getComponentType()141     public java.lang.Class<?> getComponentType() {
142         throw new RuntimeException("Stub!");
143     }
144 
getModifiers()145     public int getModifiers() {
146         throw new RuntimeException("Stub!");
147     }
148 
getSigners()149     public java.lang.Object[] getSigners() {
150         throw new RuntimeException("Stub!");
151     }
152 
getEnclosingMethodNative()153     private native java.lang.reflect.Method getEnclosingMethodNative();
154 
getEnclosingMethod()155     public java.lang.reflect.Method getEnclosingMethod() {
156         throw new RuntimeException("Stub!");
157     }
158 
getEnclosingConstructor()159     public java.lang.reflect.Constructor<?> getEnclosingConstructor() {
160         throw new RuntimeException("Stub!");
161     }
162 
getEnclosingConstructorNative()163     private native java.lang.reflect.Constructor<?> getEnclosingConstructorNative();
164 
classNameImpliesTopLevel()165     private boolean classNameImpliesTopLevel() {
166         throw new RuntimeException("Stub!");
167     }
168 
getDeclaringClass()169     public native java.lang.Class<?> getDeclaringClass();
170 
getEnclosingClass()171     public native java.lang.Class<?> getEnclosingClass();
172 
getSimpleName()173     public java.lang.String getSimpleName() {
174         throw new RuntimeException("Stub!");
175     }
176 
getTypeName()177     public java.lang.String getTypeName() {
178         throw new RuntimeException("Stub!");
179     }
180 
getCanonicalName()181     public java.lang.String getCanonicalName() {
182         throw new RuntimeException("Stub!");
183     }
184 
isAnonymousClass()185     public native boolean isAnonymousClass();
186 
isLocalClass()187     public boolean isLocalClass() {
188         throw new RuntimeException("Stub!");
189     }
190 
isMemberClass()191     public boolean isMemberClass() {
192         throw new RuntimeException("Stub!");
193     }
194 
isLocalOrAnonymousClass()195     private boolean isLocalOrAnonymousClass() {
196         throw new RuntimeException("Stub!");
197     }
198 
getClasses()199     public java.lang.Class<?>[] getClasses() {
200         throw new RuntimeException("Stub!");
201     }
202 
getFields()203     public java.lang.reflect.Field[] getFields() throws java.lang.SecurityException {
204         throw new RuntimeException("Stub!");
205     }
206 
getPublicFieldsRecursive(java.util.List<java.lang.reflect.Field> result)207     private void getPublicFieldsRecursive(java.util.List<java.lang.reflect.Field> result) {
208         throw new RuntimeException("Stub!");
209     }
210 
getMethods()211     public java.lang.reflect.Method[] getMethods() throws java.lang.SecurityException {
212         throw new RuntimeException("Stub!");
213     }
214 
getPublicMethodsInternal(java.util.List<java.lang.reflect.Method> result)215     private void getPublicMethodsInternal(java.util.List<java.lang.reflect.Method> result) {
216         throw new RuntimeException("Stub!");
217     }
218 
getConstructors()219     public java.lang.reflect.Constructor<?>[] getConstructors() throws java.lang.SecurityException {
220         throw new RuntimeException("Stub!");
221     }
222 
getField(java.lang.String name)223     public java.lang.reflect.Field getField(java.lang.String name)
224             throws java.lang.NoSuchFieldException {
225         throw new RuntimeException("Stub!");
226     }
227 
getPublicFieldRecursive(java.lang.String name)228     private native java.lang.reflect.Field getPublicFieldRecursive(java.lang.String name);
229 
getMethod( java.lang.String name, java.lang.Class<?>... parameterTypes)230     public java.lang.reflect.Method getMethod(
231             java.lang.String name, java.lang.Class<?>... parameterTypes)
232             throws java.lang.NoSuchMethodException, java.lang.SecurityException {
233         throw new RuntimeException("Stub!");
234     }
235 
getConstructor(java.lang.Class<?>.... parameterTypes)236     public java.lang.reflect.Constructor<T> getConstructor(java.lang.Class<?>... parameterTypes)
237             throws java.lang.NoSuchMethodException, java.lang.SecurityException {
238         throw new RuntimeException("Stub!");
239     }
240 
getDeclaredClasses()241     public native java.lang.Class<?>[] getDeclaredClasses();
242 
getDeclaredFields()243     public native java.lang.reflect.Field[] getDeclaredFields();
244 
getDeclaredFieldsUnchecked(boolean publicOnly)245     public native java.lang.reflect.Field[] getDeclaredFieldsUnchecked(boolean publicOnly);
246 
getDeclaredMethods()247     public java.lang.reflect.Method[] getDeclaredMethods() throws java.lang.SecurityException {
248         throw new RuntimeException("Stub!");
249     }
250 
251     @UnsupportedAppUsage
getDeclaredMethodsUnchecked(boolean publicOnly)252     public native java.lang.reflect.Method[] getDeclaredMethodsUnchecked(boolean publicOnly);
253 
getDeclaredConstructors()254     public java.lang.reflect.Constructor<?>[] getDeclaredConstructors()
255             throws java.lang.SecurityException {
256         throw new RuntimeException("Stub!");
257     }
258 
getDeclaredConstructorsInternal( boolean publicOnly)259     private native java.lang.reflect.Constructor<?>[] getDeclaredConstructorsInternal(
260             boolean publicOnly);
261 
getDeclaredField(java.lang.String name)262     public native java.lang.reflect.Field getDeclaredField(java.lang.String name)
263             throws java.lang.NoSuchFieldException;
264 
getPublicDeclaredFields()265     private native java.lang.reflect.Field[] getPublicDeclaredFields();
266 
getDeclaredMethod( java.lang.String name, java.lang.Class<?>... parameterTypes)267     public java.lang.reflect.Method getDeclaredMethod(
268             java.lang.String name, java.lang.Class<?>... parameterTypes)
269             throws java.lang.NoSuchMethodException, java.lang.SecurityException {
270         throw new RuntimeException("Stub!");
271     }
272 
273     @UnsupportedAppUsage
getMethod( java.lang.String name, java.lang.Class<?>[] parameterTypes, boolean recursivePublicMethods)274     private java.lang.reflect.Method getMethod(
275             java.lang.String name,
276             java.lang.Class<?>[] parameterTypes,
277             boolean recursivePublicMethods)
278             throws java.lang.NoSuchMethodException {
279         throw new RuntimeException("Stub!");
280     }
281 
getPublicMethodRecursive( java.lang.String name, java.lang.Class<?>[] parameterTypes)282     private java.lang.reflect.Method getPublicMethodRecursive(
283             java.lang.String name, java.lang.Class<?>[] parameterTypes) {
284         throw new RuntimeException("Stub!");
285     }
286 
getInstanceMethod( java.lang.String name, java.lang.Class<?>[] parameterTypes)287     public java.lang.reflect.Method getInstanceMethod(
288             java.lang.String name, java.lang.Class<?>[] parameterTypes)
289             throws java.lang.IllegalAccessException, java.lang.NoSuchMethodException {
290         throw new RuntimeException("Stub!");
291     }
292 
findInterfaceMethod( java.lang.String name, java.lang.Class<?>[] parameterTypes)293     private java.lang.reflect.Method findInterfaceMethod(
294             java.lang.String name, java.lang.Class<?>[] parameterTypes) {
295         throw new RuntimeException("Stub!");
296     }
297 
getDeclaredConstructor( java.lang.Class<?>.... parameterTypes)298     public java.lang.reflect.Constructor<T> getDeclaredConstructor(
299             java.lang.Class<?>... parameterTypes)
300             throws java.lang.NoSuchMethodException, java.lang.SecurityException {
301         throw new RuntimeException("Stub!");
302     }
303 
getResourceAsStream(java.lang.String name)304     public java.io.InputStream getResourceAsStream(java.lang.String name) {
305         throw new RuntimeException("Stub!");
306     }
307 
getResource(java.lang.String name)308     public java.net.URL getResource(java.lang.String name) {
309         throw new RuntimeException("Stub!");
310     }
311 
getProtectionDomain()312     public java.security.ProtectionDomain getProtectionDomain() {
313         throw new RuntimeException("Stub!");
314     }
315 
getPrimitiveClass(java.lang.String name)316     static native java.lang.Class<?> getPrimitiveClass(java.lang.String name);
317 
resolveName(java.lang.String name)318     private java.lang.String resolveName(java.lang.String name) {
319         throw new RuntimeException("Stub!");
320     }
321 
getConstructor0( java.lang.Class<?>[] parameterTypes, int which)322     private java.lang.reflect.Constructor<T> getConstructor0(
323             java.lang.Class<?>[] parameterTypes, int which) throws java.lang.NoSuchMethodException {
324         throw new RuntimeException("Stub!");
325     }
326 
getDeclaredConstructorInternal( java.lang.Class<?>[] args)327     private native java.lang.reflect.Constructor<T> getDeclaredConstructorInternal(
328             java.lang.Class<?>[] args);
329 
desiredAssertionStatus()330     public boolean desiredAssertionStatus() {
331         throw new RuntimeException("Stub!");
332     }
333 
getInnerClassName()334     private native java.lang.String getInnerClassName();
335 
getInnerClassFlags(int defaultValue)336     private native int getInnerClassFlags(int defaultValue);
337 
isEnum()338     public boolean isEnum() {
339         throw new RuntimeException("Stub!");
340     }
341 
getEnumConstants()342     public T[] getEnumConstants() {
343         throw new RuntimeException("Stub!");
344     }
345 
getEnumConstantsShared()346     public T[] getEnumConstantsShared() {
347         throw new RuntimeException("Stub!");
348     }
349 
cast(java.lang.Object obj)350     public T cast(java.lang.Object obj) {
351         throw new RuntimeException("Stub!");
352     }
353 
cannotCastMsg(java.lang.Object obj)354     private java.lang.String cannotCastMsg(java.lang.Object obj) {
355         throw new RuntimeException("Stub!");
356     }
357 
asSubclass(java.lang.Class<U> clazz)358     public <U> java.lang.Class<? extends U> asSubclass(java.lang.Class<U> clazz) {
359         throw new RuntimeException("Stub!");
360     }
361 
getAnnotation( java.lang.Class<A> annotationClass)362     public <A extends java.lang.annotation.Annotation> A getAnnotation(
363             java.lang.Class<A> annotationClass) {
364         throw new RuntimeException("Stub!");
365     }
366 
isAnnotationPresent( java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)367     public boolean isAnnotationPresent(
368             java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) {
369         throw new RuntimeException("Stub!");
370     }
371 
getAnnotationsByType( java.lang.Class<A> annotationClass)372     public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(
373             java.lang.Class<A> annotationClass) {
374         throw new RuntimeException("Stub!");
375     }
376 
getAnnotations()377     public java.lang.annotation.Annotation[] getAnnotations() {
378         throw new RuntimeException("Stub!");
379     }
380 
getDeclaredAnnotation( java.lang.Class<A> annotationClass)381     public native <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(
382             java.lang.Class<A> annotationClass);
383 
getDeclaredAnnotations()384     public native java.lang.annotation.Annotation[] getDeclaredAnnotations();
385 
isDeclaredAnnotationPresent( java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)386     private native boolean isDeclaredAnnotationPresent(
387             java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass);
388 
getSignatureAttribute()389     private java.lang.String getSignatureAttribute() {
390         throw new RuntimeException("Stub!");
391     }
392 
getSignatureAnnotation()393     private native java.lang.String[] getSignatureAnnotation();
394 
isProxy()395     public boolean isProxy() {
396         throw new RuntimeException("Stub!");
397     }
398 
getAccessFlags()399     public int getAccessFlags() {
400         throw new RuntimeException("Stub!");
401     }
402 
getDeclaredMethodInternal( java.lang.String name, java.lang.Class<?>[] args)403     private native java.lang.reflect.Method getDeclaredMethodInternal(
404             java.lang.String name, java.lang.Class<?>[] args);
405 
406     private static final int ANNOTATION = 8192; // 0x2000
407 
408     private static final int ENUM = 16384; // 0x4000
409 
410     private static final int FINALIZABLE = -2147483648; // 0x80000000
411 
412     private static final int SYNTHETIC = 4096; // 0x1000
413 
414     @UnsupportedAppUsage
415     private transient int accessFlags;
416 
417     private transient int classFlags;
418 
419     @UnsupportedAppUsage
420     private transient java.lang.ClassLoader classLoader;
421 
422     private transient int classSize;
423 
424     @UnsupportedAppUsage
425     private transient int clinitThreadId;
426 
427     private transient java.lang.Class<?> componentType;
428 
429     private transient short copiedMethodsOffset;
430 
431     @UnsupportedAppUsage
432     private transient java.lang.Object dexCache;
433 
434     @UnsupportedAppUsage
435     private transient int dexClassDefIndex;
436 
437     private transient volatile int dexTypeIndex;
438 
439     private transient dalvik.system.ClassExt extData;
440 
441     private transient long iFields;
442 
443     @UnsupportedAppUsage
444     private transient java.lang.Object[] ifTable;
445 
446     private transient long methods;
447 
448     @UnsupportedAppUsage
449     private transient java.lang.String name;
450 
451     private transient int numReferenceInstanceFields;
452 
453     private transient int numReferenceStaticFields;
454 
455     @UnsupportedAppUsage
456     private transient int objectSize;
457 
458     private transient int objectSizeAllocFastPath;
459 
460     private transient int primitiveType;
461 
462     private transient int referenceInstanceOffsets;
463 
464     private transient long sFields;
465 
466     private static final long serialVersionUID = 3206093459760846163L; // 0x2c7e5503d9bf9553L
467 
468     @UnsupportedAppUsage
469     private transient int status;
470 
471     private transient java.lang.Class<? super T> superClass;
472 
473     private transient short virtualMethodsOffset;
474 
475     private transient java.lang.Object vtable;
476 
477     @SuppressWarnings({"unchecked", "deprecation", "all"})
478     private static class Caches {
479 
Caches()480         private Caches() {
481             throw new RuntimeException("Stub!");
482         }
483 
484         private static final libcore.util.BasicLruCache<java.lang.Class, java.lang.reflect.Type[]>
485                 genericInterfaces;
486 
487         static {
488             genericInterfaces = null;
489         }
490     }
491 }
492