Skip to content

Commit 8aaa55a

Browse files
author
zhourenjian
committed
Fixing bug that @j2s* does not read classes correctly
1 parent 091f28d commit 8aaa55a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/net/sf/j2s/core/astvisitors/DependencyASTVisitor.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,22 @@ protected void readClasses(Annotation annotation, Set set) {
356356
if (valuePairs != null && valuePairs.length > 0) {
357357
for (int i = 0; i < valuePairs.length; i++) {
358358
Object value = valuePairs[i].getValue();
359-
if (value instanceof Class) {
360-
Class clzz = (Class) value;
361-
value = clzz.getName();
359+
if (value instanceof Object[]) {
360+
Object[] values = (Object[]) value;
361+
for (int j = 0; j < values.length; j++) {
362+
Object item = values[j];
363+
if (item instanceof ITypeBinding) {
364+
ITypeBinding binding = (ITypeBinding) item;
365+
buf.append(binding.getQualifiedName());
366+
buf.append(",");
367+
}
368+
}
369+
continue;
370+
} else if (value instanceof ITypeBinding) {
371+
ITypeBinding binding = (ITypeBinding) value;
372+
value = binding.getQualifiedName();
362373
}
374+
363375
buf.append(value);
364376
buf.append(",");
365377
}

0 commit comments

Comments
 (0)