@Override public String toString() { return mainMethod.getDeclaringType() + "." + mainMethod; } }
@Override public final TypeDefinition getDeclaringType() { return _declaringMethod.getDeclaringType(); }
@Override public final TypeReference getDeclaringType() { return _declaringMethod.getDeclaringType(); }
public VariableReference makeReference(final int slot, final TypeReference variableType) { return new UnknownVariableReference( variableType, slot, _declaringMethod.getDeclaringType() ); }
private AstMethodBodyBuilder(final AstBuilder astBuilder, final MethodDefinition method, final DecompilerContext context) { _astBuilder = astBuilder; _method = method; _context = context; _parser = new MetadataParser(method.getDeclaringType()); }
public VariableReference makeReference(final int slot, final TypeReference variableType) { return new UnknownVariableReference( variableType, slot, _declaringMethod.getDeclaringType() ); }
public VariableReference makeReference(final int slot, final TypeReference variableType) { return new UnknownVariableReference( variableType, slot, _declaringMethod.getDeclaringType() ); }
@Override protected StringBuilder appendName(final StringBuilder sb, final boolean fullName, final boolean dottedName) { if (fullName) { final TypeDefinition declaringType = getDeclaringType(); if (declaringType != null) { return declaringType.appendName(sb, true, false).append('.').append(getName()); } } return sb.append(_name); }
public boolean isOverridden(MethodDefinition md) { if(md.isStatic() || md.isFinal() || md.getDeclaringType().isFinal()) return false; IMetadataResolver resolver = md.getDeclaringType().getResolver(); MemberInfo mi = new MemberInfo(md); TypeHierarchy th = get(md.getDeclaringType()); return th != null && th.isOverridden(resolver, mi); }
@Override public boolean equals(final Object obj) { if (obj instanceof MethodDefinition) { final MethodDefinition other = (MethodDefinition) obj; return StringUtilities.equals(getName(), other.getName()) && StringUtilities.equals(getErasedSignature(), other.getErasedSignature()) && typeNamesMatch(getDeclaringType(), other.getDeclaringType()); } return false; }
public boolean isApplicable(MethodDefinition md) { if (!anno.methodName().isEmpty() && !anno.methodName().equals(md.getName())) return false; if (!anno.methodSignature().isEmpty() && !anno.methodSignature().equals(md.getSignature())) return false; if (anno.minVersion() > 0 && md.getDeclaringType().getCompilerMajorVersion() - 44 < anno.minVersion()) return false; return true; } }
public static MethodDefinition findSuperMethod(MethodReference mr) { MethodDefinition md = mr.resolve(); if(md == null) return null; TypeDefinition td = md.getDeclaringType(); return findSuperMethod(td, new MemberInfo(resolveToBridge(md))); }
private static IMetadataResolver getResolver(final MethodBody body) { final MethodReference method = body.getMethod(); if (method != null) { final MethodDefinition resolvedMethod = method.resolve(); if (resolvedMethod != null) { final TypeDefinition declaringType = resolvedMethod.getDeclaringType(); if (declaringType != null) { return declaringType.getResolver(); } } } return MetadataSystem.instance(); }
private static IMetadataResolver getResolver(final MethodBody body) { final MethodReference method = body.getMethod(); if (method != null) { final MethodDefinition resolvedMethod = method.resolve(); if (resolvedMethod != null) { final TypeDefinition declaringType = resolvedMethod.getDeclaringType(); if (declaringType != null) { return declaringType.getResolver(); } } } return MetadataSystem.instance(); }
public static AccessLevel of(MethodDefinition md) { TypeDefinition td = md.getDeclaringType(); return ofFlags(td.getFlags()).min(ofFlags(md.getFlags())); }
@Override public void run(final AstNode compilationUnit) { final TypeDefinition currentType = _context.getCurrentType(); if (currentType.getCompilerTarget().hasClassLiterals()) { return; } final MethodDefinition classMethod = tryLocateClassMethod(currentType, compilationUnit); if (classMethod != null && classMethod.getDeclaringType() != null) { new Rewriter(_context, classMethod).run(compilationUnit); } }
private InstructionAnalyzer(final MethodBody body, final InstructionVisitor innerVisitor) { _body = VerifyArgument.notNull(body, "body"); _innerVisitor = innerVisitor; if (body.getMethod().isConstructor()) { set(0, FrameValue.UNINITIALIZED_THIS); } _factory = CoreMetadataFactory.make(_body.getMethod().getDeclaringType(), _body.getMethod()); }
private InstructionAnalyzer(final MethodBody body, final InstructionVisitor innerVisitor) { _body = VerifyArgument.notNull(body, "body"); _innerVisitor = innerVisitor; if (body.getMethod().isConstructor()) { set(0, FrameValue.UNINITIALIZED_THIS); } _factory = CoreMetadataFactory.make(_body.getMethod().getDeclaringType(), _body.getMethod()); }
public MethodReader(final MethodDefinition methodDefinition, final IMetadataScope scope) { _methodDefinition = VerifyArgument.notNull(methodDefinition, "methodDefinition"); _scope = VerifyArgument.notNull(scope, "scope"); _declaringType = methodDefinition.getDeclaringType(); _modifiers = methodDefinition.getModifiers(); _code = SourceAttribute.find(AttributeNames.Code, methodDefinition.getSourceAttributes()); _methodBody = new MethodBody(methodDefinition); _methodBody.setCodeSize(_code.getCode().size()); _methodBody.setMaxStackSize(_code.getMaxStack()); _methodBody.setMaxLocals(_code.getMaxLocals()); }
public MethodReader(final MethodDefinition methodDefinition, final IMetadataScope scope) { _methodDefinition = VerifyArgument.notNull(methodDefinition, "methodDefinition"); _scope = VerifyArgument.notNull(scope, "scope"); _declaringType = methodDefinition.getDeclaringType(); _modifiers = methodDefinition.getModifiers(); _code = SourceAttribute.find(AttributeNames.Code, methodDefinition.getSourceAttributes()); _methodBody = new MethodBody(methodDefinition); _methodBody.setCodeSize(_code.getCode().size()); _methodBody.setMaxStackSize(_code.getMaxStack()); _methodBody.setMaxLocals(_code.getMaxLocals()); }