Skip to content

Commit f282d15

Browse files
hansonrhansonr
authored andcommitted
fix for synthetic reference of inner class of superclass
1 parent 0162818 commit f282d15

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed
77 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181220041423
1+
20181220060434
77 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181220041423
1+
20181220060434
77 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
// Google closure compiler cannot handle Clazz.new or Clazz.super
99

10+
// BH 12/20/2018 3.2.4.05 fixes synthetic reference issue
1011
// BH 12/13/2018 3.2.4.05 fixes Class.js field reflection, inner anonymous class of outer class creates wrong synthetic pointer
1112
// BH 12/1/2018 3.2.4.04 fixes TypeError e.stack e not found
1213
// BH 11/11/2018 3.2.4.04 fixes String.CASE_INSENSITIVE_ORDER.compare$S$S
@@ -605,14 +606,15 @@ Clazz.newInstance = function (objThis, args, isInner, clazz) {
605606
// clone the map and overwrite with the correct values
606607
b = appendMap({},b);
607608
addB$Keys(clazz2, true, b, objThis, objThis);
609+
} else if (isNew) {
610+
// it is new, save this map with the OUTER object as $b$
611+
// 12018.12.20 but only if it is clean
612+
outerObj.$b$ = b;
608613
}
609614

610615
// final objective: save this map for the inner object
611616
// add a flag to disallow any other same-class use of this map.
612617
b["$ " + innerName] = 1;
613-
// it is new, save this map with the OUTER object as $b$
614-
if (isNew)
615-
outerObj.$b$ = b;
616618
objThis.b$ = b;
617619
clazz.$this$0 && (objThis.this$0 = b[clazz.$this$0]);
618620
clazz.$clinit$ && clazz.$clinit$();

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13564,6 +13564,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
1356413564

1356513565
// Google closure compiler cannot handle Clazz.new or Clazz.super
1356613566

13567+
// BH 12/20/2018 3.2.4.05 fixes synthetic reference issue
1356713568
// BH 12/13/2018 3.2.4.05 fixes Class.js field reflection, inner anonymous class of outer class creates wrong synthetic pointer
1356813569
// BH 12/1/2018 3.2.4.04 fixes TypeError e.stack e not found
1356913570
// BH 11/11/2018 3.2.4.04 fixes String.CASE_INSENSITIVE_ORDER.compare$S$S
@@ -14162,14 +14163,15 @@ Clazz.newInstance = function (objThis, args, isInner, clazz) {
1416214163
// clone the map and overwrite with the correct values
1416314164
b = appendMap({},b);
1416414165
addB$Keys(clazz2, true, b, objThis, objThis);
14166+
} else if (isNew) {
14167+
// it is new, save this map with the OUTER object as $b$
14168+
// 12018.12.20 but only if it is clean
14169+
outerObj.$b$ = b;
1416514170
}
1416614171

1416714172
// final objective: save this map for the inner object
1416814173
// add a flag to disallow any other same-class use of this map.
1416914174
b["$ " + innerName] = 1;
14170-
// it is new, save this map with the OUTER object as $b$
14171-
if (isNew)
14172-
outerObj.$b$ = b;
1417314175
objThis.b$ = b;
1417414176
clazz.$this$0 && (objThis.this$0 = b[clazz.$this$0]);
1417514177
clazz.$clinit$ && clazz.$clinit$();

0 commit comments

Comments
 (0)