@@ -3440,6 +3440,9 @@ private String getThisRefOrSyntheticReference(ASTNode node, ITypeBinding binding
34403440 ASTNode classNode = (node == null ? null : getAbstractOrAnonymousParentForNode (node ));
34413441 if (class_isAnonymousOrLocal || classNode != null && classNode .getParent () != null // CompilationUnit
34423442 && classNode .getParent ().getParent () != null ) {
3443+ // not the top level, but "this" refers to this class
3444+ if (binding .getBinaryName ().equals (class_typeBinding .getBinaryName ()))
3445+ return ref ;
34433446 // not the top level -- add the synthetic reference.
34443447 // anonymous and local will not have fully qualified names
34453448 return getSyntheticReference (getJavaClassNameQualified (binding ));
@@ -5419,29 +5422,36 @@ private boolean addAnnotation(Annotation annotation, ASTNode node, int mode) {
54195422 if (annName .startsWith ("J2SIgnore" )) {
54205423 return false ;
54215424 }
5422- } else if (qName .equals ("Override" )
5423- || qName .equals ("Deprecated" )
5424- || qName .startsWith ("Suppress" )
5425+ } else if (qName .equals ("Override" ) || qName .equals ("Deprecated" ) || qName .startsWith ("Suppress" )
54255426 || qName .startsWith ("ConstructorProperties" )) {
5426- // see java\awt\ScrollPane.js @ConstructorProperties({"scrollbarDisplayPolicy"})
5427+ // see java\awt\ScrollPane.js @ConstructorProperties({"scrollbarDisplayPolicy"})
54275428 // ignore
54285429 } else {
54295430 if (class_annotations == null )
54305431 class_annotations = new ArrayList <ClassAnnotation >();
5431- ClassAnnotation ann = new ClassAnnotation (qName , annotation , node );
5432- class_annotations .add (ann );
5432+ class_annotations .add (new ClassAnnotation (qName , annotation , node ));
54335433 if ("XmlAccessorType" .equals (qName )) {
5434- String s = annotation .toString ();
5435- class_jaxbAccessorType = (
5436- s .contains ("FIELD" ) ? JAXB_TYPE_FIELD
5434+ String s = annotation .toString ();
5435+ class_jaxbAccessorType = (s .contains ("FIELD" ) ? JAXB_TYPE_FIELD
54375436 : s .contains ("PUBLIC" ) ? JAXB_TYPE_PUBLIC_MEMBER
5438- : s .contains ("PROPERTY" ) ? JAXB_TYPE_PROPERTY
5439- : JAXB_TYPE_NONE );
5437+ : s .contains ("PROPERTY" ) ? JAXB_TYPE_PROPERTY : JAXB_TYPE_NONE );
54405438 } else if (qName .startsWith ("XmlEnum" )) {
54415439 class_jaxbAccessorType = JAXB_TYPE_ENUM ;
54425440 } else if (class_jaxbAccessorType == JAXB_TYPE_UNKNOWN && qName .startsWith ("Xml" )) {
54435441 System .out .println (">>>unspecified!" );
54445442 class_jaxbAccessorType = JAXB_TYPE_UNSPECIFIED ;
5443+ } else if ("XmlElements" .equals (qName ) && annotation .isSingleMemberAnnotation ()) {
5444+ Expression e = ((SingleMemberAnnotation ) annotation ).getValue ();
5445+ if (e instanceof ArrayInitializer ) {
5446+ List <Expression > expressions = ((ArrayInitializer ) e ).expressions ();
5447+ for (int i = expressions .size (); --i >= 0 ;) {
5448+ Expression exp = expressions .get (i );
5449+ if (exp instanceof Annotation ) {
5450+ class_annotations .add (new ClassAnnotation (qName , (Annotation ) exp , node ));
5451+ }
5452+ }
5453+ }
5454+
54455455 }
54465456 }
54475457 return true ;
@@ -6425,7 +6435,6 @@ private static void addImplicitJAXBFieldsAndMethods(int accessType, TrailingBuff
64256435 }
64266436 return ;
64276437 default :
6428- System .out .println (">>>addImplicitJAXB accessType: " + accessType + " f=" + fields .size () + " m=" + methods .size ());
64296438 boolean isUnspecified = (accessType == JAXB_TYPE_UNSPECIFIED );
64306439 boolean publicOnly = (accessType == JAXB_TYPE_PUBLIC_MEMBER );
64316440 if (accessType != JAXB_TYPE_PROPERTY ) {
0 commit comments