[starvation] harmonize java formatting in tests

Reviewed By: ddino

Differential Revision: D7667305

fbshipit-source-id: efee0f8
master
Nikos Gorogiannis 7 years ago committed by Facebook Github Bot
parent 670ae4a673
commit 196c0e5544

@ -8,37 +8,43 @@
*/ */
class Interclass { class Interclass {
synchronized void interclass1_bad(InterclassA a) { synchronized void interclass1Bad(InterclassA a) {
a.interclass1_bad(); a.interclass1Bad();
} }
synchronized void interclass2_bad() {} synchronized void interclass2Bad() {}
synchronized void interclass1_ok(InterclassB b) { synchronized void interclass1Ok(InterclassB b) {
b.interclass1_ok(); b.interclass1Ok();
} }
void interclass2_ok(InterclassB b) { void interclass2Ok(InterclassB b) {
synchronized(b) {} synchronized(b) {}
} }
void reentrant_ok(InterclassB b) { void reentrantOk(InterclassB b) {
synchronized(this) { synchronized(b) { b.interclass1_ok(); } } synchronized(this) {
synchronized(b) {
b.interclass1Ok();
}
}
} }
} }
class InterclassA { class InterclassA {
synchronized void interclass1_bad() {} synchronized void interclass1Bad() {}
synchronized void interclass2_bad(Interclass i) { synchronized void interclass2Bad(Interclass i) {
i.interclass2_bad(); i.interclass2Bad();
} }
} }
class InterclassB { class InterclassB {
synchronized void interclass1_ok() {} synchronized void interclass1Ok() {}
void interclass2_ok(Interclass c) { void interclass2_ok(Interclass c) {
synchronized(c) { c.interclass2_ok(this); } synchronized(c) {
c.interclass2Ok(this);
}
} }
} }

@ -8,43 +8,49 @@
*/ */
class Interproc { class Interproc {
synchronized void interproc1_bad(InterprocA a) { synchronized void interproc1Bad(InterprocA a) {
interproc2_bad(a); interproc2Bad(a);
} }
void interproc2_bad(InterprocA b) { void interproc2Bad(InterprocA b) {
synchronized(b) {} synchronized(b) {}
} }
synchronized void interproc1_ok(InterprocB a) { synchronized void interproc1Ok(InterprocB a) {
interproc2_ok(a); interproc2Ok(a);
} }
void interproc2_ok(InterprocB b) { void interproc2Ok(InterprocB b) {
synchronized(b) {} synchronized(b) {}
} }
void reentrant1_ok(InterprocB b) { void reentrant1Ok(InterprocB b) {
synchronized(this) { synchronized(b) { reentrant2_ok(); } } synchronized(this) {
synchronized(b) {
reentrant2Ok();
}
}
} }
synchronized void reentrant2_ok() {} synchronized void reentrant2Ok() {}
} }
class InterprocA { class InterprocA {
synchronized void interproc1_bad(Interproc c) { synchronized void interproc1Bad(Interproc c) {
interproc2_bad(c); interproc2Bad(c);
} }
void interproc2_bad(Interproc d) { void interproc2Bad(Interproc d) {
synchronized(d) {} synchronized(d) {}
} }
} }
class InterprocB { class InterprocB {
void interproc1_ok(Interproc c) { void interproc1Ok(Interproc c) {
synchronized(c) { interproc2_ok(c); } synchronized(c) {
interproc2Ok(c);
}
} }
synchronized void interproc2_ok(Interproc d) {} synchronized void interproc2Ok(Interproc d) {}
} }

@ -8,27 +8,39 @@
*/ */
class Intraproc { class Intraproc {
void intra_bad(IntraprocA o) { void intraBad(IntraprocA o) {
synchronized(this) { synchronized(o) {} } synchronized(this) {
synchronized(o) {}
}
} }
void intra_ok(IntraprocB o) { void intraOk(IntraprocB o) {
synchronized(this) { synchronized(o) {} } synchronized(this) {
synchronized(o) {}
}
} }
void reentrant_ok(IntraprocB b) { void reentrantOk(IntraprocB b) {
synchronized(this) { synchronized(b) { synchronized(this) {} } } synchronized(this) {
synchronized(b) {
synchronized(this) {}
}
}
} }
} }
class IntraprocA { class IntraprocA {
void intra_bad(Intraproc o) { void intraBad(Intraproc o) {
synchronized(this) { synchronized(o) {} } synchronized(this) {
synchronized(o) {}
}
} }
} }
class IntraprocB { class IntraprocB {
void intra_ok(Intraproc o) { void intraOk(Intraproc o) {
synchronized(o) { synchronized(this) {} } synchronized(o) {
synchronized(this) {}
}
} }
} }

@ -10,23 +10,23 @@
class LocalLock { class LocalLock {
Object lock1, lock2; Object lock1, lock2;
Object get_lock1() { Object getLock1() {
return lock1; return lock1;
} }
void local_lock_outer_ok() { void localLockOuterOk() {
synchronized(get_lock1()) { synchronized(getLock1()) {
synchronized(this) {} synchronized(this) {}
} }
} }
Object get_lock2() { Object getLock2() {
return lock2; return lock2;
} }
void local_lock_inner_ok() { void localLockInnerOk() {
synchronized(this) { synchronized(this) {
synchronized(get_lock2()) {} synchronized(getLock2()) {}
} }
} }
} }

