Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Marcilio2019-04-12 22:57:45 -0400
committerDiego Marcilio2019-04-13 11:26:21 -0400
commit4fa5728570c2fde4f7bdf3ba374787a070497768 (patch)
tree463d829e7da93af5551d4fe98fe7e27e96afce7f
parent379ecf5a76c8c0a8c765caaa8c37658640bf088f (diff)
downloadeclipse.platform.ui-4fa5728570c2fde4f7bdf3ba374787a070497768.tar.gz
eclipse.platform.ui-4fa5728570c2fde4f7bdf3ba374787a070497768.tar.xz
eclipse.platform.ui-4fa5728570c2fde4f7bdf3ba374787a070497768.zip
Replace multiple 'new BigDecimal()' with 'BigDecimal.valueOf()'I20190414-1800
Fixes for multiple SonarQube issues Change-Id: Ib398561a973001e29420cf88c60defb42e027327 Signed-off-by: Diego Marcilio <dvmarcilio@gmail.com>
-rw-r--r--bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.core.databinding/pom.xml6
-rw-r--r--bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java4
-rw-r--r--bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java2
-rw-r--r--bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java2
-rw-r--r--bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java22
-rw-r--r--bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java2
-rw-r--r--bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ProjectLocationSelectionDialog.java2
-rw-r--r--bundles/org.eclipse.ui.ide/pom.xml6
-rw-r--r--tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.jface.tests.databinding/pom.xml4
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java2
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java2
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java2
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java10
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java2
-rw-r--r--tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java4
18 files changed, 37 insertions, 41 deletions
diff --git a/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF
index a61a393924..82e3e3d50f 100644
--- a/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.core.databinding/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.databinding
-Bundle-Version: 1.7.200.qualifier
+Bundle-Version: 1.7.300.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.core.databinding/pom.xml b/bundles/org.eclipse.core.databinding/pom.xml
index e34c9865e7..7e82b7a133 100644
--- a/bundles/org.eclipse.core.databinding/pom.xml
+++ b/bundles/org.eclipse.core.databinding/pom.xml
@@ -20,10 +20,10 @@
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.databinding</artifactId>
- <version>1.7.200-SNAPSHOT</version>
+ <version>1.7.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
-
+
<properties>
<code.ignoredWarnings>-warn:-deprecation,raw,unchecked</code.ignoredWarnings>
- </properties>
+ </properties>
</project>
diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java
index 88ba2ae15e..4df8e42391 100644
--- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java
+++ b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.java
@@ -202,7 +202,7 @@ public class StringToNumberConverter<T extends Number> extends NumberFormatConve
else if(n instanceof BigDecimal)
return (T) ((BigDecimal) n).toBigInteger();
else
- return (T) new BigDecimal(n.doubleValue()).toBigInteger();
+ return (T) BigDecimal.valueOf(n.doubleValue()).toBigInteger();
} else if (BigDecimal.class.equals(boxedType)) {
Number n = result.getNumber();
if(n instanceof Long)
@@ -223,7 +223,7 @@ public class StringToNumberConverter<T extends Number> extends NumberFormatConve
throw new IllegalArgumentException("Error (InvocationTargetException) converting BigDecimal using ICU"); //$NON-NLS-1$
}
} else if(n instanceof Double) {
- BigDecimal bd = new BigDecimal(n.doubleValue());
+ BigDecimal bd = BigDecimal.valueOf(n.doubleValue());
if (bd.scale() == 0)
return (T) bd;
throw new IllegalArgumentException("Non-integral Double value returned from NumberFormat " + //$NON-NLS-1$
diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java
index 08f66e0f36..5f3e5115f6 100644
--- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java
+++ b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.java
@@ -41,6 +41,6 @@ public class NumberToBigDecimalConverter extends NumberToNumberConverter<BigDeci
return new BigDecimal((BigInteger) number);
}
- return new BigDecimal(number.doubleValue());
+ return BigDecimal.valueOf(number.doubleValue());
}
}
diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java
index ade48d1e36..bfbcb71764 100644
--- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java
+++ b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.java
@@ -45,6 +45,6 @@ public class NumberToBigIntegerConverter extends NumberToNumberConverter<BigInte
return (BigDecimal) number;
}
- return new BigDecimal(number.doubleValue());
+ return BigDecimal.valueOf(number.doubleValue());
}
}
diff --git a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java
index ba506666f1..d8a3b71aa0 100644
--- a/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java
+++ b/bundles/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToNumberParser.java
@@ -29,15 +29,11 @@ import com.ibm.icu.text.NumberFormat;
* @since 1.0
*/
public class StringToNumberParser {
- private static final BigDecimal FLOAT_MAX_BIG_DECIMAL = new BigDecimal(
- Float.MAX_VALUE);
- private static final BigDecimal FLOAT_MIN_BIG_DECIMAL = new BigDecimal(
- -Float.MAX_VALUE);
+ private static final BigDecimal FLOAT_MAX_BIG_DECIMAL = BigDecimal.valueOf(Float.MAX_VALUE);
+ private static final BigDecimal FLOAT_MIN_BIG_DECIMAL = BigDecimal.valueOf(-Float.MAX_VALUE);
- private static final BigDecimal DOUBLE_MAX_BIG_DECIMAL = new BigDecimal(
- Double.MAX_VALUE);
- private static final BigDecimal DOUBLE_MIN_BIG_DECIMAL = new BigDecimal(
- -Double.MAX_VALUE);
+ private static final BigDecimal DOUBLE_MAX_BIG_DECIMAL = BigDecimal.valueOf(Double.MAX_VALUE);
+ private static final BigDecimal DOUBLE_MIN_BIG_DECIMAL = BigDecimal.valueOf(-Double.MAX_VALUE);
/**
* @param value
@@ -181,7 +177,7 @@ public class StringToNumberParser {
} else if (number instanceof Float || number instanceof Double) {
double doubleValue = number.doubleValue();
if (!Double.isNaN(doubleValue) && !Double.isInfinite(doubleValue)) {
- bigInteger = new BigDecimal(doubleValue).toBigInteger();
+ bigInteger = BigDecimal.valueOf(doubleValue).toBigInteger();
} else {
return false;
}
@@ -196,7 +192,7 @@ public class StringToNumberParser {
* that this will work we fall back on the double value of the
* number.
*/
- bigInteger = new BigDecimal(number.doubleValue()).toBigInteger();
+ bigInteger = BigDecimal.valueOf(number.doubleValue()).toBigInteger();
}
if (bigInteger != null) {
@@ -238,12 +234,12 @@ public class StringToNumberParser {
BigDecimal max) {
BigDecimal bigDecimal = null;
if (number instanceof Integer || number instanceof Long) {
- bigDecimal = new BigDecimal(number.doubleValue());
+ bigDecimal = BigDecimal.valueOf(number.doubleValue());
} else if (number instanceof Float || number instanceof Double) {
double doubleValue = number.doubleValue();
if (!Double.isNaN(doubleValue) && !Double.isInfinite(doubleValue)) {
- bigDecimal = new BigDecimal(doubleValue);
+ bigDecimal = BigDecimal.valueOf(doubleValue);
} else {
return false;
}
@@ -265,7 +261,7 @@ public class StringToNumberParser {
double doubleValue = number.doubleValue();
if (!Double.isNaN(doubleValue) && !Double.isInfinite(doubleValue)) {
- bigDecimal = new BigDecimal(doubleValue);
+ bigDecimal = BigDecimal.valueOf(doubleValue);
} else {
return false;
}
diff --git a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
index d6737327ac..2098cc4cd6 100644
--- a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.ui.ide; singleton:=true
-Bundle-Version: 3.15.100.qualifier
+Bundle-Version: 3.15.200.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.ui.internal.ide.IDEWorkbenchPlugin
Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java b/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java
index b9a9534711..1df7187afd 100644
--- a/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java
+++ b/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java
@@ -168,7 +168,7 @@ public class CopyFilesAndFoldersOperation {
String numberStr;
BigDecimal newNumber = null;
try {
- newNumber = new BigDecimal(m.group()).add(new BigDecimal(1));
+ newNumber = new BigDecimal(m.group()).add(BigDecimal.valueOf(1));
numberStr = m.replaceFirst(newNumber.toPlainString());
} catch (NumberFormatException e) {
numberStr = m.replaceFirst("2"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ProjectLocationSelectionDialog.java b/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ProjectLocationSelectionDialog.java
index c488a4e7fa..2f3d3cb4be 100644
--- a/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ProjectLocationSelectionDialog.java
+++ b/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ProjectLocationSelectionDialog.java
@@ -267,7 +267,7 @@ public class ProjectLocationSelectionDialog extends SelectionStatusDialog {
if (m.find()) {
// String ends with a number: increment it by 1
try {
- BigDecimal newNumber = new BigDecimal(m.group()).add(new BigDecimal(1));
+ BigDecimal newNumber = new BigDecimal(m.group()).add(BigDecimal.valueOf(1));
return m.replaceFirst(newNumber.toPlainString());
} catch (NumberFormatException e) {
return m.replaceFirst("2"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.ui.ide/pom.xml b/bundles/org.eclipse.ui.ide/pom.xml
index d3a7c1dded..5e709da469 100644
--- a/bundles/org.eclipse.ui.ide/pom.xml
+++ b/bundles/org.eclipse.ui.ide/pom.xml
@@ -20,10 +20,10 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.ide</artifactId>
- <version>3.15.100-SNAPSHOT</version>
+ <version>3.15.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
-
+
<properties>
<code.ignoredWarnings>-warn:-deprecation,raw,unchecked</code.ignoredWarnings>
- </properties>
+ </properties>
</project>
diff --git a/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF b/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF
index ea99fd795d..1eff0d60c8 100644
--- a/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jface.tests.databinding/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jface.tests.databinding
-Bundle-Version: 1.8.500.qualifier
+Bundle-Version: 1.8.600.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.databinding;bundle-version="[1.3.0,2.0.0)",
diff --git a/tests/org.eclipse.jface.tests.databinding/pom.xml b/tests/org.eclipse.jface.tests.databinding/pom.xml
index 1ea097e2f1..dc7dd8d8bc 100644
--- a/tests/org.eclipse.jface.tests.databinding/pom.xml
+++ b/tests/org.eclipse.jface.tests.databinding/pom.xml
@@ -19,11 +19,11 @@
</parent>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface.tests.databinding</artifactId>
- <version>1.8.500-SNAPSHOT</version>
+ <version>1.8.600-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<code.ignoredWarnings>${tests.ignoredWarnings}</code.ignoredWarnings>
</properties>
-
+
</project>
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java
index ed1d469320..071f499d46 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/NumberToStringConverterTest.java
@@ -167,7 +167,7 @@ public class NumberToStringConverterTest {
assertEquals("Non-integer BigDecimal", expected, result);
// Test 2: Long
- input = new BigDecimal(Integer.MAX_VALUE + 100L);
+ input = BigDecimal.valueOf(Integer.MAX_VALUE + 100L);
expected = formatBigDecimal(input);
result = converter.convert(input);
assertEquals("Integral BigDecimal in long range", expected, result);
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
index 8e5ea0b05f..288e67d057 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/conversion/StringToNumberConverterTest.java
@@ -118,7 +118,7 @@ public class StringToNumberConverterTest {
assertEquals("Non-integer BigDecimal", input, result);
// Test 2: Long
- input = new BigDecimal(Integer.MAX_VALUE + 100L);
+ input = BigDecimal.valueOf(Integer.MAX_VALUE + 100L);
result = converter.convert(formatBigDecimal(input));
assertEquals("Integral BigDecimal in long range", input, result);
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java
index f4ec4f0bb3..06b6295273 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/NumberToDoubleConverterTest.java
@@ -27,7 +27,7 @@ import com.ibm.icu.text.NumberFormat;
public class NumberToDoubleConverterTest extends NumberToNumberTestHarness {
@Override
protected Number doGetOutOfRangeNumber() {
- return new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Double.MAX_VALUE));
+ return BigDecimal.valueOf(Double.MAX_VALUE).add(BigDecimal.valueOf(Double.MAX_VALUE));
}
@Override
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java
index c6362ee5cc..b48ce8e3e2 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/conversion/StringToNumberParserTestHarness.java
@@ -143,16 +143,16 @@ public abstract class StringToNumberParserTestHarness {
// test BigIntegers
assertTrue("valid BigInteger", assertValid(BigInteger.valueOf(1)));
- BigDecimal bigDecimalMin = new BigDecimal(min.doubleValue());
- bigDecimalMin = bigDecimalMin.subtract(new BigDecimal(1));
+ BigDecimal bigDecimalMin = BigDecimal.valueOf(min.doubleValue());
+ bigDecimalMin = bigDecimalMin.subtract(BigDecimal.valueOf(1));
assertFalse("invalid BigInteger min", assertValid(bigDecimalMin.toBigInteger()));
- BigDecimal bigDecimalMax = new BigDecimal(max.doubleValue());
- bigDecimalMax = bigDecimalMax.add(new BigDecimal(1));
+ BigDecimal bigDecimalMax = BigDecimal.valueOf(max.doubleValue());
+ bigDecimalMax = bigDecimalMax.add(BigDecimal.valueOf(1));
assertFalse("invalid BigInteger max", assertValid(bigDecimalMax.toBigInteger()));
// test BigDecimals
- assertTrue("valid BigDecimal", assertValid(new BigDecimal(1)));
+ assertTrue("valid BigDecimal", assertValid(BigDecimal.valueOf(1)));
assertFalse("invalid BigDecimal min", assertValid(bigDecimalMin));
assertFalse("invalid BigDecimal max", assertValid(bigDecimalMax));
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java
index 7b961cb686..0809df605e 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/NumberToDoubleValidatorTest.java
@@ -30,7 +30,7 @@ public class NumberToDoubleValidatorTest extends
@Override
protected Number doGetOutOfRangeNumber() {
- return new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Double.MAX_VALUE));
+ return BigDecimal.valueOf(Double.MAX_VALUE).add(BigDecimal.valueOf(Double.MAX_VALUE));
}
@Override
diff --git a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java
index 335923c1a5..e567a80dd4 100644
--- a/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java
+++ b/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/validation/StringToDoubleValidatorTest.java
@@ -40,8 +40,8 @@ public class StringToDoubleValidatorTest extends
@Override
protected Number getOutOfRangeNumber() {
- BigDecimal decimal = new BigDecimal(Double.MAX_VALUE);
- return decimal.add(new BigDecimal(Double.MAX_VALUE));
+ BigDecimal decimal = BigDecimal.valueOf(Double.MAX_VALUE);
+ return decimal.add(BigDecimal.valueOf(Double.MAX_VALUE));
}
@Override

Back to the top