Home
last modified time | relevance | path

Searched refs:Method (Results 1 – 25 of 124) sorted by relevance

12345

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/
DGenericMethodsTests.java20 import java.lang.reflect.Method;
55 private void checkTypeParameter(Method method) { in checkTypeParameter()
56 TypeVariable<Method> typeParameter = getTypeParameter(method); in checkTypeParameter()
66 private void checkParameterType(Method method) { in checkParameterType()
67 TypeVariable<Method> typeParameter = getTypeParameter(method); in checkParameterType()
79 private void checkReturnType(Method method) { in checkReturnType()
80 TypeVariable<Method> typeParameter = getTypeParameter(method); in checkReturnType()
87 Method method = clazz.getMethod("noParamNoReturn"); in testNoParamNoReturn()
92 Method method = clazz.getMethod("paramNoReturn", Object.class); in testParamNoReturn()
98 Method method = clazz.getMethod("noParamReturn"); in testNoParamReturn()
[all …]
DBoundedGenericMethodsTests.java19 import java.lang.reflect.Method;
50 private void checkBoundedTypeParameter(Method method) { in checkBoundedTypeParameter()
51 TypeVariable<Method> typeParameter = getTypeParameter(method); in checkBoundedTypeParameter()
68 private void parameterType(Method method) { in parameterType()
69 TypeVariable<Method> typeParameter = getTypeParameter(method); in parameterType()
84 private void checkReturnType(Method method) { in checkReturnType()
89 TypeVariable<Method> returnTypeVariable = (TypeVariable<Method>) genericReturnType; in checkReturnType()
108 Method method = clazz.getMethod("noParamNoReturn"); in testNoParamNoReturn()
112 Method method = clazz.getMethod("paramNoReturn", BoundedGenericMethods.class); in testUnboundedParamNoReturn()
117 Method method = clazz.getMethod("noParamReturn"); in testNoParamReturn()
[all …]
DWildcardTypeTest.java20 import java.lang.reflect.Method;
57 private void checkBoundedTypeParameter(Method method) { in checkBoundedTypeParameter()
58 TypeVariable<Method> typeParameter = getTypeParameter(method); in checkBoundedTypeParameter()
68 private void checkLowerBoundedParameter(Method method) { in checkLowerBoundedParameter()
91 private void checkUpperBoundedParameter(Method method) { in checkUpperBoundedParameter()
113 private void checkReturnType(Method method) { in checkReturnType()
118 TypeVariable<Method> returnTypeVariable = (TypeVariable<Method>) genericReturnType; in checkReturnType()
129Method method = clazz.getMethod("upperBoundedParamNoReturn", BoundedWildcardsGenericMethods.class); in testUpperBoundedParamNoReturn()
135Method method = clazz.getMethod("lowerBoundedParamReturn", BoundedWildcardsGenericMethods.class); in testLowerBoundedParamReturn()
142Method method = clazz.getMethod("upperBoundedParamReturn", BoundedWildcardsGenericMethods.class); in testUpperBoundedParamReturn()
[all …]
DMethodTest.java26 import java.lang.reflect.Method;
199 Method m1 = null, m2 = null; in test_equalsLjava_lang_Object()
224 Method m1 = TestMethod.class.getMethod("invokeInstanceTest", new Class[0]); in test_getMethod()
225 Method m2 = TestMethod.class.getMethod("invokeInstanceTest", (Class[]) null); in test_getMethod()
234 Method m1 = TestMethod.class.getDeclaredMethod("invokeInstanceTest", new Class[0]); in test_getDeclaredMethod()
235 Method m2 = TestMethod.class.getDeclaredMethod("invokeInstanceTest", (Class[]) null); in test_getDeclaredMethod()
246 Method[] mths; in test_getDeclaringClass()
267 Method mth = TestMethod.class.getMethod("voidMethod", new Class[0]); in test_getExceptionTypes()
291 Method mth = null; in test_getModifiers()
342 Method mth = null; in test_getName()
[all …]
DGenericReflectionTestsBase.java19 import java.lang.reflect.Method;
33 public TypeVariable<Method> getTypeParameter(Method method) { in getTypeParameter()
34 TypeVariable<Method>[] typeParameters = method.getTypeParameters(); in getTypeParameter()
36 TypeVariable<Method> typeParameter = typeParameters[0]; in getTypeParameter()
DProxyTest.java26 import java.lang.reflect.Method;
55 public Object invoke(Object proxy, Method method, Object[] args) in invoke()
104 public Object invoke(Object proxy, Method method, Object[] args) in test_ProxyLjava_lang_reflect_InvocationHandler()
122 public Object invoke(Object proxy, Method method, Object[] args) in test_newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler()
196 public Object invoke(Object proxy, Method method, Object[] args) in test_isProxyClassLjava_lang_Class()
221 public Object invoke(Object proxy, Method method, Object[] args) in test_getInvocationHandlerLjava_lang_Object()
267 Method m = c.getMethod("test", (Class<?>[]) null); in test_ProxyClass_withParentAndSubInThrowList()
303 public Object invoke(Object object, Method method, Object[] args) in invoke()
/libcore/luni/src/test/java/libcore/java/lang/reflect/
DMethodOverridesTest.java19 import java.lang.reflect.Method;
30 Method method = StringBuilder.class.getMethod("append", char.class); in testName()
35 Method method = StringBuilder.class.getMethod("append", char.class); in testParameterTypes()
41 Method method = StringBuilder.class.getMethod("append", char.class); in testDeclaringClass()
46 Method method = StringBuilder.class.getMethod("append", char.class); in testReturnType()
51 Method method = StringBuilder.class.getMethod("append", char.class); in testThrownExceptions()
82 Method method = Sub.class.getMethod("returner"); in testGetMethodsIncludesSyntheticMethods()
92 Method method = Sub.class.getMethod("returner"); in testGetDeclaredMethodsIncludesSyntheticMethods()
98 Method[] methods = Sub.class.getMethods(); in testSubclassChangesVisibility()
100 for (Method method : methods) { in testSubclassChangesVisibility()
[all …]
DMethodTest.java20 import java.lang.reflect.Method;
33 Method method = MethodTestHelper.class.getMethod("m1", new Class[0]); in test_getExceptionTypes()
46 Method method = MethodTestHelper.class.getMethod("m1", expectedParameters); in test_getParameterTypes()
63 Method method = MethodTestHelper.class.getMethod("m1", expectedParameters); in test_getParameterCount()
74 Method method = MethodTestHelper.class.getMethod("m1", expectedParameters); in test_getParameters()
132 Method m1 = MethodTestHelper.class.getMethod("m1", (Class[]) null); in testGetMethodWithNullArgumentsArray()
145 Method b = Sub.class.getMethod("b"); in testGetMethodReturnsInheritedStaticMethod()
150 Method method = Super.class.getDeclaredMethod("a"); in testGetDeclaredMethodReturnsPrivateMethods()
175 Method method = anonymous.getClass().getMethod("a"); in testImplementedInterfaceMethodOfAnonymousClass()
184 Method method = anonymous.getClass().getMethod("a"); in testPublicMethodOfAnonymousClass()
[all …]
DParameterTest.java31 import java.lang.reflect.Method;
114 Method method = SingleParameter.class.getDeclaredMethod("oneParameter", String.class); in testSingleParameterMethod()
138 Method method = clazz.getDeclaredMethod("oneParameter", String.class); in testSingleParameterMethod_withMetadata()
170 Method method = GenericParameter.class.getDeclaredMethod( in testGenericParameterMethod()
197 Method method = clazz.getDeclaredMethod("genericParameter", Function.class); in testGenericParameterMethod_withMetadata()
231 Method method = TwoParameters.class.getDeclaredMethod( in testTwoParameterMethod()
260 Method method = clazz.getDeclaredMethod("twoParameters", String.class, Integer.class); in testTwoParameterMethod_withMetadata()
298 Method method = FinalParameter.class.getDeclaredMethod("finalParameter", String.class); in testFinalParameterMethod()
322 Method method = clazz.getDeclaredMethod("finalParameter", String.class); in testFinalParameterMethod_withMetdata()
541 Method method = TestEnum.class.getDeclaredMethod("valueOf", String.class); in testEnumValueOf()
[all …]
DGenericExceptionsTest.java21 import java.lang.reflect.Method;
31 Method method = Thrower.class.getMethod("parameterizedMethod"); in testGenericExceptionsOfMethodsWithTypeParameters()
37 Method method = Thrower.class.getMethod("genericParameters", List.class); in testGenericExceptionsOfMethodsWithGenericParameters()
63 Method method = ThrowerT.class.getMethod("throwsTypeVariable"); in testMethodThrowingTypeVariable()
71 Method method = ThrowerT.class.getMethod("throwsMethodTypeParameter"); in testThrowingMethodTypeParameter()
79 Method method = ThrowerT.class.getMethod("throwsEverything"); in testThrowingMethodThrowsEverything()
DOldAndroidClassTest.java21 import java.lang.reflect.Method;
55 Method method = helloClass.getDeclaredMethod("method", (Class[]) null); in testGetDeclaredMethod()
61 Method method = helloClass.getDeclaredMethod("methodWithArgs", Object.class); in testGetDeclaredMethodWithArgs()
71 Method method = helloClass.getDeclaredMethod("privateMethod", (Class[]) null); in testGetDeclaredMethodPrivate()
141 Method[] methods = ArrayList.class.getMethods(); in testClassGetMethodsNoDupes()
144 for (Method method : methods) { in testClassGetMethodsNoDupes()
175 Method[] methods = MyInterface.class.getMethods(); in testGetMethodsInterfaces()
192 private boolean hasMethod(Method[] methods, String signature) { in hasMethod()
193 for (Method method : methods) { in hasMethod()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DFileIOInterruptTest.java182 testChannelRead_exceptionWhenAlreadyClosed(ChannelReader.Method.READ); in testChannelRead_exceptionWhenAlreadyClosed()
186 testChannelRead_exceptionWhenAlreadyClosed(ChannelReader.Method.READV); in testChannelReadV_exceptionWhenAlreadyClosed()
189 private void testChannelRead_exceptionWhenAlreadyClosed(ChannelReader.Method method) in testChannelRead_exceptionWhenAlreadyClosed()
199 if (method == ChannelReader.Method.READ) { in testChannelRead_exceptionWhenAlreadyClosed()
214 testChannelRead_exceptionWhenAlreadyInterrupted(ChannelReader.Method.READ); in testChannelRead_exceptionWhenAlreadyInterrupted()
218 testChannelRead_exceptionWhenAlreadyInterrupted(ChannelReader.Method.READV); in testChannelReadV_exceptionWhenAlreadyInterrupted()
221 private void testChannelRead_exceptionWhenAlreadyInterrupted(ChannelReader.Method method) in testChannelRead_exceptionWhenAlreadyInterrupted()
232 if (method == ChannelReader.Method.READ) { in testChannelRead_exceptionWhenAlreadyInterrupted()
251 testChannelRead_exceptionOnCloseWhenBlocked(ChannelReader.Method.READ); in testChannelRead_exceptionOnCloseWhenBlocked()
255 testChannelRead_exceptionOnCloseWhenBlocked(ChannelReader.Method.READV); in testChannelReadV_exceptionOnCloseWhenBlocked()
[all …]
/libcore/ojluni/src/main/java/java/lang/reflect/
DMethod.java56 public final class Method extends Executable { class
67 public static final Comparator<Method> ORDER_BY_SIGNATURE = new Comparator<Method>() {
68 @Override public int compare(Method a, Method b) {
90 private Method() { in Method() method in Method
134 public TypeVariable<Method>[] getTypeParameters() { in getTypeParameters()
137 return (TypeVariable<Method>[]) info.formalTypeParameters.clone(); in getTypeParameters()
242 if (obj != null && obj instanceof Method) { in equals()
243 Method other = (Method)obj; in equals()
523 boolean equalNameAndParameters(Method m) { in equalNameAndParameters()
DProxy.java578 …private static final Comparator<Method> ORDER_BY_SIGNATURE_AND_SUBTYPE = new Comparator<Method>() {
579 @Override public int compare(Method a, Method b) {
580 int comparison = Method.ORDER_BY_SIGNATURE.compare(a, b);
678 List<Method> methods = getMethods(interfaces); in apply()
683 Method[] methodsArray = methods.toArray(new Method[methods.size()]); in apply()
706 private static List<Class<?>[]> deduplicateAndGetExceptions(List<Method> methods) { in deduplicateAndGetExceptions()
710 Method method = methods.get(i); in deduplicateAndGetExceptions()
713 if (i > 0 && Method.ORDER_BY_SIGNATURE.compare(method, methods.get(i - 1)) == 0) { in deduplicateAndGetExceptions()
756 private static void validateReturnTypes(List<Method> methods) { in validateReturnTypes()
757 Method vs = null; in validateReturnTypes()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/
DAnnotationTest.java23 import java.lang.reflect.Method;
44 Method m1 = AnnotatedClass2.class in test_equals()
46 Method m2 = AnnotatedClass2.class in test_equals()
53 List<Method> methods = Arrays.asList(AnnotatedClass.class.getDeclaredMethods()); in test_equals()
54 Map<String, List<Method>> eqs = new HashMap<String, List<Method>>(); in test_equals()
55 Map<String, List<Method>> neqs = new HashMap<String, List<Method>>(); in test_equals()
56 for (Method m : methods) { in test_equals()
59 Map<String, List<Method>> curT = name.charAt(0) == 'e'? eqs : neqs; in test_equals()
61 List<Method> mlist = curT.get(testNum); in test_equals()
63 mlist = new ArrayList<Method>(); in test_equals()
[all …]
/libcore/ojluni/src/main/java/java/lang/annotation/
DAnnotationTypeMismatchException.java27 import java.lang.reflect.Method;
47 private final transient Method element;
67 public AnnotationTypeMismatchException(Method element, String foundType) { in AnnotationTypeMismatchException()
82 public Method element() { in element()
/libcore/dom/src/test/java/org/w3c/domts/
DLSDocumentBuilderFactory.java16 import java.lang.reflect.Method;
33 private final Method parseURIMethod;
136 Method domConfigMethod = parser.getClass().getMethod("getDomConfig", in setParameter()
139 Method setParameterMethod = domConfig.getClass().getMethod( in setParameter()
154 Method domConfigMethod = parser.getClass().getMethod("getDomConfig", in getParameter()
157 Method getParameterMethod = domConfig.getClass().getMethod("getParameter", in getParameter()
275 Method newInstanceMethod = domImplRegistryClass.getMethod("newInstance", (Class<?>) null); in LSDocumentBuilderFactory()
277 Method getDOMImplementationMethod = domImplRegistryClass.getMethod( in LSDocumentBuilderFactory()
281 Method createLSParserMethod = impl.getClass().getMethod("createLSParser", in LSDocumentBuilderFactory()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DObjectStreamClassTest.java31 import java.lang.reflect.Method;
239 Method getConstructorId = getConstructorIdMethod(); in testBug28106822_target24()
244 Method newInstance = getNewInstanceMethod(); in testBug28106822_target24()
255 Method getConstructorId = getConstructorIdMethod(); in testBug28106822_target25()
257 Method newInstance = getNewInstanceMethod(); in testBug28106822_target25()
273 private Method getConstructorIdMethod() throws NoSuchMethodException { in getConstructorIdMethod()
274 Method getConstructorId = ObjectStreamClass.class.getDeclaredMethod( in getConstructorIdMethod()
280 private Method getNewInstanceMethod() throws NoSuchMethodException { in getNewInstanceMethod()
281 Method newInstance = ObjectStreamClass.class.getDeclaredMethod("newInstance", in getNewInstanceMethod()
/libcore/luni/src/test/java/libcore/java/lang/reflect/annotations/
DExecutableParameterTest.java24 import java.lang.reflect.Method;
53 Method methodWithoutAnnotatedParameters = MethodClass.class.getMethod( in testMethodGetParameterAnnotations()
60 Method methodWithAnnotatedParameters = MethodClass.class.getMethod( in testMethodGetParameterAnnotations()
84 static Method getMethodWithoutAnnotations() throws Exception { in getMethodWithoutAnnotations()
88 static Method getMethodMultipleAnnotationOddity() throws Exception { in getMethodMultipleAnnotationOddity()
93 static Method getMethodMultipleAnnotationExplicitSingle() throws Exception { in getMethodMultipleAnnotationExplicitSingle()
98 static Method getMethodMultipleAnnotation() throws Exception { in getMethodMultipleAnnotation()
102 static Method getMethodSingleAnnotation() throws Exception { in getMethodSingleAnnotation()
106 static Method getMethodStaticSingleAnnotation() throws Exception { in getMethodStaticSingleAnnotation()
115 static Method getMethodAbstractSingleAnnotation() throws Exception { in getMethodAbstractSingleAnnotation()
/libcore/harmony-tests/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/
DAnnotationTypeMismatchExceptionTest.java21 import java.lang.reflect.Method;
38 Method[] methods = Class.forName("java.lang.String").getMethods(); in test_constructorLjava_lang_reflect_MethodLjava_lang_String()
39 Method m = methods[0]; in test_constructorLjava_lang_reflect_MethodLjava_lang_String()
/libcore/ojluni/src/main/java/java/lang/
DClass.java41 import java.lang.reflect.Method;
1152 private native Method getEnclosingMethodNative(); in getEnclosingMethodNative()
1170 public Method getEnclosingMethod() { in getEnclosingMethod()
1516 public Method[] getMethods() throws SecurityException { in getMethods()
1517 List<Method> methods = new ArrayList<Method>(); in getMethods()
1524 CollectionUtils.removeDuplicates(methods, Method.ORDER_BY_SIGNATURE); in getMethods()
1525 return methods.toArray(new Method[methods.size()]); in getMethods()
1532 private void getPublicMethodsInternal(List<Method> result) { in getPublicMethodsInternal()
1722 public Method getMethod(String name, Class<?>... parameterTypes) in getMethod()
1910 public Method[] getDeclaredMethods() throws SecurityException { in getDeclaredMethods()
[all …]
/libcore/luni/src/main/java/javax/xml/datatype/
DDatatypeConfigurationException.java26 import java.lang.reflect.Method;
144 Method m = this.getClass().getMethod("initCause", new Class[] {Throwable.class}); in initCauseByReflection()
156 Method m1 = this.getClass().getMethod("getCause", new Class[] {}); in readObject()
162 Method m2 = this.getClass().getMethod("initCause", new Class[] {Throwable.class}); in readObject()
/libcore/luni/src/test/java/libcore/java/lang/
DLambdaImplementationTest.java28 import java.lang.reflect.Method;
73 Method implCallMethod = lambdaClass.getMethod( in testInstanceMethodReferenceLambda()
78 Method interfaceCallMethod = Condition.class.getDeclaredMethod( in testInstanceMethodReferenceLambda()
258 Set<Method> declaredMethods = new HashSet<>(); in assertLambdaImplementsInterfaces()
260 Set<Method> expectedMethods = new HashSet<>(); in assertLambdaImplementsInterfaces()
271 for (Method expectedMethod : expectedMethods) { in assertLambdaImplementsInterfaces()
272 Method actualMethod = in assertLambdaImplementsInterfaces()
279 private static void addNonStaticPublicMethods(Class<?> clazz, Set<Method> methodSet) { in addNonStaticPublicMethods()
280 for (Method interfaceMethod : clazz.getDeclaredMethods()) { in addNonStaticPublicMethods()
386 Method singleAbstractMethod = null; in assertLambdaMethodCharacteristics()
[all …]
/libcore/ojluni/annotations/hiddenapi/java/lang/
DClass.java153 private native java.lang.reflect.Method getEnclosingMethodNative(); in getEnclosingMethodNative()
155 public java.lang.reflect.Method getEnclosingMethod() { in getEnclosingMethod()
211 public java.lang.reflect.Method[] getMethods() throws java.lang.SecurityException { in getMethods()
215 private void getPublicMethodsInternal(java.util.List<java.lang.reflect.Method> result) { in getPublicMethodsInternal()
230 public java.lang.reflect.Method getMethod( in getMethod()
247 public java.lang.reflect.Method[] getDeclaredMethods() throws java.lang.SecurityException { in getDeclaredMethods()
252 public native java.lang.reflect.Method[] getDeclaredMethodsUnchecked(boolean publicOnly); in getDeclaredMethodsUnchecked()
267 public java.lang.reflect.Method getDeclaredMethod( in getDeclaredMethod()
274 private java.lang.reflect.Method getMethod( in getMethod()
282 private java.lang.reflect.Method getPublicMethodRecursive( in getPublicMethodRecursive()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DReflectionBenchmark.java21 import java.lang.reflect.Method;
94 Method m = klass.getDeclaredMethod("m"); in timeMethod_invokeV()
103 Method m = klass.getDeclaredMethod("sm"); in timeMethod_invokeStaticV()
111 Method m = klass.getDeclaredMethod("setField", int.class); in timeMethod_invokeI()
120 Method m = klass.getDeclaredMethod("setField", int.class); in timeMethod_invokePreBoxedI()
130 Method m = klass.getDeclaredMethod("setStaticField", int.class); in timeMethod_invokeStaticI()
138 Method m = klass.getDeclaredMethod("setStaticField", int.class); in timeMethod_invokeStaticPreBoxedI()

12345