Skip to content

Commit 846adc0

Browse files
committed
for (int var: ....) becoming for (var var
1 parent dbabbfd commit 846adc0

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed
-26 Bytes
Binary file not shown.
-26 Bytes
Binary file not shown.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
import org.eclipse.jdt.core.dom.WhileStatement;
123123
import org.eclipse.jdt.core.dom.WildcardType;
124124

125+
// BH 6/20/2018 -- fixes for (int var : new int[] {3,4,5}) becoming for var var
125126
// BH 6/19/2018 -- adds .j2s j2s.class.replacements=org.apache.log4j.->jalview.javascript.log4j.;
126127
// BH 5/15/2018 -- fix for a[pt++] |= 3 incrementing pt twice and disregarding a[][] (see test/Test_Or.java)
127128
// BH 3/27/2018 -- fix for anonymous inner classes of inner classes not having this.this$0
@@ -494,8 +495,7 @@ public boolean visit(EmptyStatement node) {
494495
}
495496

496497
public boolean visit(EnhancedForStatement node) {
497-
SimpleName name = node.getParameter().getName();
498-
String varName = name.getIdentifier();
498+
String varName = getQualifiedSimpleName(node.getParameter().getName());
499499
writeReplaceV("for (var V, $V = ", "V", varName);
500500
Expression exp = node.getExpression();
501501
ITypeBinding typeBinding = exp.resolveTypeBinding();

0 commit comments

Comments
 (0)