[google-web-toolkit] r7350 committed - Changes from review feedback.

1 view
Skip to first unread message

codesite...@google.com

unread,
Dec 27, 2009, 1:16:35 AM12/27/09
to gwt...@gmail.com
Revision: 7350
Author: j...@google.com
Date: Sat Dec 26 22:16:06 2009
Log: Changes from review feedback.

http://code.google.com/p/google-web-toolkit/source/detail?r=7350

Modified:

/changes/jat/bigdecimal/user/src/com/google/gwt/i18n/client/NumberFormat.java

/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/BigDecimal_CustomFieldSerializer.java

/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/BigInteger_CustomFieldSerializer.java

/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/MathContext_CustomFieldSerializer.java

/changes/jat/bigdecimal/user/super/com/google/gwt/emul/java/util/Random.java

/changes/jat/bigdecimal/user/test/com/google/gwt/emultest/java/util/RandomTest.java

=======================================
---
/changes/jat/bigdecimal/user/src/com/google/gwt/i18n/client/NumberFormat.java
Thu Dec 17 17:06:04 2009
+++
/changes/jat/bigdecimal/user/src/com/google/gwt/i18n/client/NumberFormat.java
Sat Dec 26 22:16:06 2009
@@ -800,7 +800,8 @@
if (Double.isNaN(number)) {
return numberConstants.notANumber();
}
- boolean isNegative = ((number < 0.0) || (number == 0.0 && 1 / number <
0.0));
+ boolean isNegative = ((number < 0.0)
+ || (number == 0.0 && 1 / number < 0.0));
if (isNegative) {
number = -number;
}
@@ -829,9 +830,9 @@
}

/**
- * This method formats a double to produce a string.
+ * This method formats a Number to produce a string.
*
- * @param number The double to format
+ * @param number The Number instance to format
* @return the formatted number string
*/
public String format(Number number) {
@@ -993,10 +994,10 @@
* thrown if either the text is empty or if the parse does not consume
all
* characters of the text.
*
- * /@param text the string to be parsed
- * /@return a parsed number value, which may be a Double, BigInteger, or
+ * param text the string to be parsed
+ * return a parsed number value, which may be a Double, BigInteger, or
* BigDecimal, or {@code Double(0.0)} if the parse fails.
- * /@throws NumberFormatException if the text segment could not be
converted
+ * throws NumberFormatException if the text segment could not be
converted
* into a number
*/
// public Number parseBig(String text) throws NumberFormatException {
@@ -1017,11 +1018,11 @@
* <code>pos</code> is not changed.
* </p>
*
- * /@param text the string to be parsed
- * /@param inOutPos position to pass in and get back
- * /@return a parsed number value, which may be a Double, BigInteger, or
+ * param text the string to be parsed
+ * pparam inOutPos position to pass in and get back
+ * return a parsed number value, which may be a Double, BigInteger, or
* BigDecimal, or {@code Double(0.0)} if the parse fails.
- * /@throws NumberFormatException if the text segment could not be
converted
+ * throws NumberFormatException if the text segment could not be
converted
* into a number
*/
// public Number parseBig(String text, int[] inOutPos)
@@ -1030,30 +1031,52 @@
// return Double.valueOf(parse(text, inOutPos));
// }

+ /**
+ * @return the number of digits between grouping separators in the
integer
+ * portion of a number.
+ */
protected int getGroupingSize() {
return groupingSize;
}

+ /**
+ * @return the prefix to use for negative values.
+ */
protected String getNegativePrefix() {
return negativePrefix;
}

+ /**
+ * @return the suffix to use for negative values.
+ */
protected String getNegativeSuffix() {
return negativeSuffix;
}

+ /**
+ * @return the NumberConstants instance for this formatter.
+ */
protected NumberConstants getNumberConstants() {
return numberConstants;
}

+ /**
+ * @return the prefix to use for positive values.
+ */
protected String getPositivePrefix() {
return positivePrefix;
}

+ /**
+ * @return the suffix to use for positive values.
+ */
protected String getPositiveSuffix() {
return positiveSuffix;
}

+ /**
+ * @return true if the decimal separator should always be shown.
+ */
protected boolean isDecimalSeparatorAlwaysShown() {
return decimalSeparatorAlwaysShown;
}
=======================================
---
/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/BigDecimal_CustomFieldSerializer.java
Fri Dec 11 13:21:45 2009
+++
/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/BigDecimal_CustomFieldSerializer.java
Sat Dec 26 22:16:06 2009
@@ -13,6 +13,9 @@
* License for the specific language governing permissions and limitations
under
* the License.
*/
+/*
+ * author Richard Zschech
+ */
package com.google.gwt.user.client.rpc.core.java.math;

import com.google.gwt.user.client.rpc.SerializationException;
=======================================
---
/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/BigInteger_CustomFieldSerializer.java
Fri Dec 11 13:21:45 2009
+++
/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/BigInteger_CustomFieldSerializer.java
Sat Dec 26 22:16:06 2009
@@ -13,6 +13,9 @@
* License for the specific language governing permissions and limitations
under
* the License.
*/
+/*
+ * author Richard Zschech
+ */
package com.google.gwt.user.client.rpc.core.java.math;

import com.google.gwt.user.client.rpc.SerializationException;
=======================================
---
/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/MathContext_CustomFieldSerializer.java
Thu Dec 17 16:21:13 2009
+++
/changes/jat/bigdecimal/user/src/com/google/gwt/user/client/rpc/core/java/math/MathContext_CustomFieldSerializer.java
Sat Dec 26 22:16:06 2009
@@ -13,6 +13,9 @@
* License for the specific language governing permissions and limitations
under
* the License.
*/
+/*
+ * author Richard Zschech
+ */
package com.google.gwt.user.client.rpc.core.java.math;

import com.google.gwt.user.client.rpc.SerializationException;
=======================================
---
/changes/jat/bigdecimal/user/super/com/google/gwt/emul/java/util/Random.java
Thu Dec 17 16:21:13 2009
+++
/changes/jat/bigdecimal/user/super/com/google/gwt/emul/java/util/Random.java
Sat Dec 26 22:16:06 2009
@@ -78,7 +78,7 @@
* @see #setSeed
*/
public Random() {
- setSeed(uniqueSeed ++ + System.currentTimeMillis());
+ setSeed(uniqueSeed++ + System.currentTimeMillis());
}

/**
=======================================
---
/changes/jat/bigdecimal/user/test/com/google/gwt/emultest/java/util/RandomTest.java
Thu Dec 17 16:21:13 2009
+++
/changes/jat/bigdecimal/user/test/com/google/gwt/emultest/java/util/RandomTest.java
Sat Dec 26 22:16:06 2009
@@ -32,13 +32,15 @@
*
* INCLUDES MODIFICATIONS BY GOOGLE.
*/
-
package com.google.gwt.emultest.java.util;

import com.google.gwt.junit.client.GWTTestCase;

import java.util.Random;

+/**
+ * Test java.util.Random.
+ */
public class RandomTest extends GWTTestCase {

private Random r = new Random();
@@ -209,7 +211,6 @@
someDifferent);
assertTrue("Calling nextInt (range) resulted in a number outside of
[0, range)",
inRange);
-
}

/**

Reply all
Reply to author
Forward
0 new messages