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 
getInnerClassFlags(int defaultValue)334     private native int getInnerClassFlags(int defaultValue);
335 
isEnum()336     public boolean isEnum() {
337         throw new RuntimeException("Stub!");
338     }
339 
getEnumConstants()340     public T[] getEnumConstants() {
341         throw new RuntimeException("Stub!");
342     }
343 
getEnumConstantsShared()344     public T[] getEnumConstantsShared() {
345         throw new RuntimeException("Stub!");
346     }
347 
cast(java.lang.Object obj)348     public T cast(java.lang.Object obj) {
349         throw new RuntimeException("Stub!");
350     }
351 
cannotCastMsg(java.lang.Object obj)352     private java.lang.String cannotCastMsg(java.lang.Object obj) {
353         throw new RuntimeException("Stub!");
354     }
355 
asSubclass(java.lang.Class<U> clazz)356     public <U> java.lang.Class<? extends U> asSubclass(java.lang.Class<U> clazz) {
357         throw new RuntimeException("Stub!");
358     }
359 
getAnnotation( java.lang.Class<A> annotationClass)360     public <A extends java.lang.annotation.Annotation> A getAnnotation(
361             java.lang.Class<A> annotationClass) {
362         throw new RuntimeException("Stub!");
363     }
364 
isAnnotationPresent( java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)365     public boolean isAnnotationPresent(
366             java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass) {
367         throw new RuntimeException("Stub!");
368     }
369 
getAnnotationsByType( java.lang.Class<A> annotationClass)370     public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(
371             java.lang.Class<A> annotationClass) {
372         throw new RuntimeException("Stub!");
373     }
374 
getAnnotations()375     public java.lang.annotation.Annotation[] getAnnotations() {
376         throw new RuntimeException("Stub!");
377     }
378 
getDeclaredAnnotation( java.lang.Class<A> annotationClass)379     public native <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation(
380             java.lang.Class<A> annotationClass);
381 
getDeclaredAnnotations()382     public native java.lang.annotation.Annotation[] getDeclaredAnnotations();
383 
isDeclaredAnnotationPresent( java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)384     private native boolean isDeclaredAnnotationPresent(
385             java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass);
386 
getSignatureAttribute()387     private java.lang.String getSignatureAttribute() {
388         throw new RuntimeException("Stub!");
389     }
390 
getSignatureAnnotation()391     private native java.lang.String[] getSignatureAnnotation();
392 
isProxy()393     public boolean isProxy() {
394         throw new RuntimeException("Stub!");
395     }
396 
getAccessFlags()397     public int getAccessFlags() {
398         throw new RuntimeException("Stub!");
399     }
400 
getDeclaredMethodInternal( java.lang.String name, java.lang.Class<?>[] args)401     private native java.lang.reflect.Method getDeclaredMethodInternal(
402             java.lang.String name, java.lang.Class<?>[] args);
403 
404     private static final int ANNOTATION = 8192; // 0x2000
405 
406     private static final int ENUM = 16384; // 0x4000
407 
408     private static final int FINALIZABLE = -2147483648; // 0x80000000
409 
410     private static final int SYNTHETIC = 4096; // 0x1000
411 
412     @UnsupportedAppUsage
413     private transient int accessFlags;
414 
415     private transient int classFlags;
416 
417     @UnsupportedAppUsage
418     private transient java.lang.ClassLoader classLoader;
419 
420     private transient int classSize;
421 
422     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
423     private transient int clinitThreadId;
424 
425     private transient java.lang.Class<?> componentType;
426 
427     private transient short copiedMethodsOffset;
428 
429     @UnsupportedAppUsage
430     private transient java.lang.Object dexCache;
431 
432     @UnsupportedAppUsage
433     private transient int dexClassDefIndex;
434 
435     private transient volatile int dexTypeIndex;
436 
437     private transient dalvik.system.ClassExt extData;
438 
439     private transient long iFields;
440 
441     @UnsupportedAppUsage
442     private transient java.lang.Object[] ifTable;
443 
444     private transient long methods;
445 
446     @UnsupportedAppUsage
447     private transient java.lang.String name;
448 
449     private transient int numReferenceInstanceFields;
450 
451     private transient int numReferenceStaticFields;
452 
453     @UnsupportedAppUsage
454     private transient int objectSize;
455 
456     private transient int objectSizeAllocFastPath;
457 
458     private transient int primitiveType;
459 
460     private transient int referenceInstanceOffsets;
461 
462     private transient long sFields;
463 
464     private static final long serialVersionUID = 3206093459760846163L; // 0x2c7e5503d9bf9553L
465 
466     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
467     private transient int status;
468 
469     private transient java.lang.Class<? super T> superClass;
470 
471     private transient short virtualMethodsOffset;
472 
473     private transient java.lang.Object vtable;
474 
475     @SuppressWarnings({"unchecked", "deprecation", "all"})
476     private static class Caches {
477 
Caches()478         private Caches() {
479             throw new RuntimeException("Stub!");
480         }
481 
482         private static final libcore.util.BasicLruCache<java.lang.Class, java.lang.reflect.Type[]>
483                 genericInterfaces;
484 
485         static {
486             genericInterfaces = null;
487         }
488     }
489 }
490