Skip to content

Commit

Permalink
fix for #10 - fix javadoc errors (#11)
Browse files Browse the repository at this point in the history
Also Requires running fmt-m-p, and skips deploying parent module
  • Loading branch information
FrankHossfeld authored Sep 10, 2020
1 parent d84e994 commit a4f0d77
Show file tree
Hide file tree
Showing 16 changed files with 589 additions and 106 deletions.
9 changes: 4 additions & 5 deletions gwt-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,12 @@
<moduleName>org.gwtproject.core.Core</moduleName>
</configuration>
</plugin>
<!-- TODO: El Hoss: When clear, while the plugin fails to work on the GwtIncompatible.java file, remove -->
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>${maven.fmt.plugin}</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven.deploy.plugin}</version>
<configuration>
<skip>true</skip>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
Expand Down
14 changes: 12 additions & 2 deletions gwt-core/src/main/java/org/gwtproject/core/client/Duration.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class Duration {
* Returns the same result as {@link System#currentTimeMillis()}, but as a double. Because
* emulated long math is significantly slower than doubles in Production Mode, this method is to
* be preferred.
*
* @return current time in millis as double
*/
public static double currentTimeMillis() {
return JsDate.now();
Expand All @@ -34,12 +36,20 @@ public static double currentTimeMillis() {
/** Creates a new Duration whose start time is now. */
public Duration() {}

/** Returns the number of milliseconds that have elapsed since this object was created. */
/**
* returns the number of milliseconds that have elapsed since this object was created.
*
* @return milliseconds
*/
public int elapsedMillis() {
return Js.coerceToInt(currentTimeMillis() - start);
}

/** Returns the time when the object was created. */
/**
* Returns the time when the object was created.
*
* @return creation time
*/
public double getStartMillis() {
return start;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
@Deprecated
@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
public class JavaScriptObject {
/** Returns a new array. */
/**
* Returns a new array.
*
* @return a new array
*/
@JsOverlay
public static JavaScriptObject createArray() {
return Js.cast(new JsArray<>());
Expand All @@ -49,19 +53,30 @@ public static JavaScriptObject createArray() {
*
* <p>Consider using this method in performance critical code instead of using {@link
* #createArray()}, since this gives more hints to the underlying JavaScript VM for optimizations.
*
* @param size size of array
* @return array as JavaScript object
*/
@JsOverlay
public static JavaScriptObject createArray(int size) {
return Js.cast(new JsArray<>((double) size));
}

/** Returns an empty function. */
/**
* Returns an empty function.
*
* @return function as JavaScript object
*/
@JsOverlay
public static JavaScriptObject createFunction() {
return Js.cast(new Function());
}

/** Returns a new object. */
/**
* Returns a new object.
*
* @return object as JavaScript object
*/
@JsOverlay
public static JavaScriptObject createObject() {
return new JavaScriptObject();
Expand Down
13 changes: 11 additions & 2 deletions gwt-core/src/main/java/org/gwtproject/core/client/JsArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* <p>This class may not be directly instantiated, and can only be returned from a native method.
* For example, <code>
* native JsArray<JavaScriptObject> getNativeArray() /*-{
* native JsArray&lt;JavaScriptObject&gt; getNativeArray() /*-{
* return [
* { x: 0, y: 1},
* { x: 2, y: 3},
Expand Down Expand Up @@ -57,6 +57,8 @@ public final T get(int index) {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @return resulting String
*/
@JsOverlay
public final String join() {
Expand All @@ -67,6 +69,9 @@ public final String join() {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @param separator separator to use
* @return String containing all elements of the array. Each element separated using the separator
*/
@JsOverlay
public final String join(String separator) {
Expand All @@ -83,7 +88,11 @@ public final int length() {
return this.<elemental2.core.JsArray<T>>cast().length;
}

/** Pushes the given value onto the end of the array. */
/**
* Pushes the given value onto the end of the array.
*
* @param value value to push
*/
public final native void push(T value);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public final boolean get(int index) {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @return all elements jointed into a String separated by comma
*/
@JsOverlay
public final String join() {
Expand All @@ -63,6 +65,9 @@ public final String join() {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @param separator separator to use
* @return all elements jointed into a String separated by the given separator
*/
@JsOverlay
public final String join(String separator) {
Expand All @@ -79,7 +84,11 @@ public final int length() {
return this.<elemental2.core.JsArray<Boolean>>cast().length;
}

/** Pushes the given boolean onto the end of the array. */
/**
* Pushes the given boolean onto the end of the array.
*
* @param value boolean value to push
*/
public final native void push(boolean value);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public final int get(int index) {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @return all elements jointed into a String separated by comma
*/
@JsOverlay
public final String join() {
Expand All @@ -66,6 +68,9 @@ public final String join() {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @param separator separator to use
* @return all elements jointed into a String separated by the given separator
*/
@JsOverlay
public final String join(String separator) {
Expand All @@ -82,7 +87,11 @@ public final int length() {
return this.<JsArray<Double>>cast().length;
}

/** Pushes the given integer onto the end of the array. */
/**
* Pushes the given integer onto the end of the array.
*
* @param value int value to push
*/
public final native void push(int value);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public final double getNumber(int index) {
/**
* Gets the {@link org.gwtproject.core.client.JavaScriptObject} at a given index.
*
* @param <T> type extending JavaScriptObject
* @param index the index to be retrieved
* @return the {@code JavaScriptObject} at the given index, or <code>null</code> if none exists
*/
Expand All @@ -92,6 +93,8 @@ public final String getString(int index) {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @return all elements jointed into a String separated by comma
*/
@JsOverlay
public final String join() {
Expand All @@ -102,6 +105,9 @@ public final String join() {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @param separator separator to use
* @return all elements jointed into a String separated by the given separator
*/
@JsOverlay
public final String join(String separator) {
Expand All @@ -118,18 +124,32 @@ public final int length() {
return this.<JsArray<Object>>cast().length;
}

/** Pushes the given boolean onto the end of the array. */
/**
* Pushes the given boolean onto the end of the array.
*
* @param value boolean value to push
*/
public final native void push(boolean value);

/** Pushes the given double onto the end of the array. */
/**
* Pushes the given double onto the end of the array.
*
* @param value double value to push
*/
public final native void push(double value);

/**
* Pushes the given {@link org.gwtproject.core.client.JavaScriptObject} onto the end of the array.
*
* @param value JavaScriptObject value to push
*/
public final native void push(JavaScriptObject value);

/** Pushes the given String onto the end of the array. */
/**
* Pushes the given String onto the end of the array.
*
* @param value String value to push
*/
public final native void push(String value);

/**
Expand Down Expand Up @@ -221,6 +241,7 @@ public final double shiftNumber() {
/**
* Shifts the first value off the array.
*
* @param <T> type extending JavaScriptObject
* @return the shifted {@link org.gwtproject.core.client.JavaScriptObject}
*/
@JsOverlay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public final double get(int index) {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @return all elements jointed into a String separated by comma
*/
@JsOverlay
public final String join() {
Expand All @@ -68,6 +70,9 @@ public final String join() {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @param separator separator to use
* @return all elements jointed into a String separated by the given separator
*/
@JsOverlay
public final String join(String separator) {
Expand All @@ -84,7 +89,11 @@ public final int length() {
return this.<JsArray<Number>>cast().length;
}

/** Pushes the given number onto the end of the array. */
/**
* Pushes the given number onto the end of the array.
*
* @param value double value to push
*/
public final native void push(double value);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public final String get(int index) {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @return all elements jointed into a String separated by comma
*/
@JsOverlay
public final String join() {
Expand All @@ -63,6 +65,9 @@ public final String join() {
* Convert each element of the array to a String and join them with a comma separator. The value
* returned from this method may vary between browsers based on how JavaScript values are
* converted into strings.
*
* @param separator separator to use
* @return all elements jointed into a String separated by the given separator
*/
@JsOverlay
public final String join(String separator) {
Expand All @@ -79,7 +84,11 @@ public final int length() {
return this.<JsArray<String>>cast().length;
}

/** Pushes the given value onto the end of the array. */
/**
* Pushes the given value onto the end of the array.
*
* @param value String value to push
*/
public final native void push(String value);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public static JsArrayInteger readOnlyJsArray(short[] array) {
* reference to the original array in prod mode, the source must not be modified while this copy
* is in use or you will get different behavior between DevMode and prod mode.
*
* @param <T> type extending JavaScriptObject
* @param array source array
* @return JS array, which may be a copy or an alias of the input array
*/
Expand Down
Loading

0 comments on commit a4f0d77

Please sign in to comment.