Skip to content

Commit

Permalink
Refactor: Remove/Rename redundant condition
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Weisleder <[email protected]>
  • Loading branch information
rweisleder authored and codecholeric committed Jan 10, 2020
1 parent 9bd6513 commit 28f3994
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,14 @@ public void visitInnerClass(String name, String outerName, String innerName, int
javaClassBuilder.withSimpleName(nullToEmpty(innerName));

// Javadoc for innerName: "May be null for anonymous inner classes."
javaClassBuilder.withAnonymousClass(innerName == null);
boolean isAnonymousClass = innerName == null;
javaClassBuilder.withAnonymousClass(isAnonymousClass);

// Javadoc for outerName: "May be null for not member classes."
javaClassBuilder.withMemberClass(outerName != null);
boolean isMemberClass = outerName != null;
javaClassBuilder.withMemberClass(isMemberClass);

if (isNamedNestedClass(outerName)) {
if (isMemberClass) {
javaClassBuilder.withModifiers(JavaModifier.getModifiersForClass(access));
declarationHandler.registerEnclosingClass(innerTypeName, createTypeName(outerName));
}
Expand All @@ -176,10 +178,6 @@ private boolean visitingCurrentClass(String innerTypeName) {
return innerTypeName.equals(className);
}

private boolean isNamedNestedClass(String outerName) {
return outerName != null;
}

@Override
public void visitOuterClass(String owner, String name, String desc) {
if (importAborted()) {
Expand Down

0 comments on commit 28f3994

Please sign in to comment.