Skip to content
Permalink
Browse files
8275771: JDK source code contains redundant boolean operations in jdk…
….compiler and langtools

Reviewed-by: jlahoda
  • Loading branch information
Vicente Romero committed Dec 7, 2021
1 parent 3d61372 commit 3c2951f738c5041761b551674822a32b418094c2
Showing with 7 additions and 6 deletions.
  1. +2 −1 make/langtools/tools/compileproperties/CompileProperties.java
  2. +5 −5 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -183,7 +183,8 @@ private boolean parseOptions(String args[]) {
log.error("cannot close " + filename, e);
}
}
if ( ok = true && contents != null ) {
ok = true;
if ( contents != null ) {
String tokens[] = (new String(contents)).split("\\s+");
if ( tokens.length > 0 ) {
ok = parseOptions(tokens);
@@ -1301,7 +1301,7 @@ class MostSpecificFunctionReturnChecker extends DeferredAttr.PolyScanner {

@Override
void skip(JCTree tree) {
result &= false;
result = false;
}

@Override
@@ -1313,9 +1313,9 @@ public void visitConditional(JCConditional tree) {
@Override
public void visitReference(JCMemberReference tree) {
if (sRet.hasTag(VOID)) {
result &= true;
// do nothing
} else if (tRet.hasTag(VOID)) {
result &= false;
result = false;
} else if (tRet.isPrimitive() != sRet.isPrimitive()) {
boolean retValIsPrimitive =
tree.refPolyKind == PolyKind.STANDALONE &&
@@ -1335,9 +1335,9 @@ public void visitParens(JCParens tree) {
@Override
public void visitLambda(JCLambda tree) {
if (sRet.hasTag(VOID)) {
result &= true;
// do nothing
} else if (tRet.hasTag(VOID)) {
result &= false;
result = false;
} else {
List<JCExpression> lambdaResults = lambdaResults(tree);
if (!lambdaResults.isEmpty() && unrelatedFunctionalInterfaces(tRet, sRet)) {

1 comment on commit 3c2951f

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 3c2951f Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.