8275771: JDK source code contains redundant boolean operations in jdk.compiler and langtools

Reviewed-by: jlahoda
This commit is contained in:
Vicente Romero 2021-12-07 23:31:09 +00:00
parent 3d61372ba5
commit 3c2951f738
2 changed files with 7 additions and 6 deletions

View File

@ -183,7 +183,8 @@ public class CompileProperties {
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);

View File

@ -1301,7 +1301,7 @@ public class Resolve {
@Override
void skip(JCTree tree) {
result &= false;
result = false;
}
@Override
@ -1313,9 +1313,9 @@ public class Resolve {
@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 class Resolve {
@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)) {