Skip to content

Commit a737bf2

Browse files
authored
Merge pull request #182 from BobHanson/hanson1
Swingjs-Site.zip updated
2 parents 0f99b47 + 0b8b02b commit a737bf2

File tree

8 files changed

+69
-5
lines changed

8 files changed

+69
-5
lines changed
11 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201121045945
1+
20201127044806
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201120135241
1+
20201127032339
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201121045945
1+
20201127044806
11 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/test/Test_Future.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ private void btnAction() {
6363
});
6464
dialogExecutor.submit(() -> {
6565
System.out.println("dialog runnable 3");
66-
System.out.println(future.toString());
66+
System.out.println(f.toString() + f.isDone());
6767
});
6868
System.out.println("CompletionStage started");
69-
System.out.println(future.toString());
69+
System.out.println(f.toString() + f.isDone());
7070

7171

7272
}

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17414,6 +17414,70 @@ Math.rint || (Math.rint = function(a) {
1741417414
return Math.round(a) + ((b = a % 1) != 0.5 && b != -0.5 ? 0 : (b = Math.round(a % 2)) > 0 ? b - 2 : b);
1741517415
});
1741617416

17417+
// Java 1.8
17418+
17419+
Math.addExact = function(x, y) {
17420+
var r = x + y;
17421+
// HD 2-12 Overflow iff both arguments have the opposite sign of the result
17422+
if (((x ^ r) & (y ^ r)) < 0) {
17423+
throw new ArithmeticException("integer overflow");
17424+
}
17425+
return r;
17426+
}
17427+
17428+
17429+
Math.subtractExact = function(x, y) {
17430+
var r = x - y;
17431+
// HD 2-12 Overflow iff the arguments have different signs and
17432+
// the sign of the result is different than the sign of x
17433+
if (((x ^ y) & (x ^ r)) < 0) {
17434+
throw new ArithmeticException("integer overflow");
17435+
}
17436+
return r;
17437+
}
17438+
17439+
Math.multiplyExact = function(x, y) {
17440+
var r = x * y;
17441+
if ((r | 0) != r) {
17442+
throw new ArithmeticException("integer overflow");
17443+
}
17444+
return r;
17445+
}
17446+
Math.incrementExact = function(a) {
17447+
if (a == Integer.MAX_VALUE) {
17448+
throw new ArithmeticException("integer overflow");
17449+
}
17450+
return a + 1;
17451+
}
17452+
17453+
Math.decrementExact = function(a) {
17454+
if (a == Integer.MIN_VALUE) {
17455+
throw new ArithmeticException("integer overflow");
17456+
}
17457+
return a - 1;
17458+
}
17459+
17460+
Math.negateExact = function(a) {return -a}
17461+
17462+
Math.toIntExact = function(value) {
17463+
if ((value | 0) != value) {
17464+
throw new ArithmeticException("integer overflow");
17465+
}
17466+
return value;
17467+
}
17468+
Math.toIntExact = function(a) { return a}
17469+
17470+
Math.floorDiv || (Math.floorDiv = function(x,y) {
17471+
var r = (x / y) | 0;
17472+
if ((x ^ y) < 0 && (r * y != x)) {
17473+
r--;
17474+
}
17475+
return r;
17476+
})
17477+
17478+
Math.floorMod || (Math.floorMod = function(x,y) { return x - Math.floorDiv(x, y) * y; })
17479+
17480+
//
1741717481
Math.log10||(Math.log10=function(a){return Math.log(a)/Math.E});
1741817482

1741917483
Math.hypot||(Math.hypot=function(x,y){return Math.sqrt(Math.pow(x,2)+Math.pow(y,2))});

0 commit comments

Comments
 (0)