diff --git a/checkstyle.xml b/checkstyle.xml index 7a722e45b..efcddfc2d 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -1,6 +1,7 @@ + diff --git a/classlib/src/main/java/org/teavm/classlib/impl/ScalaHacks.java b/classlib/src/main/java/org/teavm/classlib/impl/ScalaHacks.java index 3c4918feb..b03de9a71 100644 --- a/classlib/src/main/java/org/teavm/classlib/impl/ScalaHacks.java +++ b/classlib/src/main/java/org/teavm/classlib/impl/ScalaHacks.java @@ -47,11 +47,10 @@ public class ScalaHacks implements ClassHolderTransformer { transformProperties(cls); break; default: - { if (cls.getName().endsWith(SCALA_INTERNAL_CLASS_MARKER)) { checkAndRemoveExportAnnotation(cls); } - } break; + break; } } diff --git a/classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeHelper.java b/classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeHelper.java index dcf38ca50..9c0a5efa6 100644 --- a/classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeHelper.java +++ b/classlib/src/main/java/org/teavm/classlib/impl/unicode/UnicodeHelper.java @@ -16,7 +16,6 @@ package org.teavm.classlib.impl.unicode; import java.util.Arrays; - import org.teavm.classlib.impl.Base46; import org.teavm.classlib.impl.CharFlow; diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java b/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java index 6da3e41ae..33e7e633b 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TOptional.java @@ -21,7 +21,6 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.function.Supplier; - import org.teavm.classlib.java.util.stream.TStream; public final class TOptional { diff --git a/classlib/src/main/java/org/threeten/bp/LocalDateTime.java b/classlib/src/main/java/org/threeten/bp/LocalDateTime.java index 1f50ddf57..d688fdceb 100644 --- a/classlib/src/main/java/org/threeten/bp/LocalDateTime.java +++ b/classlib/src/main/java/org/threeten/bp/LocalDateTime.java @@ -1410,15 +1410,15 @@ public final class LocalDateTime if ((hours | minutes | seconds | nanos) == 0) { return with(newDate, time); } - long totDays = nanos / NANOS_PER_DAY + // max/24*60*60*1B - seconds / SECONDS_PER_DAY + // max/24*60*60 - minutes / MINUTES_PER_DAY + // max/24*60 - hours / HOURS_PER_DAY; // max/24 + long totDays = nanos / NANOS_PER_DAY // max/24*60*60*1B + + seconds / SECONDS_PER_DAY // max/24*60*60 + + minutes / MINUTES_PER_DAY // max/24*60 + + hours / HOURS_PER_DAY; // max/24 totDays *= sign; // total max*0.4237... - long totNanos = nanos % NANOS_PER_DAY + // max 86400000000000 - (seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND + // max 86400000000000 - (minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE + // max 86400000000000 - (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000 + long totNanos = nanos % NANOS_PER_DAY // max 86400000000000 + + (seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND // max 86400000000000 + + (minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE // max 86400000000000 + + (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000 long curNoD = time.toNanoOfDay(); // max 86400000000000 totNanos = totNanos * sign + curNoD; // total 432000000000000 totDays += Jdk8Methods.floorDiv(totNanos, NANOS_PER_DAY); diff --git a/classlib/src/main/java/org/threeten/bp/chrono/ChronoLocalDateTimeImpl.java b/classlib/src/main/java/org/threeten/bp/chrono/ChronoLocalDateTimeImpl.java index 6c952b4eb..cef9ccbab 100644 --- a/classlib/src/main/java/org/threeten/bp/chrono/ChronoLocalDateTimeImpl.java +++ b/classlib/src/main/java/org/threeten/bp/chrono/ChronoLocalDateTimeImpl.java @@ -307,14 +307,14 @@ final class ChronoLocalDateTimeImpl if ((hours | minutes | seconds | nanos) == 0) { return with(newDate, time); } - long totDays = nanos / NANOS_PER_DAY + // max/24*60*60*1B - seconds / SECONDS_PER_DAY + // max/24*60*60 - minutes / MINUTES_PER_DAY + // max/24*60 - hours / HOURS_PER_DAY; // max/24 - long totNanos = nanos % NANOS_PER_DAY + // max 86400000000000 - (seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND + // max 86400000000000 - (minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE + // max 86400000000000 - (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000 + long totDays = nanos / NANOS_PER_DAY // max/24*60*60*1B + + seconds / SECONDS_PER_DAY // max/24*60*60 + + minutes / MINUTES_PER_DAY // max/24*60 + + hours / HOURS_PER_DAY; // max/24 + long totNanos = nanos % NANOS_PER_DAY // max 86400000000000 + + (seconds % SECONDS_PER_DAY) * NANOS_PER_SECOND // max 86400000000000 + + (minutes % MINUTES_PER_DAY) * NANOS_PER_MINUTE // max 86400000000000 + + (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000 long curNoD = time.toNanoOfDay(); // max 86400000000000 totNanos = totNanos + curNoD; // total 432000000000000 totDays += Jdk8Methods.floorDiv(totNanos, NANOS_PER_DAY); diff --git a/classlib/src/main/java/org/threeten/bp/chrono/Era.java b/classlib/src/main/java/org/threeten/bp/chrono/Era.java index 0f42503d1..83ed4d5cb 100644 --- a/classlib/src/main/java/org/threeten/bp/chrono/Era.java +++ b/classlib/src/main/java/org/threeten/bp/chrono/Era.java @@ -48,7 +48,6 @@ package org.threeten.bp.chrono; import static org.threeten.bp.temporal.ChronoField.ERA; import java.util.Locale; - import org.threeten.bp.format.DateTimeFormatterBuilder; import org.threeten.bp.format.TextStyle; import org.threeten.bp.temporal.ChronoField; diff --git a/classlib/src/main/java/org/threeten/bp/temporal/JulianFields.java b/classlib/src/main/java/org/threeten/bp/temporal/JulianFields.java index b77fe5fed..3f435ff73 100644 --- a/classlib/src/main/java/org/threeten/bp/temporal/JulianFields.java +++ b/classlib/src/main/java/org/threeten/bp/temporal/JulianFields.java @@ -51,7 +51,6 @@ import static org.threeten.bp.temporal.ChronoUnit.DAYS; import static org.threeten.bp.temporal.ChronoUnit.FOREVER; import java.util.Locale; import java.util.Map; - import java.util.Objects; import org.threeten.bp.DateTimeException; import org.threeten.bp.chrono.Chronology; diff --git a/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyConversionTest.java b/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyConversionTest.java index 337bee801..fc1572e86 100644 --- a/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyConversionTest.java +++ b/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyConversionTest.java @@ -70,40 +70,40 @@ public class JavaScriptBodyConversionTest { assertEquals(int[].class, returnAsIntArray(new Integer[] { 23, 42 }).getClass()); } - @JavaScriptBody(args = { "value" }, body = "return value;") + @JavaScriptBody(args = "value", body = "return value;") private native int returnAsInt(Object value); - @JavaScriptBody(args = { "value" }, body = "return value;") + @JavaScriptBody(args = "value", body = "return value;") private native boolean returnAsBoolean(Object value); - @JavaScriptBody(args = { "value" }, body = "return value;") + @JavaScriptBody(args = "value", body = "return value;") private native Boolean returnAsBooleanWrapper(boolean value); - @JavaScriptBody(args = { "value" }, body = "return value;") + @JavaScriptBody(args = "value", body = "return value;") private native Integer returnAsInteger(Integer value); - @JavaScriptBody(args = { "value" }, body = "return value;") + @JavaScriptBody(args = "value", body = "return value;") private native Object returnAsObject(int value); - @JavaScriptBody(args = { "value" }, body = "return value + 1;") + @JavaScriptBody(args = "value", body = "return value + 1;") private native int addOne(Object value); - @JavaScriptBody(args = { "value" }, body = "return value + 1;") + @JavaScriptBody(args = "value", body = "return value + 1;") private native Integer addOne(Integer value); - @JavaScriptBody(args = { "value" }, body = "return value + 1;") + @JavaScriptBody(args = "value", body = "return value + 1;") private native int addOne(int value); - @JavaScriptBody(args = { "array" }, body = "return array;") + @JavaScriptBody(args = "array", body = "return array;") private native Object returnAsObject(Object array); - @JavaScriptBody(args = { "array" }, body = "return array;") + @JavaScriptBody(args = "array", body = "return array;") private native int[] returnAsIntArray(Object array); - @JavaScriptBody(args = { "array" }, body = "return array;") + @JavaScriptBody(args = "array", body = "return array;") private native Integer[] returnAsIntegerArray(Object array); - @JavaScriptBody(args = { "value" }, body = "value[0] = 1; return value;") + @JavaScriptBody(args = "value", body = "value[0] = 1; return value;") private native Object modifyIntegerArray(Object value); @JavaScriptBody(args = { "array", "index" }, body = "return array[index];") diff --git a/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyTest.java b/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyTest.java index b1f4683ac..0507a192a 100644 --- a/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyTest.java +++ b/html4j/src/test/java/org/teavm/html4j/test/JavaScriptBodyTest.java @@ -90,19 +90,19 @@ public class JavaScriptBodyTest { @JavaScriptBody(args = {}, body = "return 23;") private native int simpleNativeMethod(); - @JavaScriptBody(args = { "value" }, body = "return value;") + @JavaScriptBody(args = "value", body = "return value;") private native Object returnValuePassed(Object value); - @JavaScriptBody(args = { "obj" }, body = "window._global_ = obj;") + @JavaScriptBody(args = "obj", body = "window._global_ = obj;") private native void storeObject(Object obj); @JavaScriptBody(args = {}, body = "return window._global_;") private native Object retrieveObject(); - @JavaScriptBody(args = { "callback" }, body = "return callback.@org.teavm.html4j.test.A::foo()()", javacall = true) + @JavaScriptBody(args = "callback", body = "return callback.@org.teavm.html4j.test.A::foo()()", javacall = true) private native int invokeCallback(A callback); - @JavaScriptBody(args = { "callback" }, body = "" + @JavaScriptBody(args = "callback", body = "" + "return callback." + "@org.teavm.html4j.test.B::bar(" + "Lorg/teavm/html4j/test/A;)(_global_)", @@ -113,7 +113,7 @@ public class JavaScriptBodyTest { return a.foo(); } - @JavaScriptBody(args = { "a" }, body = "return " + @JavaScriptBody(args = "a", body = "return " + "@org.teavm.html4j.test.JavaScriptBodyTest::staticCallback(" + "Lorg/teavm/html4j/test/A;)(a)", javacall = true) private native int invokeStaticCallback(A a); diff --git a/jso/apis/src/main/java/org/teavm/jso/ajax/ReadyStateChangeHandler.java b/jso/apis/src/main/java/org/teavm/jso/ajax/ReadyStateChangeHandler.java index 0a5f73ff2..d32fe59d6 100644 --- a/jso/apis/src/main/java/org/teavm/jso/ajax/ReadyStateChangeHandler.java +++ b/jso/apis/src/main/java/org/teavm/jso/ajax/ReadyStateChangeHandler.java @@ -16,7 +16,6 @@ package org.teavm.jso.ajax; import org.teavm.jso.JSFunctor; - import org.teavm.jso.JSObject; @JSFunctor diff --git a/jso/apis/src/main/java/org/teavm/jso/browser/Window.java b/jso/apis/src/main/java/org/teavm/jso/browser/Window.java index ff0fd36b9..1b7e57faa 100644 --- a/jso/apis/src/main/java/org/teavm/jso/browser/Window.java +++ b/jso/apis/src/main/java/org/teavm/jso/browser/Window.java @@ -105,7 +105,7 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv @JSBody(params = { "handler", "delay" }, script = "return setTimeout(handler, delay);") public static native int setTimeout(TimerHandler handler, double delay); - @JSBody(params = { "timeoutId" }, script = "clearTimeout(timeoutId);") + @JSBody(params = "timeoutId", script = "clearTimeout(timeoutId);") public static native void clearTimeout(int timeoutId); @JSBody(params = { "handler", "delay" }, script = "return setInterval(handler, delay);") @@ -114,13 +114,13 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv @JSBody(params = { "handler", "delay" }, script = "return setInterval(handler, delay);") public static native int setInterval(TimerHandler handler, double delay); - @JSBody(params = { "timeoutId" }, script = "clearInterval(timeoutId);") + @JSBody(params = "timeoutId", script = "clearInterval(timeoutId);") public static native void clearInterval(int timeoutId); - @JSBody(params = { "callback" }, script = "return requestAnimationFrame(callback);") + @JSBody(params = "callback", script = "return requestAnimationFrame(callback);") public static native int requestAnimationFrame(AnimationFrameCallback callback); - @JSBody(params = { "requestId" }, script = "cancelAnimationFrame(requestId);") + @JSBody(params = "requestId", script = "cancelAnimationFrame(requestId);") public static native void cancelAnimationFrame(int requestId); public abstract void blur(); diff --git a/jso/apis/src/main/java/org/teavm/jso/json/JSON.java b/jso/apis/src/main/java/org/teavm/jso/json/JSON.java index fb308c06c..ff9073b1d 100644 --- a/jso/apis/src/main/java/org/teavm/jso/json/JSON.java +++ b/jso/apis/src/main/java/org/teavm/jso/json/JSON.java @@ -22,9 +22,9 @@ public final class JSON { private JSON() { } - @JSBody(params = { "object" }, script = "return JSON.stringify(object);") + @JSBody(params = "object", script = "return JSON.stringify(object);") public static native String stringify(JSObject object); - @JSBody(params = { "string" }, script = "return JSON.parse(string);") + @JSBody(params = "string", script = "return JSON.parse(string);") public static native JSObject parse(String string); } diff --git a/pom.xml b/pom.xml index cfc3f7475..46f3d7235 100644 --- a/pom.xml +++ b/pom.xml @@ -105,6 +105,7 @@ 1.6 3.0.0 3.4.3 + 8.41 false 1 @@ -337,6 +338,13 @@ org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} + + + com.puppycrawl.tools + checkstyle + ${checkstyle.version} + + validate diff --git a/tests/src/test/java/org/teavm/classlib/java/net/URLDecoderTest.java b/tests/src/test/java/org/teavm/classlib/java/net/URLDecoderTest.java index 1430d3f97..7db5ea369 100644 --- a/tests/src/test/java/org/teavm/classlib/java/net/URLDecoderTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/net/URLDecoderTest.java @@ -22,7 +22,6 @@ import static org.junit.Assert.fail; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; - import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; diff --git a/tests/src/test/java/org/teavm/classlib/java/net/URLEncoderTest.java b/tests/src/test/java/org/teavm/classlib/java/net/URLEncoderTest.java index cc32787ca..773c55857 100644 --- a/tests/src/test/java/org/teavm/classlib/java/net/URLEncoderTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/net/URLEncoderTest.java @@ -21,7 +21,6 @@ import static org.junit.Assert.fail; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; - import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/AbstractDateTimeTest.java b/tests/src/test/java/org/teavm/classlib/java/time/AbstractDateTimeTest.java index 66202566e..7fba49b40 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/AbstractDateTimeTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/AbstractDateTimeTest.java @@ -48,12 +48,10 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; - import java.time.DateTimeException; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import java.util.List; - import org.testng.annotations.Test; /** diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java index 111d7d068..2aa318fdd 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; - import java.time.Clock; import java.time.Instant; import java.time.ZoneId; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java index d13c8bc72..349b1ee94 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java @@ -48,7 +48,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; - import java.time.Clock; import java.time.Instant; import java.time.LocalDateTime; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java index 76d49f692..c627f9d53 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java @@ -48,7 +48,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; - import java.time.Clock; import java.time.Duration; import java.time.Instant; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java index 236647bb4..d8df822b8 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java @@ -49,7 +49,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; import static org.testng.Assert.fail; - import java.time.Clock; import java.time.Instant; import java.time.ZoneId; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java index 84eed386c..6dcddf090 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java @@ -48,7 +48,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; - import java.time.Clock; import java.time.Duration; import java.time.Instant; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java index 7f7cb828f..6a7759abc 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; - import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; import org.teavm.junit.WholeClassCompilation; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java index 49eaeb7e6..144f31537 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java @@ -52,7 +52,6 @@ import static java.time.DayOfWeek.WEDNESDAY; import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; - import java.time.DateTimeException; import java.time.DayOfWeek; import java.time.LocalDate; @@ -69,7 +68,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; - import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; import org.teavm.junit.WholeClassCompilation; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java index 1d1b9c4b3..9af7594a6 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java @@ -57,14 +57,12 @@ import static java.time.temporal.ChronoUnit.SECONDS; import static java.time.temporal.ChronoUnit.WEEKS; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; - import java.time.DateTimeException; import java.time.Duration; import java.time.Instant; import java.time.format.DateTimeParseException; import java.time.temporal.TemporalUnit; import java.util.Locale; - import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; import org.teavm.junit.WholeClassCompilation; @@ -900,13 +898,13 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), expectedNanoOfSecond); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void plusSeconds_long_overflowTooBig() { Duration t = Duration.ofSeconds(1, 0); t.plusSeconds(Long.MAX_VALUE); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void plusSeconds_long_overflowTooSmall() { Duration t = Duration.ofSeconds(-1, 0); t.plusSeconds(Long.MIN_VALUE); @@ -1002,7 +1000,7 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), 999999999); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void plusMillis_long_overflowTooBig() { Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999000000); t.plusMillis(1); @@ -1016,7 +1014,7 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), 0); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void plusMillis_long_overflowTooSmall() { Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0); t.plusMillis(-1); @@ -1106,13 +1104,13 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), expectedNanoOfSecond); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void plusNanos_long_overflowTooBig() { Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999999999); t.plusNanos(1); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void plusNanos_long_overflowTooSmall() { Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0); t.plusNanos(-1); @@ -1399,13 +1397,13 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), expectedNanoOfSecond); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusSeconds_long_overflowTooBig() { Duration t = Duration.ofSeconds(1, 0); t.minusSeconds(Long.MIN_VALUE + 1); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusSeconds_long_overflowTooSmall() { Duration t = Duration.ofSeconds(-2, 0); t.minusSeconds(Long.MAX_VALUE); @@ -1501,7 +1499,7 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), 999999999); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusMillis_long_overflowTooBig() { Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999000000); t.minusMillis(-1); @@ -1515,7 +1513,7 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), 0); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusMillis_long_overflowTooSmall() { Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0); t.minusMillis(1); @@ -1605,13 +1603,13 @@ public class TestDuration extends AbstractTest { assertEquals(t.getNano(), expectedNanoOfSecond); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusNanos_long_overflowTooBig() { Duration t = Duration.ofSeconds(Long.MAX_VALUE, 999999999); t.minusNanos(-1); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusNanos_long_overflowTooSmall() { Duration t = Duration.ofSeconds(Long.MIN_VALUE, 0); t.minusNanos(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java b/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java index 142207b38..1fcbde56a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java @@ -1177,13 +1177,13 @@ public class TestInstant extends AbstractDateTimeTest { assertEquals(i.getNano(), expectedNanoOfSecond); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusSeconds_long_overflowTooBig() { Instant i = Instant.ofEpochSecond(1, 0); i.minusSeconds(Long.MIN_VALUE + 1); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void minusSeconds_long_overflowTooSmall() { Instant i = Instant.ofEpochSecond(-2, 0); i.minusSeconds(Long.MAX_VALUE); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java index 670fae434..5e56ca30c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java @@ -521,7 +521,7 @@ public class TestLocalDate extends AbstractDateTimeTest { }; } - @Test(dataProvider = "sampleBadParse", expectedExceptions = {DateTimeParseException.class}) + @Test(dataProvider = "sampleBadParse", expectedExceptions = DateTimeParseException.class) public void factory_parse_invalidText(String unparsable) { LocalDate.parse(unparsable); } @@ -1069,7 +1069,7 @@ public class TestLocalDate extends AbstractDateTimeTest { assertEquals(test, LocalDate.of((int) (-40L + months / 12), 6 + (int) (months % 12), 1)); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusMonths_long_invalidTooLarge() { LocalDate.of(Year.MAX_VALUE, 12, 1).plusMonths(1); } @@ -1086,7 +1086,7 @@ public class TestLocalDate extends AbstractDateTimeTest { test.plusMonths(Long.MIN_VALUE); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusMonths_long_invalidTooSmall() { LocalDate.of(Year.MIN_VALUE, 1, 1).plusMonths(-1); } @@ -1147,22 +1147,22 @@ public class TestLocalDate extends AbstractDateTimeTest { assertEquals(t, expected); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusWeeks_invalidTooLarge() { LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(1); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusWeeks_invalidTooSmall() { LocalDate.of(Year.MIN_VALUE, 1, 7).plusWeeks(-1); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void test_plusWeeks_invalidMaxMinusMax() { LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MAX_VALUE); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void test_plusWeeks_invalidMaxMinusMin() { LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MIN_VALUE); } @@ -1223,12 +1223,12 @@ public class TestLocalDate extends AbstractDateTimeTest { assertEquals(t, expected); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusDays_invalidTooLarge() { LocalDate.of(Year.MAX_VALUE, 12, 31).plusDays(1); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusDays_invalidTooSmall() { LocalDate.of(Year.MIN_VALUE, 1, 1).plusDays(-1); } @@ -1424,7 +1424,7 @@ public class TestLocalDate extends AbstractDateTimeTest { assertEquals(test, LocalDate.of((int) (40L - months / 12), 6 - (int) (months % 12), 1)); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusMonths_long_invalidTooLarge() { LocalDate.of(Year.MAX_VALUE, 12, 1).minusMonths(-1); } @@ -1441,7 +1441,7 @@ public class TestLocalDate extends AbstractDateTimeTest { test.minusMonths(Long.MIN_VALUE); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusMonths_long_invalidTooSmall() { LocalDate.of(Year.MIN_VALUE, 1, 1).minusMonths(1); } @@ -1502,22 +1502,22 @@ public class TestLocalDate extends AbstractDateTimeTest { assertEquals(t, expected); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusWeeks_invalidTooLarge() { LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(-1); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusWeeks_invalidTooSmall() { LocalDate.of(Year.MIN_VALUE, 1, 7).minusWeeks(1); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void test_minusWeeks_invalidMaxMinusMax() { LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(Long.MAX_VALUE); } - @Test(expectedExceptions = {ArithmeticException.class}) + @Test(expectedExceptions = ArithmeticException.class) public void test_minusWeeks_invalidMaxMinusMin() { LocalDate.of(Year.MAX_VALUE, 12, 25).minusWeeks(Long.MIN_VALUE); } @@ -1578,12 +1578,12 @@ public class TestLocalDate extends AbstractDateTimeTest { assertEquals(t, expected); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusDays_invalidTooLarge() { LocalDate.of(Year.MAX_VALUE, 12, 31).minusDays(-1); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusDays_invalidTooSmall() { LocalDate.of(Year.MIN_VALUE, 1, 1).minusDays(1); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java index 93504ab91..4cf36f6e8 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java @@ -516,7 +516,7 @@ public class TestLocalTime extends AbstractDateTimeTest { }; } - @Test(dataProvider = "sampleBadParse", expectedExceptions = {DateTimeParseException.class}) + @Test(dataProvider = "sampleBadParse", expectedExceptions = DateTimeParseException.class) public void factory_parse_invalidText(String unparsable) { LocalTime.parse(unparsable); } @@ -538,7 +538,7 @@ public class TestLocalTime extends AbstractDateTimeTest { } //-----------------------------------------------------------------------s - @Test(expectedExceptions = {NullPointerException.class}) + @Test(expectedExceptions = NullPointerException.class) public void factory_parse_nullTest() { LocalTime.parse(null); } @@ -961,7 +961,7 @@ public class TestLocalTime extends AbstractDateTimeTest { }; } - @Test(groups = {"tck"}, dataProvider = "truncatedToValid") + @Test(groups = "tck", dataProvider = "truncatedToValid") public void test_truncatedTo_valid(LocalTime input, TemporalUnit unit, LocalTime expected) { assertEquals(input.truncatedTo(unit), expected); } @@ -976,12 +976,12 @@ public class TestLocalTime extends AbstractDateTimeTest { }; } - @Test(groups = {"tck"}, dataProvider = "truncatedToInvalid", expectedExceptions = DateTimeException.class) + @Test(groups = "tck", dataProvider = "truncatedToInvalid", expectedExceptions = DateTimeException.class) public void test_truncatedTo_invalid(LocalTime input, TemporalUnit unit) { input.truncatedTo(unit); } - @Test(expectedExceptions = NullPointerException.class, groups = {"tck"}) + @Test(expectedExceptions = NullPointerException.class, groups = "tck") public void test_truncatedTo_null() { test12x30x40x987654321.truncatedTo(null); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java index 6f36c8215..23867a3c1 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; - import java.time.DateTimeException; import java.time.Instant; import java.time.LocalDate; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java index ce5d582b0..d2e6815e6 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java @@ -406,23 +406,23 @@ public class TestOffsetTime extends AbstractDateTimeTest { }; } - @Test(dataProvider = "sampleBadParse", expectedExceptions = {DateTimeParseException.class}) + @Test(dataProvider = "sampleBadParse", expectedExceptions = DateTimeParseException.class) public void factory_parse_invalidText(String unparsable) { OffsetTime.parse(unparsable); } //-----------------------------------------------------------------------s - @Test(expectedExceptions = {DateTimeParseException.class}) + @Test(expectedExceptions = DateTimeParseException.class) public void factory_parse_illegalHour() { OffsetTime.parse("25:00+01:00"); } - @Test(expectedExceptions = {DateTimeParseException.class}) + @Test(expectedExceptions = DateTimeParseException.class) public void factory_parse_illegalMinute() { OffsetTime.parse("12:60+01:00"); } - @Test(expectedExceptions = {DateTimeParseException.class}) + @Test(expectedExceptions = DateTimeParseException.class) public void factory_parse_illegalSecond() { OffsetTime.parse("12:12:60+01:00"); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java b/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java index b613424b4..ae0eebc8d 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java @@ -48,7 +48,6 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; - import java.time.LocalDate; import java.time.Period; import org.junit.runner.RunWith; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java index df00a844f..b00d0c192 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java @@ -47,11 +47,9 @@ package org.teavm.classlib.java.time.format; import static org.testng.Assert.assertEquals; - import java.time.format.DecimalStyle; import java.util.Locale; import java.util.Set; - import org.junit.runner.RunWith; import org.teavm.junit.TeaVMProperties; import org.teavm.junit.TeaVMProperty; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/MockFieldNoValue.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/MockFieldNoValue.java index 2d317537b..dd3376a35 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/MockFieldNoValue.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/MockFieldNoValue.java @@ -48,7 +48,6 @@ package org.teavm.classlib.java.time.temporal; import static java.time.temporal.ChronoUnit.MONTHS; import static java.time.temporal.ChronoUnit.WEEKS; - import java.time.DateTimeException; import java.time.format.ResolverStyle; import java.time.temporal.Temporal; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java index fe41a5ee8..093df95c9 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time.temporal; import static org.testng.Assert.assertEquals; - import java.time.temporal.ChronoField; import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java index 934d91a5e..0a29d6642 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time.temporal; import static org.testng.Assert.assertEquals; - import java.time.LocalDate; import java.time.temporal.ChronoField; import java.time.temporal.JulianFields; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java index bb4513d14..7077ed88f 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time.temporal; import static org.testng.Assert.assertEquals; - import java.time.temporal.ValueRange; import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractTest; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java index 4615473f1..6510af894 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java @@ -622,7 +622,7 @@ public class TestYearMonth extends AbstractDateTimeTest { assertEquals(test.plusMonths(months), YearMonth.of((int) (-40L + months / 12), 6 + (int) (months % 12))); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusMonths_long_invalidTooLarge() { YearMonth test = YearMonth.of(Year.MAX_VALUE, 12); test.plusMonths(1); @@ -640,7 +640,7 @@ public class TestYearMonth extends AbstractDateTimeTest { test.plusMonths(Long.MIN_VALUE); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_plusMonths_long_invalidTooSmall() { YearMonth test = YearMonth.of(Year.MIN_VALUE, 1); test.plusMonths(-1); @@ -737,7 +737,7 @@ public class TestYearMonth extends AbstractDateTimeTest { assertEquals(test.minusMonths(months), YearMonth.of((int) (40L - months / 12), 6 - (int) (months % 12))); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusMonths_long_invalidTooLarge() { YearMonth test = YearMonth.of(Year.MAX_VALUE, 12); test.minusMonths(-1); @@ -755,7 +755,7 @@ public class TestYearMonth extends AbstractDateTimeTest { test.minusMonths(Long.MIN_VALUE); } - @Test(expectedExceptions = {DateTimeException.class}) + @Test(expectedExceptions = DateTimeException.class) public void test_minusMonths_long_invalidTooSmall() { YearMonth test = YearMonth.of(Year.MIN_VALUE, 1); test.minusMonths(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java index b5c290990..ae8c50ef0 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java @@ -47,7 +47,6 @@ package org.teavm.classlib.java.time.zone; import static org.testng.Assert.assertEquals; - import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; diff --git a/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java b/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java index 593a03006..077457617 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java @@ -788,7 +788,7 @@ public class HashtableTest { ht10.put("Key" + i, "Val" + i); } - String newVal = ht10.computeIfAbsent("absent key", (k) -> "added"); + String newVal = ht10.computeIfAbsent("absent key", k -> "added"); assertEquals("added", newVal); assertEquals(11, ht10.size()); @@ -805,7 +805,7 @@ public class HashtableTest { ht10.put("Key" + i, "Val" + i); } - String newVal = ht10.computeIfAbsent("Key5", (v) -> "changed"); + String newVal = ht10.computeIfAbsent("Key5", v -> "changed"); assertEquals("Val5", newVal); assertEquals(10, ht10.size()); @@ -821,7 +821,7 @@ public class HashtableTest { ht10.put("Key" + i, "Val" + i); } - String newVal = ht10.computeIfAbsent("absent key", (v) -> null); + String newVal = ht10.computeIfAbsent("absent key", v -> null); assertEquals(null, newVal); assertEquals(10, ht10.size()); diff --git a/tests/src/test/java/org/teavm/classlib/java/util/SpliteratorsTest.java b/tests/src/test/java/org/teavm/classlib/java/util/SpliteratorsTest.java index 0332109e0..f5bff289a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/SpliteratorsTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/SpliteratorsTest.java @@ -19,7 +19,6 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -27,7 +26,6 @@ import java.util.Spliterator; import java.util.Spliterators; import java.util.function.Consumer; import java.util.function.IntConsumer; - import org.junit.Test; import org.junit.runner.RunWith; import org.teavm.junit.TeaVMTestRunner; diff --git a/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java b/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java index 4a401eb67..40614404b 100644 --- a/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java +++ b/tests/src/test/java/org/teavm/jso/test/ImplementationTest.java @@ -45,7 +45,7 @@ public class ImplementationTest { assertEquals(1, instance.counter); } - @JSBody(params = { "a" }, script = "console.log(a, a);") + @JSBody(params = "a", script = "console.log(a, a);") private static native void wrongInlineCandidate(JSObject a); static class ForInliningTest implements JSObject { diff --git a/tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java b/tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java index 7881aa494..7256caca7 100644 --- a/tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java +++ b/tests/src/test/java/org/teavm/jso/test/JavaInvocationTest.java @@ -36,7 +36,7 @@ public class JavaInvocationTest { assertEquals(7, Num.create(5).add(Num.create(2)).value()); } - @JSBody(params = { "a" }, script = "return javaMethods.get('org.teavm.jso.test.JavaInvocationTest.sum(II)I')" + @JSBody(params = "a", script = "return javaMethods.get('org.teavm.jso.test.JavaInvocationTest.sum(II)I')" + ".invoke(a, 2);") private static native int staticInvocation(int a); diff --git a/tools/junit/src/main/java/org/teavm/junit/BrowserRunStrategy.java b/tools/junit/src/main/java/org/teavm/junit/BrowserRunStrategy.java index 4c4ade11c..e3fca5e49 100644 --- a/tools/junit/src/main/java/org/teavm/junit/BrowserRunStrategy.java +++ b/tools/junit/src/main/java/org/teavm/junit/BrowserRunStrategy.java @@ -243,6 +243,7 @@ public class BrowserRunStrategy implements TestRunStrategy { resp.getOutputStream().flush(); return; } + break; } case "/client.js": case "/frame.js": @@ -255,6 +256,7 @@ public class BrowserRunStrategy implements TestRunStrategy { resp.getOutputStream().flush(); return; } + break; } } if (path.startsWith("/tests/")) {