|
135 | 135 |
|
136 | 136 | // TODO: superclass inheritance for JAXB XmlAccessorType |
137 | 137 |
|
| 138 | +//BH 2020.01.16 -- 3.2.7-v4 replaces extends java.awt.Component and javax.swing.JComponent |
138 | 139 | //BH 2020.01.12 -- 3.2.7-v3 fixes JAXB annotation marshalling for 3.2.7 |
139 | 140 | //BH 2020.01.11 -- 3.2.7-v3 corrects and rewrites synthetic bridge creation with much cleaner heap usage |
140 | 141 | //BH 2020.01.09 -- 3.2.7-v2 introduces @j2sAlias as a way of adding a custom method name, as in exports. |
@@ -2004,7 +2005,8 @@ private boolean addClassOrInterface(ASTNode node, ITypeBinding binding, List<?> |
2004 | 2005 | this$0Name0 = this$0Name; |
2005 | 2006 | this$0Name = null; |
2006 | 2007 | finalShortClassName = getFinalJ2SClassName( |
2007 | | - (isLambda ? getMyJavaClassNameLambda(true) : getUnreplacedJavaClassNameQualified(binding)), FINAL_P); |
| 2008 | + (isLambda ? getMyJavaClassNameLambda(true) : getUnreplacedJavaClassNameQualified(binding)), |
| 2009 | + FINAL_P); |
2008 | 2010 | if (finalShortClassName.startsWith("P$.")) { |
2009 | 2011 | // java.lang.x will return x, not P$.x |
2010 | 2012 | finalShortClassName = finalShortClassName.substring(3); |
@@ -2143,14 +2145,24 @@ private boolean addClassOrInterface(ASTNode node, ITypeBinding binding, List<?> |
2143 | 2145 | } else { |
2144 | 2146 | hasDependents = true; |
2145 | 2147 | String superclassName = getUnreplacedJavaClassNameQualified(superclass); |
2146 | | - if (superclassName == null || superclassName.length() == 0 || "java.lang.Object".equals(superclassName)) { |
| 2148 | + switch (superclassName == null ? "" : superclassName) { |
| 2149 | + case "": |
| 2150 | + case "java.lang.Object": |
2147 | 2151 | buffer.append("null"); |
2148 | | - } else { |
| 2152 | + break; |
| 2153 | + case "java.awt.Component": |
| 2154 | + buffer.append("'java.awt.Label'"); |
| 2155 | + break; |
| 2156 | + case "javax.swing.JComponent": |
| 2157 | + buffer.append("'javax.swing.JLabel'"); |
| 2158 | + break; |
| 2159 | + default: |
2149 | 2160 | if (isAnonymous) { |
2150 | 2161 | buffer.append(getFinalJ2SClassNameQualifier(null, superclass, superclassName, FINAL_ESCAPE)); |
2151 | 2162 | } else { |
2152 | 2163 | buffer.append(getFinalInnerClassList(superclass, superclassName)); |
2153 | 2164 | } |
| 2165 | + break; |
2154 | 2166 | } |
2155 | 2167 | } |
2156 | 2168 |
|
@@ -2183,7 +2195,8 @@ private boolean addClassOrInterface(ASTNode node, ITypeBinding binding, List<?> |
2183 | 2195 | int pt = buffer.length(); |
2184 | 2196 | while (!b.isTopLevel()) { |
2185 | 2197 | b = b.getDeclaringClass(); |
2186 | | - buffer.insert(pt, "'" + getFinalJ2SClassName(getUnreplacedJavaClassNameQualified(b), FINAL_RAW) + "',"); |
| 2198 | + buffer.insert(pt, |
| 2199 | + "'" + getFinalJ2SClassName(getUnreplacedJavaClassNameQualified(b), FINAL_RAW) + "',"); |
2187 | 2200 | } |
2188 | 2201 | } |
2189 | 2202 | buffer.append("'"); |
|
0 commit comments