From 2df49d32a71818227e80a8628688906f2ede8a6a Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 2 Sep 2014 20:56:03 +0400 Subject: java-decompiler: fixes and cleanups - unified attribute loading code - common methods for checking member flags - verifying skip() - correct resource closing - typos --- src/org/jetbrains/java/decompiler/main/AssertProcessor.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/org/jetbrains/java/decompiler/main/AssertProcessor.java') diff --git a/src/org/jetbrains/java/decompiler/main/AssertProcessor.java b/src/org/jetbrains/java/decompiler/main/AssertProcessor.java index fcef8d7..da703fd 100644 --- a/src/org/jetbrains/java/decompiler/main/AssertProcessor.java +++ b/src/org/jetbrains/java/decompiler/main/AssertProcessor.java @@ -69,7 +69,7 @@ public class AssertProcessor { ClassWrapper wrapper = node.wrapper; - boolean nosynthflag = DecompilerContext.getOption(IFernflowerPreferences.SYNTHETIC_NOT_SET); + boolean noSynthFlag = DecompilerContext.getOption(IFernflowerPreferences.SYNTHETIC_NOT_SET); for (StructField fd : wrapper.getClassStruct().getFields()) { @@ -78,12 +78,8 @@ public class AssertProcessor { // initializer exists if (wrapper.getStaticFieldInitializers().containsKey(keyField)) { - int flags = fd.access_flags; - boolean isSynthetic = (flags & CodeConstants.ACC_SYNTHETIC) != 0 || fd.getAttributes().containsKey("Synthetic"); - // access flags set - if ((flags & CodeConstants.ACC_STATIC) != 0 && (flags & CodeConstants.ACC_FINAL) != 0 && - (isSynthetic || nosynthflag)) { + if (fd.hasModifier(CodeConstants.ACC_STATIC) && fd.hasModifier(CodeConstants.ACC_FINAL) && (noSynthFlag || fd.isSynthetic())) { // field type boolean FieldDescriptor fdescr = FieldDescriptor.parseDescriptor(fd.getDescriptor()); @@ -100,8 +96,7 @@ public class AssertProcessor { if (invexpr.getInstance() != null && invexpr.getInstance().type == Exprent.EXPRENT_CONST && - "desiredAssertionStatus".equals(invexpr.getName()) - && + "desiredAssertionStatus".equals(invexpr.getName()) && "java/lang/Class".equals(invexpr.getClassname()) && invexpr.getLstParameters().isEmpty()) { -- cgit v1.2.3