do not show warnings for synthetic classes

master
Egor.Ushakov 10 years ago
parent 95834d0c75
commit 12457e9a7e
  1. 14
      src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2000-2014 JetBrains s.r.o. * Copyright 2000-2015 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -220,8 +220,10 @@ public class NestedClassProcessor {
if (!hasEnclosing) { if (!hasEnclosing) {
if (child.type == ClassNode.CLASS_ANONYMOUS) { if (child.type == ClassNode.CLASS_ANONYMOUS) {
String message = "Unreferenced anonymous class " + child.classStruct.qualifiedName + "!"; if (!child.classStruct.hasModifier(CodeConstants.ACC_SYNTHETIC)) {
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN); String message = "Unreferenced anonymous class " + child.classStruct.qualifiedName + "!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
} }
else if (child.type == ClassNode.CLASS_LOCAL) { else if (child.type == ClassNode.CLASS_LOCAL) {
String message = "Unreferenced local class " + child.classStruct.qualifiedName + "!"; String message = "Unreferenced local class " + child.classStruct.qualifiedName + "!";
@ -274,8 +276,10 @@ public class NestedClassProcessor {
HashMap<String, List<VarFieldPair>> mask = getMaskLocalVars(nd.getWrapper()); HashMap<String, List<VarFieldPair>> mask = getMaskLocalVars(nd.getWrapper());
if (mask.isEmpty()) { if (mask.isEmpty()) {
String message = "Nested class " + nd.classStruct.qualifiedName + " has no constructor!"; if (!nd.classStruct.hasModifier(CodeConstants.ACC_SYNTHETIC)) {
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN); String message = "Nested class " + nd.classStruct.qualifiedName + " has no constructor!";
DecompilerContext.getLogger().writeMessage(message, IFernflowerLogger.Severity.WARN);
}
} }
else { else {
mapVarMasks.put(nd.classStruct.qualifiedName, mask); mapVarMasks.put(nd.classStruct.qualifiedName, mask);

Loading…
Cancel
Save