1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * Copyright (c) 1999, 2013, 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.reflect; 28 29 import dalvik.annotation.compat.UnsupportedAppUsage; 30 31 @SuppressWarnings({"unchecked", "deprecation", "all"}) 32 public class Proxy implements java.io.Serializable { 33 Proxy()34 private Proxy() { 35 throw new RuntimeException("Stub!"); 36 } 37 Proxy(java.lang.reflect.InvocationHandler h)38 protected Proxy(java.lang.reflect.InvocationHandler h) { 39 throw new RuntimeException("Stub!"); 40 } 41 getProxyClass( java.lang.ClassLoader loader, java.lang.Class<?>... interfaces)42 public static java.lang.Class<?> getProxyClass( 43 java.lang.ClassLoader loader, java.lang.Class<?>... interfaces) 44 throws java.lang.IllegalArgumentException { 45 throw new RuntimeException("Stub!"); 46 } 47 getProxyClass0( java.lang.ClassLoader loader, java.lang.Class<?>... interfaces)48 private static java.lang.Class<?> getProxyClass0( 49 java.lang.ClassLoader loader, java.lang.Class<?>... interfaces) { 50 throw new RuntimeException("Stub!"); 51 } 52 deduplicateAndGetExceptions( java.util.List<java.lang.reflect.Method> methods)53 private static java.util.List<java.lang.Class<?>[]> deduplicateAndGetExceptions( 54 java.util.List<java.lang.reflect.Method> methods) { 55 throw new RuntimeException("Stub!"); 56 } 57 intersectExceptions( java.lang.Class<?>[] aExceptions, java.lang.Class<?>[] bExceptions)58 private static java.lang.Class<?>[] intersectExceptions( 59 java.lang.Class<?>[] aExceptions, java.lang.Class<?>[] bExceptions) { 60 throw new RuntimeException("Stub!"); 61 } 62 validateReturnTypes(java.util.List<java.lang.reflect.Method> methods)63 private static void validateReturnTypes(java.util.List<java.lang.reflect.Method> methods) { 64 throw new RuntimeException("Stub!"); 65 } 66 getMethods( java.lang.Class<?>[] interfaces)67 private static java.util.List<java.lang.reflect.Method> getMethods( 68 java.lang.Class<?>[] interfaces) { 69 throw new RuntimeException("Stub!"); 70 } 71 getMethodsRecursive( java.lang.Class<?>[] interfaces, java.util.List<java.lang.reflect.Method> methods)72 private static void getMethodsRecursive( 73 java.lang.Class<?>[] interfaces, java.util.List<java.lang.reflect.Method> methods) { 74 throw new RuntimeException("Stub!"); 75 } 76 generateProxy( java.lang.String name, java.lang.Class<?>[] interfaces, java.lang.ClassLoader loader, java.lang.reflect.Method[] methods, java.lang.Class<?>[][] exceptions)77 private static native java.lang.Class<?> generateProxy( 78 java.lang.String name, 79 java.lang.Class<?>[] interfaces, 80 java.lang.ClassLoader loader, 81 java.lang.reflect.Method[] methods, 82 java.lang.Class<?>[][] exceptions); 83 newProxyInstance( java.lang.ClassLoader loader, java.lang.Class<?>[] interfaces, java.lang.reflect.InvocationHandler h)84 public static java.lang.Object newProxyInstance( 85 java.lang.ClassLoader loader, 86 java.lang.Class<?>[] interfaces, 87 java.lang.reflect.InvocationHandler h) 88 throws java.lang.IllegalArgumentException { 89 throw new RuntimeException("Stub!"); 90 } 91 isProxyClass(java.lang.Class<?> cl)92 public static boolean isProxyClass(java.lang.Class<?> cl) { 93 throw new RuntimeException("Stub!"); 94 } 95 getInvocationHandler(java.lang.Object proxy)96 public static java.lang.reflect.InvocationHandler getInvocationHandler(java.lang.Object proxy) 97 throws java.lang.IllegalArgumentException { 98 throw new RuntimeException("Stub!"); 99 } 100 101 @UnsupportedAppUsage invoke( java.lang.reflect.Proxy proxy, java.lang.reflect.Method method, java.lang.Object[] args)102 private static java.lang.Object invoke( 103 java.lang.reflect.Proxy proxy, java.lang.reflect.Method method, java.lang.Object[] args) 104 throws java.lang.Throwable { 105 throw new RuntimeException("Stub!"); 106 } 107 108 private static final java.util.Comparator<java.lang.reflect.Method> 109 ORDER_BY_SIGNATURE_AND_SUBTYPE; 110 111 static { 112 ORDER_BY_SIGNATURE_AND_SUBTYPE = null; 113 } 114 115 private static final java.lang.Class<?>[] constructorParams; 116 117 static { 118 constructorParams = new java.lang.Class[0]; 119 } 120 121 protected java.lang.reflect.InvocationHandler h; 122 123 private static final java.lang.Object key0; 124 125 static { 126 key0 = null; 127 } 128 129 private static final java.lang.reflect.WeakCache< 130 java.lang.ClassLoader, java.lang.Class<?>[], java.lang.Class<?>> 131 proxyClassCache; 132 133 static { 134 proxyClassCache = null; 135 } 136 137 private static final long serialVersionUID = -2222568056686623797L; // 0xe127da20cc1043cbL 138 139 @SuppressWarnings({"unchecked", "deprecation", "all"}) 140 private static final class Key1 extends java.lang.ref.WeakReference<java.lang.Class<?>> { 141 Key1(java.lang.Class<?> intf)142 Key1(java.lang.Class<?> intf) { 143 super(null); 144 throw new RuntimeException("Stub!"); 145 } 146 hashCode()147 public int hashCode() { 148 throw new RuntimeException("Stub!"); 149 } 150 equals(java.lang.Object obj)151 public boolean equals(java.lang.Object obj) { 152 throw new RuntimeException("Stub!"); 153 } 154 155 private final int hash; 156 157 { 158 hash = 0; 159 } 160 } 161 162 @SuppressWarnings({"unchecked", "deprecation", "all"}) 163 private static final class Key2 extends java.lang.ref.WeakReference<java.lang.Class<?>> { 164 Key2(java.lang.Class<?> intf1, java.lang.Class<?> intf2)165 Key2(java.lang.Class<?> intf1, java.lang.Class<?> intf2) { 166 super(null); 167 throw new RuntimeException("Stub!"); 168 } 169 hashCode()170 public int hashCode() { 171 throw new RuntimeException("Stub!"); 172 } 173 equals(java.lang.Object obj)174 public boolean equals(java.lang.Object obj) { 175 throw new RuntimeException("Stub!"); 176 } 177 178 private final int hash; 179 180 { 181 hash = 0; 182 } 183 184 private final java.lang.ref.WeakReference<java.lang.Class<?>> ref2; 185 186 { 187 ref2 = null; 188 } 189 } 190 191 @SuppressWarnings({"unchecked", "deprecation", "all"}) 192 private static final class KeyFactory 193 implements java.util.function.BiFunction< 194 java.lang.ClassLoader, java.lang.Class<?>[], java.lang.Object> { 195 KeyFactory()196 private KeyFactory() { 197 throw new RuntimeException("Stub!"); 198 } 199 apply( java.lang.ClassLoader classLoader, java.lang.Class<?>[] interfaces)200 public java.lang.Object apply( 201 java.lang.ClassLoader classLoader, java.lang.Class<?>[] interfaces) { 202 throw new RuntimeException("Stub!"); 203 } 204 } 205 206 @SuppressWarnings({"unchecked", "deprecation", "all"}) 207 private static final class KeyX { 208 KeyX(java.lang.Class<?>[] interfaces)209 KeyX(java.lang.Class<?>[] interfaces) { 210 throw new RuntimeException("Stub!"); 211 } 212 hashCode()213 public int hashCode() { 214 throw new RuntimeException("Stub!"); 215 } 216 equals(java.lang.Object obj)217 public boolean equals(java.lang.Object obj) { 218 throw new RuntimeException("Stub!"); 219 } 220 equals( java.lang.ref.WeakReference<java.lang.Class<?>>[] refs1, java.lang.ref.WeakReference<java.lang.Class<?>>[] refs2)221 private static boolean equals( 222 java.lang.ref.WeakReference<java.lang.Class<?>>[] refs1, 223 java.lang.ref.WeakReference<java.lang.Class<?>>[] refs2) { 224 throw new RuntimeException("Stub!"); 225 } 226 227 private final int hash; 228 229 { 230 hash = 0; 231 } 232 233 private final java.lang.ref.WeakReference<java.lang.Class<?>>[] refs; 234 235 { 236 refs = new java.lang.ref.WeakReference[0]; 237 } 238 } 239 240 @SuppressWarnings({"unchecked", "deprecation", "all"}) 241 private static final class ProxyClassFactory 242 implements java.util.function.BiFunction< 243 java.lang.ClassLoader, java.lang.Class<?>[], java.lang.Class<?>> { 244 ProxyClassFactory()245 private ProxyClassFactory() { 246 throw new RuntimeException("Stub!"); 247 } 248 apply( java.lang.ClassLoader loader, java.lang.Class<?>[] interfaces)249 public java.lang.Class<?> apply( 250 java.lang.ClassLoader loader, java.lang.Class<?>[] interfaces) { 251 throw new RuntimeException("Stub!"); 252 } 253 254 private static final java.util.concurrent.atomic.AtomicLong nextUniqueNumber; 255 256 static { 257 nextUniqueNumber = null; 258 } 259 260 private static final java.lang.String proxyClassNamePrefix = "$Proxy"; 261 } 262 } 263