Skip to content

Commit 4de1c0f

Browse files
authored
Merge pull request #142 from BobHanson/hanson1
oops! Can't change java* extends!
2 parents c7b7ae8 + f19d2f5 commit 4de1c0f

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed
70 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200116221246
1+
20200117045002
70 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200116221246
1+
20200117045002

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,11 +2151,13 @@ private boolean addClassOrInterface(ASTNode node, ITypeBinding binding, List<?>
21512151
buffer.append("null");
21522152
break;
21532153
case "java.awt.Component":
2154-
buffer.append("'java.awt.Label'");
2155-
break;
21562154
case "javax.swing.JComponent":
2157-
buffer.append("'javax.swing.JLabel'");
2158-
break;
2155+
if (!class_fullName.startsWith("java.") && !class_fullName.startsWith("javax.")) {
2156+
String s = superclassName.replace("Component", "Label");
2157+
log(">>class " + class_fullName + " extended " + superclassName + " now extends " + s);
2158+
superclassName = s;
2159+
}
2160+
//$FALL-THROUGH$
21592161
default:
21602162
if (isAnonymous) {
21612163
buffer.append(getFinalJ2SClassNameQualifier(null, superclass, superclassName, FINAL_ESCAPE));

0 commit comments

Comments
 (0)