Skip to content

Commit aab27b3

Browse files
authored
Merge pull request #85 from BobHanson/hanson1
Hanson1
2 parents c33dfec + b2eb313 commit aab27b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1246
-631
lines changed
1.13 KB
Binary file not shown.
117 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181106221821
1+
20181114074826
1.13 KB
Binary file not shown.
117 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181106221821
1+
20181114074826

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public class CorePlugin extends Plugin {
1919
* register the bundle version properly. So we use VERSION here instead.
2020
*
2121
*/
22-
public static String VERSION = "3.2.4.02";
22+
public static String VERSION = "3.2.4.04";
23+
// BH 11/10/2018 -- 3.2.4.04 additional support for JAXB
2324
// BH 11/04/2018 -- 3.2.4.02 support for JAXB - all accessor types, ObjectFactory, package-level namespace, but not yet accessor type
2425
// BH 10/27/2018 -- 3.2.4.01 support for JAXB FIELD+propOrder and NONE types
2526
// BH 9/28/2018 -- 3.2.4.00 adds minimal support for JAXB

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

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {
1.13 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/Component.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,7 @@ public void setCursor(Cursor cursor) {
28722872
final void updateCursorImmediately() {
28732873
// this is the key method that updates a JComponent if there is
28742874
// no layout manager -- for example, for a JDesktop.
2875-
JSToolkit.setCursor(this, cursor);
2875+
//JSToolkit.setCursor(this, cursor);
28762876
// TODO
28772877
// if (peer instanceof LightweightPeer) {
28782878
// Container nativeContainer = getNativeContainer();

0 commit comments

Comments
 (0)