|
167 | 167 | // HashSet as the basis for the {a:a,b:this.$finals$.b} mapping listFinalVariables. |
168 | 168 | // This fixed all of the stream issues. See Test_Local, Test_java8, Test_Class. |
169 | 169 |
|
| 170 | +// BH 2019.12.07 3.2.5-v2 fix for lambda expression with $$ must not be cached |
170 | 171 | // BH 2019.11.18 3.2.5-v0 fix for anonymous subclass of a local class not handling finals |
171 | 172 | // BH 2019.11.18 3.2.5-v0 fix for main method that throws exception not generating html test |
172 | 173 | // BH 2019.11.18 3.2.5-v0 fix for lambda expressions in classes with annotations |
@@ -1267,11 +1268,11 @@ private boolean addMethodInvocation(SimpleName javaQualifier, List<?> arguments, |
1267 | 1268 | ) // BH Added 2019.05.13 |
1268 | 1269 | && lambdaArity == mBinding.getParameterTypes().length)); |
1269 | 1270 |
|
1270 | | -bufferDebug("addmeth isclasstarget " + isStatic + " classIsTarget="+ classIsTarget |
1271 | | - + " ivarbinding=" +isVariableBinding(expression) + " exp=" + (expression == null ? |
1272 | | - null : expression.getClass().getName()) |
1273 | | - + " " + declaringClassJavaClassName |
1274 | | - ); |
| 1271 | +//bufferDebug("addmeth isclasstarget " + isStatic + " classIsTarget="+ classIsTarget |
| 1272 | +// + " ivarbinding=" +isVariableBinding(expression) + " exp=" + (expression == null ? |
| 1273 | +// null : expression.getClass().getName()) |
| 1274 | +// + " " + declaringClassJavaClassName |
| 1275 | +// ); |
1275 | 1276 | String opening = (classIsTarget ? "$$." : "t.") + finalMethodNameWith$Params + ".apply(" |
1276 | 1277 | + (isStatic ? "null" : classIsTarget ? "$$" : "t") + ",["; |
1277 | 1278 | buffer.append(opening); |
@@ -1760,9 +1761,18 @@ private boolean addClassOrInterface(ASTNode node, ITypeBinding binding, List<?> |
1760 | 1761 | finalShortClassName = finalShortClassName.substring(3); |
1761 | 1762 | } |
1762 | 1763 | setClassAndBinding(finalShortClassName, binding); |
1763 | | - if (isLambda) |
| 1764 | + if (isLambda) { |
1764 | 1765 | buffer.append("("); |
1765 | | - buffer.append("(P$." + finalShortClassName + "||"); |
| 1766 | + |
| 1767 | + |
| 1768 | + // problem here 2019.12.07 cifbinary was that $$-wrapped lambda methods must NOT be reused. |
| 1769 | + //bufferDebug("addcoi " + isLambda + " " + class_localType); |
| 1770 | + |
| 1771 | + |
| 1772 | + } |
| 1773 | + buffer.append("("); |
| 1774 | + if (!isLambda || class_localType != LAMBDA_WRAPPED) |
| 1775 | + buffer.append("P$." + finalShortClassName + "||"); |
1766 | 1776 | finalPackageName = "P$"; |
1767 | 1777 | } else { |
1768 | 1778 | // Top or inner named classes are already set. |
@@ -6882,7 +6892,7 @@ private void addLambdaReuse(int pt, String anonName) { |
6882 | 6892 | String tmp = buffer.substring(pt); |
6883 | 6893 | buffer.setLength(pt); |
6884 | 6894 |
|
6885 | | - bufferDebug("addLambdaReuse " + anonName); |
| 6895 | +// bufferDebug("addLambdaReuse " + anonName); |
6886 | 6896 |
|
6887 | 6897 | anonName = getFinalJ2SClassName(anonName, FINAL_P); |
6888 | 6898 | buffer.append("(" + anonName + "$||(" + anonName + "$=(") |
|
0 commit comments