Skip to content

Commit

Permalink
Add clarifying braces to misleading code
Browse files Browse the repository at this point in the history
  • Loading branch information
ntt-codeguardian[bot] authored Sep 19, 2024
1 parent 7eca20b commit 10823bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,17 @@ public void visit(

private static boolean maybeSimpleGetter(int access, String name, String desc) {
if ((access & ACC_STATIC) != 0) // 1. Only care about "normal" vals
return false;
{
return false;
}
if (!desc.startsWith("()")) // 2. Takes no args
return false;
{
return false;
}
if (name.contains("$")) // 3. Some hidden method we probably don't care about
return false;
{
return false;
}

// 4. Return type can't be void or scala.Nothing
Type fieldType = Type.getReturnType(desc);
Expand Down Expand Up @@ -426,7 +432,9 @@ private void injectMethodPrefix() {

if (prefix != null) {
if (prefix.descriptor != null) // If descriptor was supplied just use that
descriptor = prefix.descriptor;
{
descriptor = prefix.descriptor;
}

mv.visitMethodInsn(INVOKESTATIC, prefix.cls, prefix.method, descriptor, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ private E xfer(E e, boolean haveData, int how, long nanos) {
Object item = p.item;
if (item != p && (item != null) == isData) { // unmatched
if (isData == haveData) // can't match
break;
{
break;
}
if (p.casItem(item, e)) { // match
for (Node q = p; q != h; ) {
Node n = q.next; // update by 2 unless singleton
Expand Down Expand Up @@ -693,9 +695,13 @@ private E awaitMatch(Node s, Node pred, E e, boolean timed, long nanos) {
private static long spinsFor(Node pred, boolean haveData) {
if (MP && pred != null) {
if (pred.isData != haveData) // phase change
return FRONT_SPINS + CHAINED_SPINS;
{
return FRONT_SPINS + CHAINED_SPINS;
}
if (pred.isMatched()) // probably at front
return FRONT_SPINS;
{
return FRONT_SPINS;
}
if (pred.waiter == null) // pred apparently spinning
return CHAINED_SPINS;
}
Expand Down

0 comments on commit 10823bc

Please sign in to comment.