Skip to content

Commit 5dd936c

Browse files
committed
synchronized() bug - take 3
1 parent 013c55c commit 5dd936c

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed
-11 Bytes
Binary file not shown.
-11 Bytes
Binary file not shown.

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/Java2ScriptVisitor.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -925,12 +925,11 @@ public boolean visit(SynchronizedStatement node) {
925925
String expr = buffer.substring(pt, buffer.length());
926926
buffer.setLength(pt);
927927
// ignore (treeLock())
928-
if (e instanceof MethodInvocation && expr.indexOf(".getTreeLock()") >= 0) {
929-
return false;
928+
if (!(e instanceof MethodInvocation && expr.indexOf(".getTreeLock()") >= 0)) {
929+
buffer.append("(");
930+
buffer.append(expr);
931+
buffer.append(");\r\n");
930932
}
931-
buffer.append("(");
932-
buffer.append(expr);
933-
buffer.append(");\n");
934933
}
935934
node.getBody().accept(this);
936935
return false;
13.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)