Skip to content

Commit ea44a96

Browse files
committed
fix for Tracker use of qualified super() call for inner class
1 parent 699aa5e commit ea44a96

File tree

15 files changed

+279
-18
lines changed

15 files changed

+279
-18
lines changed

sources/net.sf.j2s.core/.settings/org.eclipse.jdt.core.prefs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,8 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
88
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
99
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
1010
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
11-
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
12-
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
13-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
14-
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
15-
org.eclipse.jdt.core.compiler.compliance=11
16-
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
17-
org.eclipse.jdt.core.compiler.debug.localVariable=generate
18-
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
1911
org.eclipse.jdt.core.compiler.problem.APILeak=warning
2012
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
21-
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
2213
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
2314
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
2415
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -28,7 +19,6 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
2819
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
2920
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
3021
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
31-
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
3222
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
3323
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
3424
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
@@ -110,5 +100,3 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
110100
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
111101
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
112102
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
113-
org.eclipse.jdt.core.compiler.release=disabled
114-
org.eclipse.jdt.core.compiler.source=11
13.9 KB
Binary file not shown.
12 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200414130547
1+
20200415174852
13.9 KB
Binary file not shown.
12 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200414130547
1+
20200415174852

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class CorePlugin extends Plugin {
3030
// if you change the x.x.x number, be sure to also indicate that in
3131
// j2sApplet.js and also (Bob only) update.bat, update-clean.bat
3232

33-
33+
// BH 2020.04.15 -- 3.2.9-v1g fix for qualified super() in inner classes using Class.super_ call (Tracker)
3434
// BH 2020.04.05 -- 3.2.9-v1f (Boolean ? ...) not unboxed
3535
// BH 2020.03.21 -- 3.2.9-v1e better v1c
3636
// BH 2020.03.20 -- 3.2.9-v1d proper check for new String("x") == "x" (should be false), but new integer(3) == 3 (true)

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
// TODO: superclass inheritance for JAXB XmlAccessorType
137137
// TODO: inner classes of interface are duplicated
138138

139+
//BH 2020.04.15 -- 3.2.9-v1g fix for qualified super() in inner classes using Class.super_ call (Tracker)
139140
//BH 2020.04.05 -- 3.2.9-v1f (Boolean ? ...) not unboxed
140141
//BH 2020.03.21 -- 3.2.9-v1e better v1c
141142
//BH 2020.03.20 -- 3.2.9-v1d proper check for new String("x") == "x" (should be false), but new integer(3) == 3 (true)
@@ -2904,6 +2905,13 @@ private void addSuperConstructor(SuperConstructorInvocation node, IMethodBinding
29042905
buffer.append("Clazz.super_(C$, this);\n");
29052906
return;
29062907
}
2908+
2909+
if (node.getExpression() != null) {
2910+
buffer.append(";Clazz.super_(C$,this,");
2911+
node.getExpression().accept(this);
2912+
buffer.append(")");
2913+
}
2914+
29072915
buffer.append(getFinalMethodNameWith$Params(";C$.superclazz.c$", node.resolveConstructorBinding(), null, false,
29082916
METHOD_NOTSPECIAL));
29092917
buffer.append(".apply(this,[");
@@ -4789,7 +4797,7 @@ private String getClassNameAndDot(ASTNode node, ITypeBinding declaringClass, boo
47894797
*/
47904798
private String getSyntheticReference(String className) {
47914799
return "this" + (className.equals("java.lang.Object") || className.equals("Object") ? ""
4792-
: className.equals(this$0Name) ? ".this$0"
4800+
//: className.equals(this$0Name) ? ".this$0"
47934801
: ".b$['" + getFinalJ2SClassName(className, FINAL_RAW) + "']");
47944802
}
47954803

13.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)