9898import org .eclipse .jdt .core .dom .PrefixExpression ;
9999import org .eclipse .jdt .core .dom .PrimitiveType ;
100100import org .eclipse .jdt .core .dom .PrimitiveType .Code ;
101+
102+ import sun .security .ssl .KerberosClientKeyExchange ;
103+
101104import org .eclipse .jdt .core .dom .QualifiedName ;
102105import org .eclipse .jdt .core .dom .QualifiedType ;
103106import org .eclipse .jdt .core .dom .ReturnStatement ;
133136import org .eclipse .jdt .core .dom .WhileStatement ;
134137import org .eclipse .jdt .core .dom .WildcardType ;
135138
139+ // TODO DefaultRowSorter final method changes this.sorter.compare to p$1.compare???
140+
136141// BH 8/6/2018 -- additional Java 8 fixes; enum $valueOf$S to valueOf$S
137142// BH 8/1/2018 -- adds interface default methods as C$.$defaults$(C$)
138143// BH 7/29/2018 -- java.util.stream.Collectors is returning java.util.Collectionthis.b$['java.util.Collection'].add
@@ -589,10 +594,10 @@ private String getClassJavaNameForClass(Type type) {
589594 return getClassJavaNameForClass (qualType .getQualifier ()) + "."
590595 + qualType .getName ().getIdentifier ();
591596 }
592- if (type instanceof NameQualifiedType ) {
593- NameQualifiedType nType = (NameQualifiedType ) type ;
594- return nType .getQualifier () + "." + nType .getName ().getIdentifier ();
595- }
597+ // if (type instanceof NameQualifiedType) {
598+ // NameQualifiedType nType = (NameQualifiedType) type;
599+ // return getClassJavaNameForClass( nType.getQualifier() ) + "." + nType.getName().getIdentifier();
600+ // }
596601
597602 if (type instanceof ArrayType )
598603 return getClassJavaNameForClass (((ArrayType ) type ).getElementType ());
@@ -1173,13 +1178,13 @@ private void addMethodInvocation(SimpleName nodeName, List<?> arguments, IMethod
11731178 // I have not found a way to do this with lambda expressions.
11741179 //
11751180 boolean isStatic = isStatic (mBinding );// || expression != null && isStatic(expression.resolveTypeBinding()));
1176- if (!isStatic && expression instanceof Name ) {
1177- IBinding binding = ((Name ) expression ).resolveBinding ();
1178- // no, because sometimes these are not fully qualified className =
1179- // expression.toString();
1180- // because System.out is the name of a static field, not a class
1181- isStatic |= isStatic (binding );
1182- }
1181+ // if (!isStatic && expression instanceof Name) {
1182+ // IBinding binding = ((Name) expression).resolveBinding();
1183+ // // no, because sometimes these are not fully qualified className =
1184+ // // expression.toString();
1185+ // // because System.out is the name of a static field, not a class
1186+ // isStatic |= isStatic(binding);
1187+ // }
11831188 boolean isPrivate = isPrivate (mBinding );
11841189 boolean isPrivateAndNotStatic = isPrivate && !isStatic ;
11851190 String privateVar = (isPrivateAndNotStatic ? getPrivateVar (declaringClass , false ) : null );
@@ -6326,7 +6331,7 @@ private static boolean addJ2SSourceForTag(StringBuffer buffer, TagElement tag, b
63266331 // end with 1?xxx: to replace anything with xxx
63276332 // /** @j2sNatve ! */true
63286333 // (/** @j2sNative 1?x: */y)
6329- // /** @j2sNative true || */javaOnly ()
6334+ // /** @j2sNative true || */()
63306335
63316336 boolean isInline = code .endsWith ("|" ) || code .endsWith ("&" ) || code .endsWith (":" ) || code .endsWith ("!" );
63326337 buffer .append (isInline ? "" : addPrefix ? "{\r \n " : "\r \n " );
@@ -6627,21 +6632,33 @@ private void addLambdaMethod(ASTNode lnode, IMethodBinding mBinding) {
66276632 * @param binding
66286633 * @return
66296634 */
6630- private static String getPrivateVar (IBinding binding , boolean isClassCompare ) {
6631- String key = binding .getKey (), key0 = null ;
6635+ private String getPrivateVar (IBinding binding , boolean isClassCompare ) {
6636+ String key = binding .getKey (), key0 = null , key1 = null ;
66326637 if (isClassCompare )
66336638 key = "_" + key ;
66346639 String p$ = classToPrivateVar .get (key );
66356640 if (p$ == null ) {
66366641 key0 = key ;
66376642 p$ = classToPrivateVar .get (key = (isClassCompare ? "_" : "" ) + getNormalizedKey (binding ));
66386643 }
6644+ if (p$ == null && !isClassCompare && key .indexOf ("[" ) >= 0 ) {
6645+ key1 = key ;
6646+ p$ = classToPrivateVar .get (key = key .substring (0 , key .indexOf ("[" ) + 1 ) + "]" );
6647+ }
66396648 if (p$ == null ) {
66406649 classToPrivateVar .put (key , p$ = "p$" + (isClassCompare ? ++privateClassCount : ++privateVarCount ));
66416650 classToPrivateVar .put (key0 , p$ );
6642- if (!isClassCompare )
6651+ if (!isClassCompare ) {
6652+ if (key1 != null )
6653+ classToPrivateVar .put (key1 , p$ );
6654+ // System.out.println("adding " + p$ + " " + key + " " + key0 + " " + key1);
66436655 privateVarString += "," + p$ + "={}" ;
6656+ }
66446657 }
6658+ // if (!isClassCompare) {
6659+ // System.out.println(buffer.substring(buffer.length() - 20));
6660+ // System.out.println(">>" + p$ + " " + key + " " + key0 + " " + key1 + "<<");
6661+ // }
66456662 return p$ ;
66466663 }
66476664
@@ -6653,7 +6670,7 @@ private static String getPrivateVar(IBinding binding, boolean isClassCompare) {
66536670 * @param b
66546671 * @return
66556672 */
6656- private static boolean areEqual (IBinding a , IBinding b ) {
6673+ private boolean areEqual (IBinding a , IBinding b ) {
66576674 return getPrivateVar (a , true ).equals (getPrivateVar (b , true ));
66586675 }
66596676
0 commit comments