MethodInfo(final int accessFlags, final String name, final String descriptor, final SourceAttribute[] attributes) { this.accessFlags = accessFlags; this.name = name; this.descriptor = descriptor; this.attributes = attributes; this.codeAttribute = SourceAttribute.find(AttributeNames.Code, attributes); } }
MethodInfo(final int accessFlags, final String name, final String descriptor, final SourceAttribute[] attributes) { this.accessFlags = accessFlags; this.name = name; this.descriptor = descriptor; this.attributes = attributes; this.codeAttribute = SourceAttribute.find(AttributeNames.Code, attributes); } }
MethodInfo(final int accessFlags, final String name, final String descriptor, final SourceAttribute[] attributes) { this.accessFlags = accessFlags; this.name = name; this.descriptor = descriptor; this.attributes = attributes; this.codeAttribute = SourceAttribute.find(AttributeNames.Code, attributes); } }
private void visitAttributes() { inflateAttributes(_attributes); if (shouldProcessAnnotations()) { final AnnotationsAttribute visibleAnnotations = SourceAttribute.find( AttributeNames.RuntimeVisibleAnnotations, _attributes ); final AnnotationsAttribute invisibleAnnotations = SourceAttribute.find( AttributeNames.RuntimeInvisibleAnnotations, _attributes ); final Collection<CustomAnnotation> annotations = _typeDefinition.getAnnotationsInternal(); if (visibleAnnotations != null) { Collections.addAll(annotations, visibleAnnotations.getAnnotations()); } if (invisibleAnnotations != null) { Collections.addAll(annotations, invisibleAnnotations.getAnnotations()); } } }
private void visitAttributes() { inflateAttributes(_attributes); if (shouldProcessAnnotations()) { final AnnotationsAttribute visibleAnnotations = SourceAttribute.find( AttributeNames.RuntimeVisibleAnnotations, _attributes ); final AnnotationsAttribute invisibleAnnotations = SourceAttribute.find( AttributeNames.RuntimeInvisibleAnnotations, _attributes ); final Collection<CustomAnnotation> annotations = _typeDefinition.getAnnotationsInternal(); if (visibleAnnotations != null) { Collections.addAll(annotations, visibleAnnotations.getAnnotations()); } if (invisibleAnnotations != null) { Collections.addAll(annotations, invisibleAnnotations.getAnnotations()); } } }
private void visitAttributes() { inflateAttributes(_attributes); if (shouldProcessAnnotations()) { final AnnotationsAttribute visibleAnnotations = SourceAttribute.find( AttributeNames.RuntimeVisibleAnnotations, _attributes ); final AnnotationsAttribute invisibleAnnotations = SourceAttribute.find( AttributeNames.RuntimeInvisibleAnnotations, _attributes ); final Collection<CustomAnnotation> annotations = _typeDefinition.getAnnotationsInternal(); if (visibleAnnotations != null) { Collections.addAll(annotations, visibleAnnotations.getAnnotations()); } if (invisibleAnnotations != null) { Collections.addAll(annotations, invisibleAnnotations.getAnnotations()); } } }
private static Integer findFirstLineNumber(final TypeDefinition type) { int minLineNumber = Integer.MAX_VALUE; for (final MethodDefinition method : type.getDeclaredMethods()) { final LineNumberTableAttribute attribute = SourceAttribute.find(AttributeNames.LineNumberTable, method.getSourceAttributes()); if (attribute != null && !attribute.getEntries().isEmpty()) { final int firstLineNumber = attribute.getEntries().get(0).getLineNumber(); if (firstLineNumber < minLineNumber) { minLineNumber = firstLineNumber; } } } return minLineNumber; }
private static Integer findFirstLineNumber(final TypeDefinition type) { int minLineNumber = Integer.MAX_VALUE; for (final MethodDefinition method : type.getDeclaredMethods()) { final LineNumberTableAttribute attribute = SourceAttribute.find(AttributeNames.LineNumberTable, method.getSourceAttributes()); if (attribute != null && !attribute.getEntries().isEmpty()) { final int firstLineNumber = attribute.getEntries().get(0).getLineNumber(); if (firstLineNumber < minLineNumber) { minLineNumber = firstLineNumber; } } } return minLineNumber; }
private static Integer findFirstLineNumber(final TypeDefinition type) { int minLineNumber = Integer.MAX_VALUE; for (final MethodDefinition method : type.getDeclaredMethods()) { final LineNumberTableAttribute attribute = SourceAttribute.find(AttributeNames.LineNumberTable, method.getSourceAttributes()); if (attribute != null && !attribute.getEntries().isEmpty()) { final int firstLineNumber = attribute.getEntries().get(0).getLineNumber(); if (firstLineNumber < minLineNumber) { minLineNumber = firstLineNumber; } } } return minLineNumber; }
private InnerClassEntry findInnerClassEntry(final String name) { if (_owner == null) { return null; } final String internalName = name.replace('.', '/'); final SourceAttribute attribute = SourceAttribute.find(AttributeNames.InnerClasses, _owner.getSourceAttributes()); if (attribute instanceof InnerClassesAttribute) { final List<InnerClassEntry> entries = ((InnerClassesAttribute) attribute).getEntries(); for (final InnerClassEntry entry : entries) { if (StringUtilities.equals(entry.getInnerClassName(), internalName)) { return entry; } } } return null; }
private InnerClassEntry findInnerClassEntry(final String name) { if (_owner == null) { return null; } final String internalName = name.replace('.', '/'); final SourceAttribute attribute = SourceAttribute.find(AttributeNames.InnerClasses, _owner.getSourceAttributes()); if (attribute instanceof InnerClassesAttribute) { final List<InnerClassEntry> entries = ((InnerClassesAttribute) attribute).getEntries(); for (final InnerClassEntry entry : entries) { if (StringUtilities.equals(entry.getInnerClassName(), internalName)) { return entry; } } } return null; }
private InnerClassEntry findInnerClassEntry(final String name) { if (_owner == null) { return null; } final String internalName = name.replace('.', '/'); final SourceAttribute attribute = SourceAttribute.find(AttributeNames.InnerClasses, _owner.getSourceAttributes()); if (attribute instanceof InnerClassesAttribute) { final List<InnerClassEntry> entries = ((InnerClassesAttribute) attribute).getEntries(); for (final InnerClassEntry entry : entries) { if (StringUtilities.equals(entry.getInnerClassName(), internalName)) { return entry; } } } return null; }
public static void run(final DecompilerContext context, final Block method) { final TypeAnalysis ta = new TypeAnalysis(); final SourceAttribute localVariableTable = SourceAttribute.find( AttributeNames.LocalVariableTable, context.getCurrentMethod().getSourceAttributes() ); final SourceAttribute localVariableTypeTable = SourceAttribute.find( AttributeNames.LocalVariableTypeTable, context.getCurrentMethod().getSourceAttributes() ); ta._context = context; ta._factory = CoreMetadataFactory.make(context.getCurrentType(), context.getCurrentMethod()); ta._preserveMetadataTypes = localVariableTable != null; ta._preserveMetadataGenericTypes = localVariableTypeTable != null; ta.createDependencyGraph(method); ta.identifySingleLoadVariables(); ta._doneInitializing = true; ta.runInference(); }
public static void run(final DecompilerContext context, final Block method) { final TypeAnalysis ta = new TypeAnalysis(); final SourceAttribute localVariableTable = SourceAttribute.find( AttributeNames.LocalVariableTable, context.getCurrentMethod().getSourceAttributes() ); final SourceAttribute localVariableTypeTable = SourceAttribute.find( AttributeNames.LocalVariableTypeTable, context.getCurrentMethod().getSourceAttributes() ); ta._context = context; ta._factory = CoreMetadataFactory.make(context.getCurrentType(), context.getCurrentMethod()); ta._preserveMetadataTypes = localVariableTable != null; ta._preserveMetadataGenericTypes = localVariableTypeTable != null; ta.createDependencyGraph(method); ta.identifySingleLoadVariables(); ta._doneInitializing = true; ta.runInference(); }
@Override public DynamicCallSite lookupDynamicCallSite(final int token) { final ConstantPool.InvokeDynamicInfoEntry entry = _constantPool.getEntry(token); final BootstrapMethodsAttribute attribute = SourceAttribute.find(AttributeNames.BootstrapMethods, _typeDefinition.getSourceAttributes()); final BootstrapMethodsTableEntry bootstrapMethod = attribute.getBootstrapMethods() .get(entry.bootstrapMethodAttributeIndex); final ConstantPool.NameAndTypeDescriptorEntry nameAndType = _constantPool.getEntry(entry.nameAndTypeDescriptorIndex); return new DynamicCallSite( bootstrapMethod.getMethod(), bootstrapMethod.getArguments(), nameAndType.getName(), _parser.parseMethodSignature(nameAndType.getType()) ); }
@Override public DynamicCallSite lookupDynamicCallSite(final int token) { final ConstantPool.InvokeDynamicInfoEntry entry = _constantPool.getEntry(token); final BootstrapMethodsAttribute attribute = SourceAttribute.find(AttributeNames.BootstrapMethods, _typeDefinition.getSourceAttributes()); final BootstrapMethodsTableEntry bootstrapMethod = attribute.getBootstrapMethods() .get(entry.bootstrapMethodAttributeIndex); final ConstantPool.NameAndTypeDescriptorEntry nameAndType = _constantPool.getEntry(entry.nameAndTypeDescriptorIndex); return new DynamicCallSite( bootstrapMethod.getMethod(), bootstrapMethod.getArguments(), nameAndType.getName(), _parser.parseMethodSignature(nameAndType.getType()) ); }
@Override public DynamicCallSite lookupDynamicCallSite(final int token) { final ConstantPool.InvokeDynamicInfoEntry entry = _constantPool.getEntry(token); final BootstrapMethodsAttribute attribute = SourceAttribute.find(AttributeNames.BootstrapMethods, _typeDefinition.getSourceAttributes()); final BootstrapMethodsTableEntry bootstrapMethod = attribute.getBootstrapMethods() .get(entry.bootstrapMethodAttributeIndex); final ConstantPool.NameAndTypeDescriptorEntry nameAndType = _constantPool.getEntry(entry.nameAndTypeDescriptorIndex); return new DynamicCallSite( entry.bootstrapMethodAttributeIndex, bootstrapMethod.getMethodHandle(), bootstrapMethod.getArguments(), nameAndType.getName(), _parser.parseMethodSignature(nameAndType.getType()) ); }
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()); }
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()); }