Skip to content

Commit ef4a5e7

Browse files
authored
Merge pull request #82 from BobHanson/hanson1
Hanson1
2 parents 7f88d7e + 0afb37f commit ef4a5e7

File tree

84 files changed

+7126
-4562
lines changed

Some content is hidden

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

84 files changed

+7126
-4562
lines changed
17.3 KB
Binary file not shown.
12 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190121000416
1+
20190204180153
17.3 KB
Binary file not shown.
12 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190121000416
1+
20190204180153

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ 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.06";
22+
public static String VERSION = "3.2.4.07";
23+
// TODO/NOTE final static int FOO = (/**@j2sNative 5 || */3) stated but not recognized when used as its new value
24+
// BH 2/3/2019 -- 3.2.4.07 fixes "final static Float = (float)" missing definition
2325
// BH 1/2/2019 -- 3.2.4.06 fixes try(resources) with more than one resource missing semicolon
2426
// BH 12/13/2018 -- 3.2.4.05 fixes problem with OuterClass.this.foo() not using .apply()
2527
// BH 11/10/2018 -- 3.2.4.04 additional support for JAXB

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,13 +2198,13 @@ private boolean addFieldDeclaration(FieldDeclaration field, int mode) {
21982198
VariableDeclarationFragment identifier = (VariableDeclarationFragment) fragments.get(0);
21992199
IVariableBinding var = identifier.resolveBinding();
22002200
Type nodeType = (var != null && var.getType().isArray() ? null : field.getType());
2201-
Code code = (nodeType == null || !nodeType.isPrimitiveType() ? null
2202-
: ((PrimitiveType) nodeType).getPrimitiveTypeCode());
2201+
boolean isPrimitive = (nodeType != null && nodeType.isPrimitiveType());
2202+
Code code = (isPrimitive ? ((PrimitiveType) nodeType).getPrimitiveTypeCode() : null);
22032203
// have to check here for final Object = "foo", as that must not be ignored.
2204-
boolean checkFinalConstant = (isStatic && Modifier.isFinal(field.getModifiers()) && var != null
2205-
&& !var.getType().getQualifiedName().equals("java.lang.Object"));
2204+
boolean checkFinalConstant = ((isPrimitive || var != null && var.getType().getQualifiedName().equals("java.lang.String"))
2205+
&& isStatic && Modifier.isFinal(field.getModifiers()));
22062206
if (needDefault)
2207-
addJ2SDoc(field);
2207+
addJ2SDoc(field);
22082208
int len0 = buffer.length();
22092209
for (Iterator<?> iter = fragments.iterator(); iter.hasNext();) {
22102210
VariableDeclarationFragment fragment = (VariableDeclarationFragment) iter.next();
17.3 KB
Binary file not shown.

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

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ protected void invalidateComp() {
26792679
if (!isMaximumSizeSet()) {
26802680
maxSize = null;
26812681
}
2682-
if (parent != null) {
2682+
if (parent != null && _j2sInvalidateOnAdd) {
26832683
parent.invalidateIfValid();
26842684
}
26852685
// }
@@ -5046,7 +5046,9 @@ protected final void disableEvents(long eventsToDisable) {
50465046
* @see #isCoalescingEnabled
50475047
* @see #checkCoalescing
50485048
*/
5049-
transient private boolean coalescingEnabled = checkCoalescing();
5049+
transient private boolean coalescingEnabled = checkCoalescing();
5050+
5051+
public boolean _j2sInvalidateOnAdd = true; // not for menu items?
50505052

50515053
/**
50525054
* Weak map of known coalesceEvent overriders. Value indicates whether
@@ -5827,7 +5829,8 @@ protected void addNotifyComp() {
58275829
// relocateComponent();
58285830
// }
58295831
// }
5830-
invalidate();
5832+
if (_j2sInvalidateOnAdd )
5833+
invalidate();
58315834

58325835
// int npopups = (popups != null? popups.size() : 0);
58335836
// SwingJS TODO
@@ -6872,31 +6875,34 @@ boolean isAutoFocusTransferOnDisposal() {
68726875
return autoFocusTransferOnDisposal;
68736876
}
68746877

6875-
// /**
6876-
// * Adds the specified popup menu to the component.
6877-
// * @param popup the popup menu to be added to the component.
6878-
// * @see #remove(MenuComponent)
6879-
// * @exception NullPointerException if {@code popup} is {@code null}
6880-
// * @since JDK1.1
6881-
// */
6882-
// public void add(PopupMenu popup) {
6883-
// synchronized (getTreeLock()) {
6884-
// if (popup.parent != null) {
6885-
// popup.parent.remove(popup);
6886-
// }
6887-
// if (popups == null) {
6888-
// popups = new Vector();
6889-
// }
6890-
// popups.addElement(popup);
6891-
// popup.parent = this;
6892-
//
6893-
// if (peer != null) {
6894-
// if (popup.peer == null) {
6895-
// popup.addNotify();
6896-
// }
6897-
// }
6898-
// }
6899-
// }
6878+
/**
6879+
* Adds the specified popup menu to the component.
6880+
*
6881+
* @param popup the popup menu to be added to the component.
6882+
* @see #remove(MenuComponent)
6883+
* @exception NullPointerException if {@code popup} is {@code null}
6884+
* @since JDK1.1
6885+
*/
6886+
public void add(PopupMenu popup) {
6887+
popup.setInvoker(this);
6888+
// synchronized (getTreeLock()) {
6889+
// if (popup.parent != null) {
6890+
// popup.parent.remove(popup);
6891+
// }
6892+
// if (popups == null) {
6893+
// popups = new Vector();
6894+
// }
6895+
// popups.addElement(popup);
6896+
// popup.setInvoker(this);
6897+
//// popup.parent = (JComponent) this;
6898+
//
6899+
// if (peer != null) {
6900+
// if (popup.peer == null) {
6901+
// popup.addNotify();
6902+
// }
6903+
// }
6904+
// }
6905+
}
69006906

69016907
// /**
69026908
// * Removes the specified popup menu from the component.

0 commit comments

Comments
 (0)