Skip to content

Commit 04da856

Browse files
author
soheil_h_y
committed
1. Misc Bug is solved.
1 parent f4a571b commit 04da856

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ public boolean visit(ArrayCreation node) {
162162
initializer.accept(this);
163163
} else {
164164
List dim = node.dimensions();
165-
ITypeBinding binding = node.getType().resolveBinding();
166-
if(binding != null){
167-
ITypeBinding elementType = binding.getElementType();
165+
node.getType().resolveBinding();
166+
node.getType().getComponentType().resolveBinding();
167+
ITypeBinding elementType = node.getType().getElementType().resolveBinding();
168+
elementType = node.getType().getElementType().resolveBinding();
169+
if(elementType != null){
168170
if (elementType.isPrimitive()) {
169171
String typeCode = elementType.getName();
170172
if ("int".equals(typeCode)
@@ -195,16 +197,16 @@ public boolean visit(ArrayCreation node) {
195197
buffer.append(")");
196198
}
197199
}
198-
}
199-
} else {
200-
if (dim != null && dim.size() > 1) {
201-
buffer.append(" Clazz.newArray (");
202-
visitList(dim, ", ");
203-
buffer.append(", null)");
204200
} else {
205-
buffer.append(" new Array (");
206-
visitList(dim, "");
207-
buffer.append(")");
201+
if (dim != null && dim.size() > 1) {
202+
buffer.append(" Clazz.newArray (");
203+
visitList(dim, ", ");
204+
buffer.append(", null)");
205+
} else {
206+
buffer.append(" new Array (");
207+
visitList(dim, "");
208+
buffer.append(")");
209+
}
208210
}
209211
}
210212
}

0 commit comments

Comments
 (0)