Skip to content

Commit 110753a

Browse files
hansonrhansonr
authored andcommitted
fixes for Integer, Long, and System.properties
1 parent a27599b commit 110753a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// TODO: CharacterSequence does not implement Java 8 default methods chars() or codePoints()
1111
// It is possible that these might be loaded dynamically.
1212

13+
// BH 9/29/2018 3.2.4.00 adds JAXB support
1314
// BH 9/23/2018 3.2.3.00 adds direct non-Swing applet support (java.applet.Applet and java.awt.*); no need for converting source to a2s.*
1415
// BH 9/15/2018 3.2.2.06 adds JScrollBar block and unit increments; fixes JLabel ui getMaximumSize
1516
// BH 9/15/2018 3.2.2.05 fixes Math.IEEEremainder
@@ -744,6 +745,8 @@ Clazz.newMeth = function (clazzThis, funName, funBody, modifiers) {
744745

745746
var isStatic = (modifiers == 1 || modifiers == 2);
746747
var isPrivate = (typeof modifiers == "object");
748+
if (isPrivate)
749+
C$.$P$ = modifiers;
747750
Clazz.saemCount0++;
748751
funBody.exName = funName; // mark it as one of our methods
749752
funBody.exClazz = clazzThis; // make it traceable
@@ -3276,6 +3279,12 @@ java.lang.System = System = {
32763279
case "os.version":
32773280
v = navigator.userAgent;
32783281
break;
3282+
case "javax.xml.datatype.DatatypeFactory":
3283+
v = "org.apache.xerces.jaxp.datatype";
3284+
break;
3285+
case "javax.xml.bind.JAXBContextFactory":
3286+
v = "swingjs.JSJAXBContextFactory";
3287+
break;
32793288
}
32803289
if (v)
32813290
return System.$props[key] = v;
@@ -3544,8 +3553,7 @@ Integer.reverseBytes = m$(Integer,"reverseBytes$I",
35443553
((i << 24));
35453554
}, 1);
35463555

3547-
m$(Integer,"signum$",
3548-
function(i){ return (i >> 31) | (-i >>> 31); }, 1);
3556+
m$(Integer,"signum$I", function(i){ return i < 0 ? -1 : i > 0 ? 1 : 0; }, 1);
35493557

35503558
m$(Integer,"min$I$I",
35513559
function(a,b) { return Math.min(a,b); }, 1);
@@ -3735,8 +3743,7 @@ Long.min$J$J = Integer.min$I$I;
37353743
Long.max$J$J = Integer.max$I$I;
37363744
Long.sum$J$J = Integer.sum$I$I;
37373745

3738-
3739-
3746+
m$(Long,"signum$J", function(i){ return i < 0 ? -1 : i > 0 ? 1 : 0; }, 1);
37403747

37413748
Clazz._setDeclared("java.lang.Short", java.lang.Short = Short = function(){
37423749
if (typeof arguments[0] != "object")this.c$(arguments[0]);

0 commit comments

Comments
 (0)