diff --git a/checkstyle.xml b/checkstyle.xml index c57d618..d6aed1a 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -25,7 +25,10 @@ - + + + + @@ -117,12 +120,6 @@ - - - - - - diff --git a/src/main/java/org/lucidfox/jpromises/core/PromiseHandler.java b/src/main/java/org/lucidfox/jpromises/core/PromiseHandler.java index bd5140d..1f05395 100644 --- a/src/main/java/org/lucidfox/jpromises/core/PromiseHandler.java +++ b/src/main/java/org/lucidfox/jpromises/core/PromiseHandler.java @@ -41,7 +41,6 @@ public interface PromiseHandler { *

* * @param resolve the resolver, which sets the promise into a resolved state with a given value - * @param reject the rejector, which sets the promise into a rejected state with a given exception * @throws Exception This method is allowed to throw exceptions, mostly for implementor convenience. Any exception * thrown by {#link #handle} is called and passed to {@code reject}. */ diff --git a/src/main/java/org/lucidfox/jpromises/core/Thenable.java b/src/main/java/org/lucidfox/jpromises/core/Thenable.java index 0040b76..b5b6864 100644 --- a/src/main/java/org/lucidfox/jpromises/core/Thenable.java +++ b/src/main/java/org/lucidfox/jpromises/core/Thenable.java @@ -60,6 +60,5 @@ public interface Thenable { * @throws Exception Optionally, {@link Thenable} can throw exceptions, though its main implementation, * {@link Promise}, does not. The {@link Promise} class treats thrown exceptions as rejection. */ - Thenable then(final ResolveCallback onResolve, final RejectCallback onReject) - throws Exception; + Thenable then(ResolveCallback onResolve, RejectCallback onReject) throws Exception; } diff --git a/src/main/java/org/lucidfox/jpromises/gwt/JsPromise.java b/src/main/java/org/lucidfox/jpromises/gwt/JsPromise.java index 6c494c6..a106c1c 100644 --- a/src/main/java/org/lucidfox/jpromises/gwt/JsPromise.java +++ b/src/main/java/org/lucidfox/jpromises/gwt/JsPromise.java @@ -45,7 +45,7 @@ protected JsPromise() { } * @param value the value to resolve the promise with * @return the new JS promise */ - public static native JsPromise resolve(final V value) /*-{ + public static native JsPromise resolve(V value) /*-{ return $wnd.Promise.resolve(value); }-*/; @@ -72,7 +72,7 @@ public void handle(final Resolver resolve) { * @param exception the exception to reject the promise with * @return the new JS promise */ - public static native JsPromise reject(final Throwable exception) /*-{ + public static native JsPromise reject(Throwable exception) /*-{ return $wnd.Promise.reject(@JsPromise::toJsError(Ljava/lang/Throwable;)(exception)); }-*/; @@ -83,7 +83,7 @@ public static native JsPromise reject(final Throwable exception) /*-{ * @param handler the promise handler that can resolve or reject the promise inside it * @return the new JS promise */ - public static native JsPromise create(final PromiseHandler handler) /*-{ + public static native JsPromise create(PromiseHandler handler) /*-{ return new $wnd.Promise(function(resolve, reject) { @JsPromise::handle(Lorg/lucidfox/jpromises/core/PromiseHandler; Lcom/google/gwt/core/client/JavaScriptObject; @@ -137,11 +137,11 @@ public void reject(final Throwable e) { } } - private static native void resolveValue(final JavaScriptObject resolve, final Object obj) /*-{ + private static native void resolveValue(JavaScriptObject resolve, Object obj) /*-{ resolve(obj); }-*/; - private static native void rejectThrown(final JavaScriptObject reject, final Throwable exception) /*-{ + private static native void rejectThrown(JavaScriptObject reject, Throwable exception) /*-{ reject(@JsPromise::toJsError(Ljava/lang/Throwable;)(exception)); }-*/; @@ -154,7 +154,7 @@ private static Object toJsError(final Throwable exception) { } } - private static native JavaScriptObject toJsError0(final Throwable exception, final String message) /*-{ + private static native JavaScriptObject toJsError0(Throwable exception, String message) /*-{ var error = new Error(message); error.__jsPromiseWrappedException = exception; return error; @@ -173,8 +173,7 @@ public JsPromise then(final ResolveCallback onResolve) { } @Override - public native JsPromise then(final ResolveCallback onResolve, - final RejectCallback onReject) /*-{ + public native JsPromise then(ResolveCallback onResolve, RejectCallback onReject) /*-{ return this.then(function(value) { if (!onResolve) { return null;