Skip to content

Commit b70e70e

Browse files
hansonrhansonr
authored andcommitted
removes unnecessary synthetic reference for inner class ref
1 parent 4f44662 commit b70e70e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
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));
@@ -6432,7 +6435,6 @@ private static void addImplicitJAXBFieldsAndMethods(int accessType, TrailingBuff
64326435
}
64336436
return;
64346437
default:
6435-
System.out.println(">>>addImplicitJAXB accessType: " + accessType + " f=" + fields.size() + " m=" + methods.size());
64366438
boolean isUnspecified = (accessType == JAXB_TYPE_UNSPECIFIED);
64376439
boolean publicOnly = (accessType == JAXB_TYPE_PUBLIC_MEMBER);
64386440
if (accessType != JAXB_TYPE_PROPERTY) {

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ protected void setHorizontalButtonAlignments(JComponent b, int pos, int align) {
15891589
//
15901590
boolean ltr = jc.getComponentOrientation().isLeftToRight();
15911591
boolean alignLeft, alignRight, centered, text0;
1592-
1592+
String px0 = "0px";
15931593
if (menuAnchorNode == null) {
15941594
alignLeft = (align == SwingConstants.LEFT
15951595
|| align == (ltr ? SwingConstants.LEADING : SwingConstants.TRAILING));
@@ -1608,6 +1608,13 @@ protected void setHorizontalButtonAlignments(JComponent b, int pos, int align) {
16081608
alignRight = !ltr;
16091609
centered = false;
16101610
text0 = false;
1611+
if (alignRight) {
1612+
if (buttonNode != null) {
1613+
DOMNode.setStyles(buttonNode, "right","0");
1614+
} else {
1615+
System.out.println("HHHMMM");
1616+
}
1617+
}
16111618
}
16121619

16131620
String poslr = (alignRight ? "right" : "left");

0 commit comments

Comments
 (0)