public static void readAttributes(final IMetadataResolver resolver, final IMetadataScope scope, final Buffer input, final SourceAttribute[] attributes) { for (int i = 0; i < attributes.length; i++) { attributes[i] = readAttribute(resolver, scope, input); } }
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 static int computeSize(final BootstrapMethodsTableEntry[] bootstrapMethods) { int size = 2; if (bootstrapMethods == null) { return size; } for (final BootstrapMethodsTableEntry bootstrapMethod : bootstrapMethods) { size += (2 + (2 * bootstrapMethod.getArguments().size())); } return size; } }
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; }
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()); }
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 String getSourceFile(TypeDefinition type) { for(SourceAttribute sa : type.getSourceAttributes()) { if(sa instanceof SourceFileAttribute) { return ((SourceFileAttribute)sa).getSourceFile(); } } return null; } }
private boolean isHandlerStart(final Instruction instruction) { for (final ExceptionTableEntry entry : _tableEntries) { if (entry.getHandlerOffset() == instruction.getOffset()) { return true; } } return false; }
public static SourceAttribute create(final String name) { return new SourceAttribute(VerifyArgument.notNull(name, "name"), 0); }
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; }
public static void readAttributes(final IMetadataResolver resolver, final IMetadataScope scope, final Buffer input, final SourceAttribute[] attributes) { for (int i = 0; i < attributes.length; i++) { attributes[i] = readAttribute(resolver, scope, input); } }
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 static int computeSize(final BootstrapMethodsTableEntry[] bootstrapMethods) { int size = 2; if (bootstrapMethods == null) { return size; } for (final BootstrapMethodsTableEntry bootstrapMethod : bootstrapMethods) { size += (2 + (2 * bootstrapMethod.getArguments().size())); } return size; } }
private boolean isHandlerStart(final Instruction instruction) { for (final ExceptionTableEntry entry : _tableEntries) { if (entry.getHandlerOffset() == instruction.getOffset()) { return true; } } return false; }
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; }
public static void readAttributes(final IMetadataResolver resolver, final IMetadataScope scope, final Buffer input, final SourceAttribute[] attributes) { for (int i = 0; i < attributes.length; i++) { attributes[i] = readAttribute(resolver, scope, input); } }
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 static int computeSize(final BootstrapMethodsTableEntry[] bootstrapMethods) { int size = 2; if (bootstrapMethods == null) { return size; } for (final BootstrapMethodsTableEntry bootstrapMethod : bootstrapMethods) { size += (2 + (2 * bootstrapMethod.getArguments().size())); } return size; } }
private boolean isHandlerStart(final Instruction instruction) { for (final ExceptionTableEntry entry : _tableEntries) { if (entry.getHandlerOffset() == instruction.getOffset()) { return true; } } return false; }