From e9989d15e3c1ad1ae28e168f306becfd0abe101c Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 24 Oct 2018 21:16:56 +0200 Subject: [PATCH] Cleanup (warnings) --- .../java/decompiler/main/ClassWriter.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index c782a48..72fefe4 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -257,8 +257,7 @@ public class ClassWriter { } private static void addTracer(StructClass cls, StructMethod method, BytecodeMappingTracer tracer) { - StructLineNumberTableAttribute table = - (StructLineNumberTableAttribute)method.getAttribute(StructGeneralAttribute.ATTRIBUTE_LINE_NUMBER_TABLE); + StructLineNumberTableAttribute table = method.getAttribute(StructGeneralAttribute.ATTRIBUTE_LINE_NUMBER_TABLE); tracer.setLineNumberTable(table); String key = InterpreterUtil.makeUniqueKey(method.getName(), method.getDescriptor()); DecompilerContext.getBytecodeSourceMapper().addTracer(cls.qualifiedName, key, tracer); @@ -439,8 +438,7 @@ public class ClassWriter { } } else if (fd.hasModifier(CodeConstants.ACC_FINAL) && fd.hasModifier(CodeConstants.ACC_STATIC)) { - StructConstantValueAttribute attr = - (StructConstantValueAttribute)fd.getAttribute(StructGeneralAttribute.ATTRIBUTE_CONSTANT_VALUE); + StructConstantValueAttribute attr = fd.getAttribute(StructGeneralAttribute.ATTRIBUTE_CONSTANT_VALUE); if (attr != null) { PrimitiveConstant constant = cl.getPool().getPrimitiveConstant(attr.getIndex()); buffer.append(" = "); @@ -696,8 +694,7 @@ public class ClassWriter { List methodParameters = null; if (DecompilerContext.getOption(IFernflowerPreferences.USE_METHOD_PARAMETERS)) { - StructMethodParametersAttribute attr = - (StructMethodParametersAttribute)mt.getAttribute(StructGeneralAttribute.ATTRIBUTE_METHOD_PARAMETERS); + StructMethodParametersAttribute attr = mt.getAttribute(StructGeneralAttribute.ATTRIBUTE_METHOD_PARAMETERS); if (attr != null) { methodParameters = attr.getEntries(); } @@ -956,7 +953,7 @@ public class ClassWriter { private static void appendAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType) { Set filter = new HashSet<>(); - for (StructGeneralAttribute.Key key : ANNOTATION_ATTRIBUTES) { + for (StructGeneralAttribute.Key key : ANNOTATION_ATTRIBUTES) { StructAnnotationAttribute attribute = (StructAnnotationAttribute)mb.getAttribute(key); if (attribute != null) { for (AnnotationExprent annotation : attribute.getAnnotations()) { @@ -973,7 +970,7 @@ public class ClassWriter { private static void appendParameterAnnotations(TextBuffer buffer, StructMethod mt, int param) { Set filter = new HashSet<>(); - for (StructGeneralAttribute.Key key : PARAMETER_ANNOTATION_ATTRIBUTES) { + for (StructGeneralAttribute.Key key : PARAMETER_ANNOTATION_ATTRIBUTES) { StructAnnotationParameterAttribute attribute = (StructAnnotationParameterAttribute)mt.getAttribute(key); if (attribute != null) { List> annotations = attribute.getParamAnnotations(); @@ -991,7 +988,7 @@ public class ClassWriter { } private static void appendTypeAnnotations(TextBuffer buffer, int indent, StructMember mb, int targetType, int index, Set filter) { - for (StructGeneralAttribute.Key key : TYPE_ANNOTATION_ATTRIBUTES) { + for (StructGeneralAttribute.Key key : TYPE_ANNOTATION_ATTRIBUTES) { StructTypeAnnotationAttribute attribute = (StructTypeAnnotationAttribute)mb.getAttribute(key); if (attribute != null) { for (TypeAnnotation annotation : attribute.getAnnotations()) {