Skip to content

Commit 197bff9

Browse files
hansonrhansonr
authored andcommitted
// BH 2020.11.20 -- 3.2.9-v1q
fix for new ImmutableCollections.ListN<>(E...) should use Object[]
1 parent cdd1380 commit 197bff9

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed
62 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201117143212
1+
20201120120959
62 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201117143212
1+
20201120120157

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class CorePlugin extends Plugin {
3131
// j2sApplet.js and also (Bob only) update.bat, update-clean.bat
3232

3333

34+
// BH 2020.11.20 -- 3.2.9-v1q fix for new ImmutableCollections.ListN<>(E...) should use Object[]
3435
// BH 2020.08.03 -- 3.2.9-v1p fix for boxing boolean should be Boolean.valueOf$, not new Boolean
3536
// BH 2020.08.01 -- 3.2.9-v1o fix for lambda expressions too static
3637
// BH 2020.07.08 -- 3.2.9-v1n fix for try with resources and adds option varOrLet

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135

136136
// TODO: superclass inheritance for JAXB XmlAccessorType
137137

138+
//BH 2020.11.20 -- 3.2.9-v1q fix for new ImmutableCollections.ListN<>(E...) should use Object[]
138139
//BH 2020.08.03 -- 3.2.9-v1p fix for boxing boolean should be Boolean.valueOf$, not new Boolean
139140
//BH 2020.08.01 -- 3.2.9-v1o fix for lambda expressions too static
140141
//BH 2020.07.08 -- 3.2.9-v1n fix for try with resources and adds option varOrLet
@@ -4258,6 +4259,8 @@ private String clazzArray(ITypeBinding type, int dimFlag) {
42584259
ITypeBinding ebinding = type.getElementType();
42594260
if (ebinding == null)
42604261
ebinding = type; // creating for Enum
4262+
4263+
System.out.println("J2S.clazzArray " + type + " k=" + type.getKey() + " n=" + type.getName());
42614264
String params = (ebinding.isPrimitive() ? NameMapper.getPrimitiveTYPE(ebinding.getName()) + ".TYPE"
42624265
: getFinalJ2SClassNameQualifier(null, ebinding, null, FINAL_ESCAPECACHE))
42634266
+ (dimFlag == ARRAY_DIM_ONLY ? "" : ", " + (Math.abs(dimFlag) * type.getDimensions() * -1));
@@ -5133,13 +5136,22 @@ String getFinalJ2SClassNameQualifier(Name methodQualifier, ITypeBinding declarin
51335136
// It will require synchronous loading,
51345137
// but it will ensure that a class is only
51355138
// loaded when it is really needed.
5136-
5139+
51375140
if (declaringJavaClassName == null)
51385141
declaringJavaClassName = getUnreplacedJavaClassNameQualified(declaringJavaClass);
5142+
51395143
boolean isStatic = ((flags & FINAL_STATIC) == FINAL_STATIC);
51405144
boolean doEscape = isStatic || ((flags & FINAL_ESCAPE) == FINAL_ESCAPE);
51415145
boolean doCache = ((flags & FINAL_CACHE) == FINAL_CACHE);
51425146
String name = removeBracketsAndFixNullPackageName(declaringJavaClassName);
5147+
if (name.equals("_.")) {
5148+
// 2020.11.20 -- 3.2.9-v1q generated by
5149+
// static <E> java.util.List<E> of(E e1, E e2, E e3, E e4) {
5150+
// return new ImmutableCollections.ListN<>(e1, e2, e3, e4);
5151+
// }
5152+
5153+
return "java.lang.Object";
5154+
}
51435155
doEscape &= !NameMapper.isClassKnown(name);
51445156
if (!doEscape) {
51455157
if (methodQualifier != null) {

0 commit comments

Comments
 (0)