public MethodReference getMethodReference(final MethodBase method) { final TypeInfo typeInfo = getTypeInfo(method.getDeclaringType()); final NameAndTypeDescriptor nameAndDescriptor = getNameAndTypeDescriptor( method.getName(), method.getErasedSignature() ); _lookupKey.set(Tag.MethodReference, typeInfo.index, nameAndDescriptor.index); Entry entry = _entryMap.get(_lookupKey); if (entry == null) { entry = new MethodReference(this, typeInfo.index, nameAndDescriptor.index); } _lookupKey.clear(); return (MethodReference)entry; }
public static RuntimeException rawMethodBindingFailure(final MethodBase method) { return new IllegalStateException( format( "Could not bind to runtime method '%s' on type '%s'.", method.getDescription(), method.getDeclaringType().toString() ) ); }
public CallingConvention getCallingConvention() { return CallingConvention.fromMethodModifiers(getModifiers()); } }
m1.getParameters(), varArgOrder1, varArgArrayType1, m2.getParameters(), varArgOrder2, varArgArrayType2, final int hierarchyDepth1 = getHierarchyDepth(m1.getDeclaringType()); final int hierarchyDepth2 = getHierarchyDepth(m2.getDeclaringType());
callingConventions != method.getCallingConvention()) { final ParameterList parameters = method.getParameters(); if (method.getCallingConvention() == CallingConvention.VarArgs) { if (definedParameterCount == 0) { return false;
final MethodBase addMethod(final Type<?> declaringType, final MethodBase method, final CacheType cacheType) { final ArrayList<T> list; final int modifiers = VerifyArgument.notNull(method, "method").getModifiers(); final boolean isPublic = Modifier.isPublic(modifiers); final boolean isStatic = Modifier.isStatic(modifiers); modifiers, bindingFlags, method.getParameters(), sourceMethod.getReturnType(), method.getThrownTypes(), sourceMethod.getTypeBindings() modifiers, bindingFlags, method.getParameters()
static MethodBase findMostDerivedNewSlotMethod(final MethodBase[] match, final int cMatches) { int deepestHierarchy = 0; MethodBase methodWithDeepestHierarchy = null; for (int i = 0; i < cMatches; i++) { // Calculate the depth of the hierarchy of the declaring type of the // current method. final int currentHierarchyDepth = getHierarchyDepth(match[i].getDeclaringType()); // The two methods have the same name, signature, and hierarchy depth. // This can only happen if at least one is vararg or generic. if (currentHierarchyDepth == deepestHierarchy) { throw Error.ambiguousMatch(); } // Check to see if this method is on the most derived class. if (currentHierarchyDepth > deepestHierarchy) { deepestHierarchy = currentHierarchyDepth; methodWithDeepestHierarchy = match[i]; } } return methodWithDeepestHierarchy; }
final MethodBase addMethod(final Type<?> declaringType, final MethodBase method, final CacheType cacheType) { final ArrayList<T> list; final int modifiers = VerifyArgument.notNull(method, "method").getModifiers(); final boolean isPublic = Modifier.isPublic(modifiers); final boolean isStatic = Modifier.isStatic(modifiers); modifiers, bindingFlags, method.getParameters(), sourceMethod.getReturnType(), method.getThrownTypes(), modifiers, bindingFlags, method.getParameters()
visit(method.getParameters().getParameterTypes(), scope, FrameType.METHOD_PARAMETER); visit(method.getThrownTypes(), scope, FrameType.METHOD_THROWS_LIST);
@Override public boolean isEquivalentTo(final MemberInfo m) { return m instanceof MethodBase && super.isEquivalentTo(m) && ((MethodBase) m).getParameters().getParameterTypes().isEquivalentTo(getParameters().getParameterTypes()); } }
final Type<?> declaringType = declaringMethod != null ? declaringMethod.getDeclaringType() : typeParameter.getDeclaringType(); owner = format( "method '%s' on type '%s'", declaringMethod.getSimpleDescription(), declaringType.getSimpleDescription() );
public Boolean visitScope(final MemberInfo scope, final Type<?> s) { if (scope instanceof MethodBase) { final MethodBase method = (MethodBase) scope; if (method.containsGenericParameter(s)) { return Boolean.TRUE; } final Type<?> declaringType = method.getDeclaringType(); if (declaringType != null && !declaringType.isStatic()) { return declaringType.accept(this, s); } return Boolean.FALSE; } if (scope instanceof Type<?>) { final Type<?> type = (Type<?>) scope; if (type.containsGenericParameter(s)) { return Boolean.TRUE; } if (!type.isStatic()) { final Type<?> declaringType = type.getDeclaringType(); if (declaringType != null) { return declaringType.accept(this, s); } return Boolean.FALSE; } } return Boolean.FALSE; }
private void registerCheckedExceptions(final MethodBase method) { final TypeList thrownTypes = method.getThrownTypes();
final String methodName = method.getName(); if (filterOptions.ignoreCase ? !name.equalsIgnoreCase(methodName) : !name.equals(methodName)) { continue;
callingConventions != method.getCallingConvention()) { final ParameterList parameters = method.getParameters(); if (method.getCallingConvention() == CallingConvention.VarArgs) { if (definedParameterCount == 0) { return false;
final MethodBase addMethod(final Type<?> declaringType, final MethodBase method, final CacheType cacheType) { final ArrayList<T> list; final int modifiers = VerifyArgument.notNull(method, "method").getModifiers(); final boolean isPublic = Modifier.isPublic(modifiers); final boolean isStatic = Modifier.isStatic(modifiers); modifiers, bindingFlags, method.getParameters(), sourceMethod.getReturnType(), method.getThrownTypes(), sourceMethod.getTypeBindings() modifiers, bindingFlags, method.getParameters()
static MethodBase findMostDerivedNewSlotMethod(final MethodBase[] match, final int cMatches) { int deepestHierarchy = 0; MethodBase methodWithDeepestHierarchy = null; for (int i = 0; i < cMatches; i++) { // Calculate the depth of the hierarchy of the declaring type of the // current method. final int currentHierarchyDepth = getHierarchyDepth(match[i].getDeclaringType()); // The two methods have the same name, signature, and hierarchy depth. // This can only happen if at least one is vararg or generic. if (currentHierarchyDepth == deepestHierarchy) { throw Error.ambiguousMatch(); } // Check to see if this method is on the most derived class. if (currentHierarchyDepth > deepestHierarchy) { deepestHierarchy = currentHierarchyDepth; methodWithDeepestHierarchy = match[i]; } } return methodWithDeepestHierarchy; }
m1.getParameters(), varArgOrder1, varArgArrayType1, m2.getParameters(), varArgOrder2, varArgArrayType2, final int hierarchyDepth1 = getHierarchyDepth(m1.getDeclaringType()); final int hierarchyDepth2 = getHierarchyDepth(m2.getDeclaringType());
static boolean compareMethodSignatureAndName(final MethodBase m1, final MethodBase m2) { final ParameterList p1 = m1.getParameters(); final ParameterList p2 = m2.getParameters(); if (p1.size() != p2.size()) { return false; } for (int i = 0, n = p1.size(); i < n; i++) { if (!TypeUtils.areEquivalent(p1.get(i).getParameterType(), p2.get(i).getParameterType())) { return false; } } return true; }
private void registerCheckedExceptions(final MethodBase method) { final TypeList thrownTypes = method.getThrownTypes();