Skip to content

Commit edd5c95

Browse files
committed
Format code
1 parent 95d9742 commit edd5c95

File tree

6 files changed

+51
-29
lines changed

6 files changed

+51
-29
lines changed

commons/che-core-commons-gwt/src/main/java/org/eclipse/che/api/promises/client/Function.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212

1313
/**
1414
* Function interface.
15-
*
16-
* @param <A> the argument type
17-
* @param <R> the result type
15+
*
16+
* @param <A>
17+
* the argument type
18+
* @param <R>
19+
* the result type
1820
*/
1921
public interface Function<A, R> {
2022
R apply(A arg) throws FunctionException;

commons/che-core-commons-gwt/src/main/java/org/eclipse/che/api/promises/client/Operation.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
/**
1414
* Interface for an 'operation', as a function without a return value, only side-effects, but without the burden of having a callback with
1515
* Void parameter.
16-
*
17-
* @param <A> the type of the argument
16+
*
17+
* @param <A>
18+
* the type of the argument
1819
*/
1920
public interface Operation<A> {
2021
void apply(A arg) throws OperationException;

commons/che-core-commons-gwt/src/main/java/org/eclipse/che/api/promises/client/js/Executor.java

+19-8
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
/**
1616
* The executor is the conclusion callback, a js function with two parameters, usually named
1717
* resolve and reject. The first argument fulfills the promise, the second argument rejects it.
18-
* @param <V> the type of the promised value
18+
*
19+
* @param <V>
20+
* the type of the promised value
1921
*/
2022
public class Executor<V> extends JavaScriptObject {
2123

2224
/** JSO mandated protected constructor. */
23-
protected Executor() {}
25+
protected Executor() {
26+
}
2427

2528
/*
2629
* The first parameter is the fulfillment function, the second is the rejection function. Both
@@ -32,12 +35,15 @@ protected Executor() {}
3235

3336
/**
3437
* Creates an executor.
35-
* @param executorBody the body of the executor
38+
*
39+
* @param executorBody
40+
* the body of the executor
41+
* @param <V>
42+
* the fulfillment value
3643
* @return the new executor
37-
* @param <V> the fulfillment value
3844
*/
3945
public static final native <V> Executor<V> create(ExecutorBody<V> executorBody) /*-{
40-
return function(resolve, reject) {
46+
return function (resolve, reject) {
4147
try {
4248
executorBody.@org.eclipse.che.api.promises.client.js.Executor.ExecutorBody::apply(*)(resolve, reject);
4349
} catch (e) {
@@ -48,15 +54,20 @@ public static final native <V> Executor<V> create(ExecutorBody<V> executorBody)
4854

4955
/**
5056
* The definition of an executor.
51-
* @param <V> the type of the fulfillment value
57+
*
58+
* @param <V>
59+
* the type of the fulfillment value
5260
*/
5361
public interface ExecutorBody<V> {
5462
/**
5563
* The executor describes what the promise must do in order to be fulfilled.
5664
* It will execute some code to process or retrieve some value, then use the <code>resolve</code> or
5765
* <code>reject</code> callback to conclude.
58-
* @param resolve what to do on success
59-
* @param reject what to do on failure
66+
*
67+
* @param resolve
68+
* what to do on success
69+
* @param reject
70+
* what to do on failure
6071
*/
6172
void apply(ResolveFunction<V> resolve, RejectFunction reject);
6273
}

commons/che-core-commons-gwt/src/main/java/org/eclipse/che/api/promises/client/js/JsPromiseError.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
*******************************************************************************/
1111
package org.eclipse.che.api.promises.client.js;
1212

13-
import org.eclipse.che.api.promises.client.PromiseError;
1413
import com.google.gwt.core.client.JavaScriptObject;
1514

15+
import org.eclipse.che.api.promises.client.PromiseError;
16+
1617
public class JsPromiseError extends JavaScriptObject implements PromiseError {
1718

1819
protected JsPromiseError() {
@@ -40,10 +41,10 @@ public static final JsPromiseError create(final Throwable e) {
4041
if (stack != null && stack.length != 0) {
4142
result = create(e.getMessage(), stack[0].getFileName(), Integer.toString(stack[0].getLineNumber()));
4243
result.setStack(stack);
43-
} else {
44-
result = create(e.getMessage());
45-
}
46-
return result;
44+
} else {
45+
result = create(e.getMessage());
46+
}
47+
return result;
4748
}
4849

4950
private final void setStack(final StackTraceElement[] stack) {

commons/che-core-commons-gwt/src/main/java/org/eclipse/che/api/promises/client/js/Promises.java

+16-10
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,29 @@
1010
*******************************************************************************/
1111
package org.eclipse.che.api.promises.client.js;
1212

13-
import org.eclipse.che.api.promises.client.Promise;
14-
import org.eclipse.che.api.promises.client.PromiseError;
15-
import com.google.gwt.core.client.JavaScriptObject;
16-
import com.google.gwt.core.client.JsArrayMixed;
17-
1813
import elemental.js.util.JsArrayOf;
1914
import elemental.util.ArrayOf;
2015

16+
import com.google.gwt.core.client.JavaScriptObject;
17+
import com.google.gwt.core.client.JsArrayMixed;
18+
19+
import org.eclipse.che.api.promises.client.Promise;
20+
import org.eclipse.che.api.promises.client.PromiseError;
2121

2222
public final class Promises {
2323

2424
/** Private constructor, the class is not instantiable. */
25-
private Promises() {}
25+
private Promises() {
26+
}
2627

2728
/**
2829
* Creates a new promise using the provided executor.
29-
* @param conclusion the executor
30+
*
31+
* @param conclusion
32+
* the executor
33+
* @param <V>
34+
* the type of the promised value
3035
* @return a promise
31-
* @param <V> the type of the promised value
3236
*/
3337
public static final native <V> JsPromise<V> create(Executor<V> conclusion) /*-{
3438
return new Promise(conclusion);
@@ -37,7 +41,9 @@ public static final native <V> JsPromise<V> create(Executor<V> conclusion) /*-{
3741
/**
3842
* Creates a promise that resolves as soon as all the promises used as parameters are resolved or rejected
3943
* as soon as the first rejection happens on one of the included promises.
40-
* @param promises the included promises
44+
*
45+
* @param promises
46+
* the included promises
4147
* @return a promise with an array of unit values as fulfillment value
4248
*/
4349
public static final native JsPromise<JsArrayMixed> all(ArrayOf<Promise<?>> promises) /*-{
@@ -46,7 +52,7 @@ public static final native JsPromise<JsArrayMixed> all(ArrayOf<Promise<?>> promi
4652

4753
public static final JsPromise<JsArrayMixed> all(final Promise<?>... promises) {
4854
final JsArrayOf<Promise<?>> promisesArray = JavaScriptObject.createArray().cast();
49-
for (final Promise<?> promise: promises) {
55+
for (final Promise<?> promise : promises) {
5056
promisesArray.push(promise);
5157
}
5258
return all(promisesArray);

commons/che-core-commons-gwt/src/main/java/org/eclipse/che/api/promises/client/js/RejectFunction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
*******************************************************************************/
1111
package org.eclipse.che.api.promises.client.js;
1212

13-
import org.eclipse.che.api.promises.client.PromiseError;
1413
import com.google.gwt.core.client.JavaScriptObject;
1514

15+
import org.eclipse.che.api.promises.client.PromiseError;
16+
1617
public class RejectFunction extends JavaScriptObject {
1718

1819
protected RejectFunction() {

0 commit comments

Comments
 (0)