Skip to content

Commit

Permalink
Checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maia Everett committed May 17, 2017
1 parent a13b489 commit e41d9a8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
11 changes: 4 additions & 7 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="JavadocStyle"/>
<module name="JavadocStyle">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="ConstantName">
<property name="severity" value="ignore"/>
<property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|log)$"/>
Expand Down Expand Up @@ -117,12 +120,6 @@
<module name="AvoidStaticImport">
<property name="excludes" value="org.junit.Assert.*"/>
</module>
<module name="JavadocType">
<property name="allowUnknownTags" value="true"/>
</module>
<module name="JavadocMethod">
<property name="suppressLoadErrors" value="true"/>
</module>
</module>
<module name="JavadocPackage"/>
<module name="NewlineAtEndOfFile">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public interface PromiseHandler<V> {
* </p>
*
* @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}.
*/
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/lucidfox/jpromises/core/Thenable.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@ public interface Thenable<V> {
* @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.
*/
<R> Thenable<R> then(final ResolveCallback<? super V, R> onResolve, final RejectCallback<R> onReject)
throws Exception;
<R> Thenable<R> then(ResolveCallback<? super V, R> onResolve, RejectCallback<R> onReject) throws Exception;
}
15 changes: 7 additions & 8 deletions src/main/java/org/lucidfox/jpromises/gwt/JsPromise.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected JsPromise() { }
* @param value the value to resolve the promise with
* @return the new JS promise
*/
public static native <V> JsPromise<V> resolve(final V value) /*-{
public static native <V> JsPromise<V> resolve(V value) /*-{
return $wnd.Promise.resolve(value);
}-*/;

Expand All @@ -72,7 +72,7 @@ public void handle(final Resolver<V> resolve) {
* @param exception the exception to reject the promise with
* @return the new JS promise
*/
public static native <V> JsPromise<V> reject(final Throwable exception) /*-{
public static native <V> JsPromise<V> reject(Throwable exception) /*-{
return $wnd.Promise.reject(@JsPromise::toJsError(Ljava/lang/Throwable;)(exception));
}-*/;

Expand All @@ -83,7 +83,7 @@ public static native <V> JsPromise<V> 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 <V> JsPromise<V> create(final PromiseHandler<V> handler) /*-{
public static native <V> JsPromise<V> create(PromiseHandler<V> handler) /*-{
return new $wnd.Promise(function(resolve, reject) {
@JsPromise::handle(Lorg/lucidfox/jpromises/core/PromiseHandler;
Lcom/google/gwt/core/client/JavaScriptObject;
Expand Down Expand Up @@ -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));
}-*/;

Expand All @@ -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;
Expand All @@ -173,8 +173,7 @@ public <R> JsPromise<R> then(final ResolveCallback<? super V, R> onResolve) {
}

@Override
public native <R> JsPromise<R> then(final ResolveCallback<? super V, R> onResolve,
final RejectCallback<R> onReject) /*-{
public native <R> JsPromise<R> then(ResolveCallback<? super V, R> onResolve, RejectCallback<R> onReject) /*-{
return this.then(function(value) {
if (!onResolve) {
return null;
Expand Down

0 comments on commit e41d9a8

Please sign in to comment.