private static OffsetToLineNumberConverter createConverter(MethodDefinition md) { for (SourceAttribute sa : md.getSourceAttributes()) { if (sa instanceof LineNumberTableAttribute) { return new LineNumberTableConverter((LineNumberTableAttribute) sa); } } return OffsetToLineNumberConverter.NOOP_CONVERTER; }
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; }
@Override public void decompileMethod(final MethodDefinition method, final ITextOutput output, final DecompilationOptions options) { writeMethodHeader(output, method); writeMethodBody(output, method, options); for (final SourceAttribute attribute : method.getSourceAttributes()) { writeMethodAttribute(output, method, attribute); } writeMethodEnd(output, method, options); }
@Override public void decompileMethod(final MethodDefinition method, final ITextOutput output, final DecompilationOptions options) { writeMethodHeader(output, method); writeMethodBody(output, method, options); for (final SourceAttribute attribute : method.getSourceAttributes()) { writeMethodAttribute(output, method, attribute); } writeMethodEnd(output, method, options); }
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(); }
public static void reset(final DecompilerContext context, final Block method) { final SourceAttribute localVariableTable = SourceAttribute.find( AttributeNames.LocalVariableTable, context.getCurrentMethod().getSourceAttributes() ); final SourceAttribute localVariableTypeTable = SourceAttribute.find( AttributeNames.LocalVariableTypeTable, context.getCurrentMethod().getSourceAttributes() ); final boolean preserveTypesFromMetadata = localVariableTable != null; final boolean preserveGenericTypesFromMetadata = localVariableTypeTable != null; for (final Expression e : method.getSelfAndChildrenRecursive(Expression.class)) { e.setInferredType(null); e.setExpectedType(null); final Object operand = e.getOperand(); if (operand instanceof Variable) { final Variable variable = (Variable) operand; if (shouldResetVariableType(variable, preserveTypesFromMetadata, preserveGenericTypesFromMetadata)) { variable.setType(null); } } } }
public static void reset(final DecompilerContext context, final Block method) { final SourceAttribute localVariableTable = SourceAttribute.find( AttributeNames.LocalVariableTable, context.getCurrentMethod().getSourceAttributes() ); final SourceAttribute localVariableTypeTable = SourceAttribute.find( AttributeNames.LocalVariableTypeTable, context.getCurrentMethod().getSourceAttributes() ); final boolean preserveTypesFromMetadata = localVariableTable != null; final boolean preserveGenericTypesFromMetadata = localVariableTypeTable != null; for (final Expression e : method.getSelfAndChildrenRecursive(Expression.class)) { e.setInferredType(null); e.setExpectedType(null); final Object operand = e.getOperand(); if (operand instanceof Variable) { final Variable variable = (Variable) operand; if (shouldResetVariableType(variable, preserveTypesFromMetadata, preserveGenericTypesFromMetadata)) { variable.setType(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 reset(final DecompilerContext context, final Block method) { final SourceAttribute localVariableTable = SourceAttribute.find( AttributeNames.LocalVariableTable, context.getCurrentMethod().getSourceAttributes() ); final SourceAttribute localVariableTypeTable = SourceAttribute.find( AttributeNames.LocalVariableTypeTable, context.getCurrentMethod().getSourceAttributes() ); final boolean preserveTypesFromMetadata = localVariableTable != null; final boolean preserveGenericTypesFromMetadata = localVariableTypeTable != null; for (final Expression e : method.getSelfAndChildrenRecursive(Expression.class)) { e.setInferredType(null); e.setExpectedType(null); final Object operand = e.getOperand(); if (operand instanceof Variable) { final Variable variable = (Variable) operand; if (shouldResetVariableType(variable, preserveTypesFromMetadata, preserveGenericTypesFromMetadata)) { variable.setType(null); } } } }
@Override public void decompileMethod(final MethodDefinition method, final ITextOutput output, final DecompilationOptions options) { final BytecodeOutputOptions formattingOptions = getBytecodeOptions(options); writeMethodHeader(output, method, options); writeMethodBody(output, method, options); for (final SourceAttribute attribute : method.getSourceAttributes()) { if (attribute instanceof LocalVariableTableAttribute) { if (formattingOptions.showLocalVariableTables) { writeMethodAttribute(output, method, attribute); } } else if (formattingOptions.showMethodAttributes) { writeMethodAttribute(output, method, attribute); } } writeMethodEnd(output, method, options); }
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()); }
constructor != null ? constructor.getSourceAttributes() : Collections.<SourceAttribute>emptyList() );
method.getSourceAttributes() );