@ -1,6 +1,6 @@
codetoanalyze/java/starvation/InnerClass.java, void InnerClass$InnerClassA.innerOuterBad(), 0, STARVATION, ERROR, [[Trace 1] Locks this in class InnerClass$InnerClassA*,Method call: void InnerClass.bar(),Locks this in class InnerClass*,[Trace 2] Locks this in class InnerClass*,Method call: void InnerClass$InnerClassA.baz(),Locks this in class InnerClass$InnerClassA*] codetoanalyze/java/starvation/InnerClass.java, void InnerClass$InnerClassA.innerOuterBad(), 0, STARVATION, ERROR, [[Trace 1] Locks this in class InnerClass$InnerClassA*,Method call: void InnerClass.bar(),Locks this in class InnerClass*,[Trace 2] Locks this in class InnerClass*,Method call: void InnerClass$InnerClassA.baz(),Locks this in class InnerClass$InnerClassA*]
codetoanalyze/java/starvation/InnerClass.java, void InnerClass.outerInnerBad(InnerClass$InnerClassA), 0, STARVATION, ERROR, [[Trace 1] Locks this in class InnerClass*,Method call: void InnerClass$InnerClassA.baz(),Locks this in class InnerClass$InnerClassA*,[Trace 2] Method start: InnerClass$InnerClassA.<init>(InnerClass,Object),Locks this in class InnerClass$InnerClassA*,Method call: void InnerClass.bar(),Locks this in class InnerClass*] codetoanalyze/java/starvation/InnerClass.java, void InnerClass.outerInnerBad(InnerClass$InnerClassA), 0, STARVATION, ERROR, [[Trace 1] Locks this in class InnerClass*,Method call: void InnerClass$InnerClassA.baz(),Locks this in class InnerClass$InnerClassA*,[Trace 2] Method start: InnerClass$InnerClassA.<init>(InnerClass,Object),Locks this in class InnerClass$InnerClassA*,Method call: void InnerClass.bar(),Locks this in class InnerClass*]
codetoanalyze/java/starvation/Interclass.java, void Interclass.interclass1_bad(InterclassA), 0, STARVATION, ERROR, [[Trace 1] Locks this in class Interclass*,Method call: void InterclassA.interclass1_bad(),Locks this in class InterclassA*,[Trace 2] Locks this in class InterclassA*,Method call: void Interclass.interclass2_bad(),Locks this in class Interclass*] codetoanalyze/java/starvation/Interclass.java, void InterclassA.interclass2Bad(Interclass), 0, STARVATION, ERROR, [[Trace 1] Locks this in class InterclassA*,Method call: void Interclass.interclass2Bad(),Locks this in class Interclass*,[Trace 2] Locks this in class Interclass*,Method call: void InterclassA.interclass1Bad(),Locks this in class InterclassA*]
codetoanalyze/java/starvation/Interproc.java, void Interproc.interproc1_bad(InterprocA), 0, STARVATION, ERROR, [[Trace 1] Locks this in class Interproc*,Method call: void Interproc.interproc2_bad(InterprocA),Locks b in class InterprocA*,[Trace 2] Locks this in class InterprocA*,Method call: void InterprocA.interproc2_bad(Interproc),Locks d in class Interproc*] codetoanalyze/java/starvation/Interproc.java, void Interproc.interproc1Bad(InterprocA), 0, STARVATION, ERROR, [[Trace 1] Locks this in class Interproc*,Method call: void Interproc.interproc2Bad(InterprocA),Locks b in class InterprocA*,[Trace 2] Locks this in class InterprocA*,Method call: void InterprocA.interproc2Bad(Interproc),Locks d in class Interproc*]
codetoanalyze/java/starvation/Intraproc.java, void IntraprocA.intra_bad(Intraproc), 0, STARVATION, ERROR, [[Trace 1] Method start: void IntraprocA.intra_bad(Intraproc),Locks this in class IntraprocA*,Locks o in class Intraproc*,[Trace 2] Method start: void Intraproc.intra_bad(IntraprocA),Locks this in class Intraproc*,Locks o in class IntraprocA*] codetoanalyze/java/starvation/Intraproc.java, void IntraprocA.intraBad(Intraproc), 0, STARVATION, ERROR, [[Trace 1] Method start: void IntraprocA.intraBad(Intraproc),Locks this in class IntraprocA*,Locks o in class Intraproc*,[Trace 2] Method start: void Intraproc.intraBad(IntraprocA),Locks this in class Intraproc*,Locks o in class IntraprocA*]
codetoanalyze/java/starvation/StaticLock.java, void StaticLock.lockOtherClassOneWayBad(), 0, STARVATION, ERROR, [[Trace 1] Method start: void StaticLock.lockOtherClassOneWayBad(),Locks StaticLock$0 in class java.lang.Class*,Locks this in class StaticLock*,[Trace 2] Locks this in class StaticLock*,Method call: void StaticLock.staticSynced(),Locks StaticLock$0 in class java.lang.Class*] codetoanalyze/java/starvation/StaticLock.java, void StaticLock.lockOtherClassOneWayBad(), 0, STARVATION, ERROR, [[Trace 1] Method start: void StaticLock.lockOtherClassOneWayBad(),Locks StaticLock$0 in class java.lang.Class*,Locks this in class StaticLock*,[Trace 2] Locks this in class StaticLock*,Method call: void StaticLock.staticSynced(),Locks StaticLock$0 in class java.lang.Class*]

Loading…
Cancel
Save