[testng] 40/160: JDK7 migration: Remove unnecessary (un)boxing
Eugene Zhukov
eugene-guest at moszumanska.debian.org
Tue Aug 18 10:22:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
eugene-guest pushed a commit to annotated tag testng-6.9.5
in repository testng.
commit 0cd523e46e71bb9a1340432eb43c521cadf3dc71
Author: Ryan Schmitt <rschmitt at pobox.com>
Date: Sat May 30 21:17:43 2015 -0700
JDK7 migration: Remove unnecessary (un)boxing
---
src/main/java/org/testng/Assert.java | 12 ++++++------
src/main/java/org/testng/AssertJUnit.java | 8 ++++----
src/main/java/org/testng/TestNGAntTask.java | 2 +-
src/main/java/org/testng/internal/Bsh.java | 2 +-
src/main/java/org/testng/internal/Constants.java | 2 +-
.../java/org/testng/internal/annotations/Converter.java | 6 +++---
src/main/java/org/testng/log4testng/Logger.java | 6 +++---
.../org/testng/remote/strprotocol/GenericMessage.java | 2 +-
src/main/java/org/testng/xml/TestNGContentHandler.java | 10 +++++-----
src/main/java/org/testng/xml/XmlSuite.java | 2 +-
src/main/java/org/testng/xml/XmlTest.java | 8 ++++----
src/test/java/org/testng/AssertTest.java | 4 ++--
src/test/java/test/asserttests/AssertTest.java | 6 +++---
.../dataprovider/InstanceDataProviderSampleTest.java | 2 +-
src/test/java/test/dataprovider/IterableTest.java | 4 ++--
.../java/test/dataprovider/ParallelDataProviderTest.java | 8 ++++----
src/test/java/test/dataprovider/Sample1Test.java | 4 ++--
src/test/java/test/dataprovider/TestInstanceTest.java | 4 ++--
src/test/java/test/factory/FactoryTest2.java | 2 +-
.../java/test/factory/FactoryWithInstanceInfoTest2.java | 2 +-
src/test/java/test/factory/VerifyFactoryTest.java | 4 ++--
.../test/factory/VerifyFactoryWithInstanceInfoTest.java | 4 ++--
src/test/java/test/thread/SequentialTest.java | 6 +++---
src/test/java/test/timeout/TimeOutTest.java | 2 +-
src/test/java/test/tmp/AssertEqualsTest.java | 16 ++++++++--------
src/test/java/test/tmp/Test_TestListenerAppender.java | 2 +-
src/test/java/test/triangle/CheckCount.java | 4 ++--
27 files changed, 67 insertions(+), 67 deletions(-)
diff --git a/src/main/java/org/testng/Assert.java b/src/main/java/org/testng/Assert.java
index d57dceb..d15c032 100644
--- a/src/main/java/org/testng/Assert.java
+++ b/src/main/java/org/testng/Assert.java
@@ -39,7 +39,7 @@ public class Assert {
*/
static public void assertTrue(boolean condition, String message) {
if(!condition) {
- failNotEquals( Boolean.valueOf(condition), Boolean.TRUE, message);
+ failNotEquals(condition, Boolean.TRUE, message);
}
}
@@ -60,7 +60,7 @@ public class Assert {
*/
static public void assertFalse(boolean condition, String message) {
if(condition) {
- failNotEquals( Boolean.valueOf(condition), Boolean.FALSE, message); // TESTNG-81
+ failNotEquals(condition, Boolean.FALSE, message); // TESTNG-81
}
}
@@ -202,11 +202,11 @@ public class Assert {
// the following test fails
if(Double.isInfinite(expected)) {
if(!(expected == actual)) {
- failNotEquals(new Double(actual), new Double(expected), message);
+ failNotEquals(actual, expected, message);
}
}
else if(!(Math.abs(expected - actual) <= delta)) { // Because comparison with NaN always returns false
- failNotEquals(new Double(actual), new Double(expected), message);
+ failNotEquals(actual, expected, message);
}
}
@@ -236,11 +236,11 @@ public class Assert {
// the following test fails
if(Float.isInfinite(expected)) {
if(!(expected == actual)) {
- failNotEquals(new Float(actual), new Float(expected), message);
+ failNotEquals(actual, expected, message);
}
}
else if(!(Math.abs(expected - actual) <= delta)) {
- failNotEquals(new Float(actual), new Float(expected), message);
+ failNotEquals(actual, expected, message);
}
}
diff --git a/src/main/java/org/testng/AssertJUnit.java b/src/main/java/org/testng/AssertJUnit.java
index 963784f..b4391af 100755
--- a/src/main/java/org/testng/AssertJUnit.java
+++ b/src/main/java/org/testng/AssertJUnit.java
@@ -119,11 +119,11 @@ public class AssertJUnit extends ArrayAsserts {
// the following test fails
if(Double.isInfinite(expected)) {
if(!(expected == actual)) {
- failNotEquals(message, new Double(expected), new Double(actual));
+ failNotEquals(message, expected, actual);
}
}
else if(!(Math.abs(expected - actual) <= delta)) { // Because comparison with NaN always returns false
- failNotEquals(message, new Double(expected), new Double(actual));
+ failNotEquals(message, expected, actual);
}
}
@@ -146,11 +146,11 @@ public class AssertJUnit extends ArrayAsserts {
// the following test fails
if(Float.isInfinite(expected)) {
if(!(expected == actual)) {
- failNotEquals(message, new Float(expected), new Float(actual));
+ failNotEquals(message, expected, actual);
}
}
else if(!(Math.abs(expected - actual) <= delta)) {
- failNotEquals(message, new Float(expected), new Float(actual));
+ failNotEquals(message, expected, actual);
}
}
diff --git a/src/main/java/org/testng/TestNGAntTask.java b/src/main/java/org/testng/TestNGAntTask.java
index ab2c555..bdae073 100755
--- a/src/main/java/org/testng/TestNGAntTask.java
+++ b/src/main/java/org/testng/TestNGAntTask.java
@@ -1104,7 +1104,7 @@ public class TestNGAntTask extends Task {
}
public void setSkipFailedInvocationCounts(boolean skip) {
- m_skipFailedInvocationCounts = Boolean.valueOf(skip);
+ m_skipFailedInvocationCounts = skip;
}
public void setXmlPathInJar(String path) {
diff --git a/src/main/java/org/testng/internal/Bsh.java b/src/main/java/org/testng/internal/Bsh.java
index ff2b70b..35ee76e 100644
--- a/src/main/java/org/testng/internal/Bsh.java
+++ b/src/main/java/org/testng/internal/Bsh.java
@@ -25,7 +25,7 @@ public class Bsh implements IBsh {
}
setContext(interpreter, tm.getMethod(), groups, tm);
Object evalResult = interpreter.eval(expression);
- result = ((Boolean) evalResult).booleanValue();
+ result = (Boolean) evalResult;
}
catch (EvalError evalError) {
Utils.log("bsh.Interpreter", 2, "Cannot evaluate expression:"
diff --git a/src/main/java/org/testng/internal/Constants.java b/src/main/java/org/testng/internal/Constants.java
index 37e2823..836e869 100755
--- a/src/main/java/org/testng/internal/Constants.java
+++ b/src/main/java/org/testng/internal/Constants.java
@@ -66,7 +66,7 @@ public class Constants {
String r = properties.getProperty(propertyName, p.getDefault());
boolean result = "true".equalsIgnoreCase(r);
- return Boolean.valueOf( result).booleanValue();
+ return Boolean.valueOf(result);
}
public static int getIntegerPropertyValue(Properties properties, String propertyName) {
diff --git a/src/main/java/org/testng/internal/annotations/Converter.java b/src/main/java/org/testng/internal/annotations/Converter.java
index 1d018dd..ee98c15 100755
--- a/src/main/java/org/testng/internal/annotations/Converter.java
+++ b/src/main/java/org/testng/internal/annotations/Converter.java
@@ -18,7 +18,7 @@ public class Converter {
public static boolean getBoolean(String tagValue, boolean def) {
boolean result = def;
if (tagValue != null) {
- result = Boolean.valueOf(tagValue).booleanValue();
+ result = Boolean.valueOf(tagValue);
}
return result;
}
@@ -26,7 +26,7 @@ public class Converter {
public static int getInt(String tagValue, int def) {
int result = def;
if (tagValue != null) {
- result = new Integer(tagValue).intValue();
+ result = new Integer(tagValue);
}
return result;
}
@@ -42,7 +42,7 @@ public class Converter {
public static long getLong(String tagValue, long def) {
long result = def;
if (tagValue != null) {
- result = new Long(tagValue).longValue();
+ result = new Long(tagValue);
}
return result;
}
diff --git a/src/main/java/org/testng/log4testng/Logger.java b/src/main/java/org/testng/log4testng/Logger.java
index e3a68cb..834051c 100755
--- a/src/main/java/org/testng/log4testng/Logger.java
+++ b/src/main/java/org/testng/log4testng/Logger.java
@@ -107,7 +107,7 @@ public class Logger {
static {
for(i= 0; i < LEVEL_COUNT; ++i) {
- levelMap.put(levelNames[i], Integer.valueOf(i));
+ levelMap.put(levelNames[i], i);
}
}
@@ -362,7 +362,7 @@ public class Logger {
throw new IllegalArgumentException("Unknown level for log4testng.rootLogger "
+ rootLevelStr + " in log4testng.properties");
}
- rootLoggerLevel= ilevel.intValue();
+ rootLoggerLevel= ilevel;
loglog4testng("Root level logger set to " + rootLevelStr + " level.");
}
}
@@ -421,7 +421,7 @@ public class Logger {
if(level != null) {
loglog4testng("Found level " + level + " for logger " + name);
- return level.intValue();
+ return level;
}
int dot= name.lastIndexOf('.');
if(dot == -1) {
diff --git a/src/main/java/org/testng/remote/strprotocol/GenericMessage.java b/src/main/java/org/testng/remote/strprotocol/GenericMessage.java
index d7997b2..8422ac4 100755
--- a/src/main/java/org/testng/remote/strprotocol/GenericMessage.java
+++ b/src/main/java/org/testng/remote/strprotocol/GenericMessage.java
@@ -49,7 +49,7 @@ public class GenericMessage implements IStringMessage {
// }
public GenericMessage addProperty(final String propName, final int propValue) {
- return addProperty(propName, Integer.valueOf(propValue));
+ return addProperty(propName, propValue);
}
// public String getProperty(final String propName) {
diff --git a/src/main/java/org/testng/xml/TestNGContentHandler.java b/src/main/java/org/testng/xml/TestNGContentHandler.java
index 6588152..1d93880 100755
--- a/src/main/java/org/testng/xml/TestNGContentHandler.java
+++ b/src/main/java/org/testng/xml/TestNGContentHandler.java
@@ -150,7 +150,7 @@ public class TestNGContentHandler extends DefaultHandler {
}
String jUnit = attributes.getValue("junit");
if (null != jUnit) {
- m_currentSuite.setJUnit( Boolean.valueOf(jUnit).booleanValue());
+ m_currentSuite.setJUnit(Boolean.valueOf(jUnit));
}
String parallel = attributes.getValue("parallel");
if (parallel != null) {
@@ -176,7 +176,7 @@ public class TestNGContentHandler extends DefaultHandler {
}
String groupByInstances = attributes.getValue("group-by-instances");
if (groupByInstances!= null) {
- m_currentSuite.setGroupByInstances(Boolean.valueOf(groupByInstances).booleanValue());
+ m_currentSuite.setGroupByInstances(Boolean.valueOf(groupByInstances));
}
String skip = attributes.getValue("skipfailedinvocationcounts");
if (skip != null) {
@@ -276,15 +276,15 @@ public class TestNGContentHandler extends DefaultHandler {
}
String jUnit = attributes.getValue("junit");
if (null != jUnit) {
- m_currentTest.setJUnit( Boolean.valueOf(jUnit).booleanValue());
+ m_currentTest.setJUnit(Boolean.valueOf(jUnit));
}
String skip = attributes.getValue("skipfailedinvocationcounts");
if (skip != null) {
- m_currentTest.setSkipFailedInvocationCounts(Boolean.valueOf(skip).booleanValue());
+ m_currentTest.setSkipFailedInvocationCounts(Boolean.valueOf(skip));
}
String groupByInstances = attributes.getValue("group-by-instances");
if (groupByInstances!= null) {
- m_currentTest.setGroupByInstances(Boolean.valueOf(groupByInstances).booleanValue());
+ m_currentTest.setGroupByInstances(Boolean.valueOf(groupByInstances));
}
String preserveOrder = attributes.getValue("preserve-order");
if (preserveOrder != null) {
diff --git a/src/main/java/org/testng/xml/XmlSuite.java b/src/main/java/org/testng/xml/XmlSuite.java
index 4efd874..bcf87f2 100755
--- a/src/main/java/org/testng/xml/XmlSuite.java
+++ b/src/main/java/org/testng/xml/XmlSuite.java
@@ -644,7 +644,7 @@ public class XmlSuite implements Serializable, Cloneable {
public long getTimeOut(long def) {
long result = def;
if (m_timeOut != null) {
- result = new Long(m_timeOut).longValue();
+ result = new Long(m_timeOut);
}
return result;
diff --git a/src/main/java/org/testng/xml/XmlTest.java b/src/main/java/org/testng/xml/XmlTest.java
index 47a7e6f..2868ca8 100755
--- a/src/main/java/org/testng/xml/XmlTest.java
+++ b/src/main/java/org/testng/xml/XmlTest.java
@@ -190,7 +190,7 @@ public class XmlTest implements Serializable, Cloneable {
* @param v
*/
public void setVerbose(int v) {
- m_verbose = Integer.valueOf(v);
+ m_verbose = v;
}
public int getThreadCount() {
@@ -243,7 +243,7 @@ public class XmlTest implements Serializable, Cloneable {
}
if (null != result) {
- return result.intValue();
+ return result;
} else {
return 1;
}
@@ -255,7 +255,7 @@ public class XmlTest implements Serializable, Cloneable {
result = m_suite.getGroupByInstances();
}
if (result != null) {
- return result.booleanValue();
+ return result;
} else {
return XmlSuite.DEFAULT_GROUP_BY_INSTANCES;
}
@@ -420,7 +420,7 @@ public class XmlTest implements Serializable, Cloneable {
public long getTimeOut(long def) {
long result = def;
if (getTimeOut() != null) {
- result = new Long(getTimeOut()).longValue();
+ result = new Long(getTimeOut());
}
return result;
diff --git a/src/test/java/org/testng/AssertTest.java b/src/test/java/org/testng/AssertTest.java
index 28a97b2..deefb61 100644
--- a/src/test/java/org/testng/AssertTest.java
+++ b/src/test/java/org/testng/AssertTest.java
@@ -123,8 +123,8 @@ public class AssertTest {
@Test(expectedExceptions = AssertionError.class)
public void assertEqualsSymmetricArrays() {
- Object[] actual = {new Integer(1), new Asymmetric(42, 'd'), "inDay"};
- Object[] expected = {new Integer(1), new Contrived(42), "inDay"};
+ Object[] actual = {1, new Asymmetric(42, 'd'), "inDay"};
+ Object[] expected = {1, new Contrived(42), "inDay"};
Assert.assertEquals(actual, expected);
}
diff --git a/src/test/java/test/asserttests/AssertTest.java b/src/test/java/test/asserttests/AssertTest.java
index c1ba49d..054442d 100644
--- a/src/test/java/test/asserttests/AssertTest.java
+++ b/src/test/java/test/asserttests/AssertTest.java
@@ -32,7 +32,7 @@ public class AssertTest {
@Test
public void int_Integer_Arrays() {
int[] intArr = {1, 2};
- Integer[] integerArr = {1, Integer.valueOf(2)};
+ Integer[] integerArr = {1, 2};
Assert.assertEquals(intArr, integerArr);
Assert.assertEquals(integerArr, intArr);
}
@@ -47,13 +47,13 @@ public class AssertTest {
@Test(expectedExceptions = AssertionError.class)
public void arraysFailures_2() {
int[] intArr = {1, 2};
- Assert.assertEquals(intArr, Long.valueOf(1));
+ Assert.assertEquals(intArr, (long) 1);
}
@Test(expectedExceptions = AssertionError.class)
public void arraysFailures_3() {
long[] longArr = {1};
- Assert.assertEquals(Long.valueOf(1), longArr);
+ Assert.assertEquals((long) 1, longArr);
}
@Test
diff --git a/src/test/java/test/dataprovider/InstanceDataProviderSampleTest.java b/src/test/java/test/dataprovider/InstanceDataProviderSampleTest.java
index 6b909e3..1a3b724 100644
--- a/src/test/java/test/dataprovider/InstanceDataProviderSampleTest.java
+++ b/src/test/java/test/dataprovider/InstanceDataProviderSampleTest.java
@@ -11,7 +11,7 @@ public class InstanceDataProviderSampleTest {
public Object[][] dp() {
p("DATA PROVIDER");
return new Object[][] {
- new Object[] { Integer.valueOf(hashCode()) },
+ new Object[] {hashCode()},
};
}
diff --git a/src/test/java/test/dataprovider/IterableTest.java b/src/test/java/test/dataprovider/IterableTest.java
index ce1d405..1cc63cd 100644
--- a/src/test/java/test/dataprovider/IterableTest.java
+++ b/src/test/java/test/dataprovider/IterableTest.java
@@ -9,9 +9,9 @@ public class IterableTest {
private boolean m_ok2 = false;
public static final String FN2 = "Anne Marie";
- public static final Integer LN2 = Integer.valueOf(37);
+ public static final Integer LN2 = 37;
public static final String FN1 = "Cedric";
- public static final Integer LN1 = Integer.valueOf(36);
+ public static final Integer LN1 = 36;
public static final Object[][] DATA = new Object[][] {
new Object[] { FN1, LN1 },
diff --git a/src/test/java/test/dataprovider/ParallelDataProviderTest.java b/src/test/java/test/dataprovider/ParallelDataProviderTest.java
index 395f951..7ccdf73 100644
--- a/src/test/java/test/dataprovider/ParallelDataProviderTest.java
+++ b/src/test/java/test/dataprovider/ParallelDataProviderTest.java
@@ -20,10 +20,10 @@ public class ParallelDataProviderTest extends SimpleBaseTest {
@DataProvider(name = "test1", parallel = true)
public Object[][] createData1() {
return new Object[][] {
- { "Cedric", Integer.valueOf(36) },
- { "Anne", Integer.valueOf(37) },
- { "A", Integer.valueOf(36) },
- { "B", Integer.valueOf(37) }
+ { "Cedric", 36},
+ { "Anne", 37},
+ { "A", 36},
+ { "B", 37}
};
}
// This test method declares that its data should be supplied by the Data
diff --git a/src/test/java/test/dataprovider/Sample1Test.java b/src/test/java/test/dataprovider/Sample1Test.java
index fea80a2..55dbf04 100644
--- a/src/test/java/test/dataprovider/Sample1Test.java
+++ b/src/test/java/test/dataprovider/Sample1Test.java
@@ -9,9 +9,9 @@ public class Sample1Test {
private boolean m_ok2 = false;
private static final String FN2 = "Anne Marie";
- private static final Integer LN2 = Integer.valueOf(37);
+ private static final Integer LN2 = 37;
private static final String FN1 = "Cedric";
- private static final Integer LN1 = Integer.valueOf(36);
+ private static final Integer LN1 = 36;
@DataProvider(name = "test1")
public Object[][] createData() {
diff --git a/src/test/java/test/dataprovider/TestInstanceTest.java b/src/test/java/test/dataprovider/TestInstanceTest.java
index e6dce54..fa9272d 100644
--- a/src/test/java/test/dataprovider/TestInstanceTest.java
+++ b/src/test/java/test/dataprovider/TestInstanceTest.java
@@ -24,8 +24,8 @@ public class TestInstanceTest {
Assert.assertTrue(o0.m_n == 1 || o0.m_n == 2);
m_instanceCount++;
return new Object[][] {
- new Object[] { Integer.valueOf(42) },
- new Object[] { Integer.valueOf(43) },
+ new Object[] {42},
+ new Object[] {43},
};
}
diff --git a/src/test/java/test/factory/FactoryTest2.java b/src/test/java/test/factory/FactoryTest2.java
index 9dc100b..598ba03 100644
--- a/src/test/java/test/factory/FactoryTest2.java
+++ b/src/test/java/test/factory/FactoryTest2.java
@@ -28,7 +28,7 @@ public class FactoryTest2 {
@Test(groups = { "first" })
public void testInt() {
- Integer n = Integer.valueOf(m_number);
+ Integer n = m_number;
m_numbers.put(n, n);
}
diff --git a/src/test/java/test/factory/FactoryWithInstanceInfoTest2.java b/src/test/java/test/factory/FactoryWithInstanceInfoTest2.java
index b8ce967..520af05 100644
--- a/src/test/java/test/factory/FactoryWithInstanceInfoTest2.java
+++ b/src/test/java/test/factory/FactoryWithInstanceInfoTest2.java
@@ -28,7 +28,7 @@ public class FactoryWithInstanceInfoTest2 {
@Test(groups = { "first" })
public void testInt() {
- Integer n = Integer.valueOf(m_number);
+ Integer n = m_number;
m_numbers.put(n, n);
}
diff --git a/src/test/java/test/factory/VerifyFactoryTest.java b/src/test/java/test/factory/VerifyFactoryTest.java
index 60fe74d..3ec6d56 100644
--- a/src/test/java/test/factory/VerifyFactoryTest.java
+++ b/src/test/java/test/factory/VerifyFactoryTest.java
@@ -8,9 +8,9 @@ public class VerifyFactoryTest {
@Test(dependsOnGroups = { "first" } )
public void mainCheck() {
Map<Integer, Integer> numbers = FactoryTest2.getNumbers();
- assert null != numbers.get(Integer.valueOf(42))
+ assert null != numbers.get(42)
: "Didn't find 42";
- assert null != numbers.get(Integer.valueOf(43))
+ assert null != numbers.get(43)
: "Didn't find 43";
assert 2 == numbers.size()
: "Expected 2 numbers, found " + (numbers.size());
diff --git a/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java b/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java
index 6075e3b..d9d52d6 100644
--- a/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java
+++ b/src/test/java/test/factory/VerifyFactoryWithInstanceInfoTest.java
@@ -8,9 +8,9 @@ public class VerifyFactoryWithInstanceInfoTest {
@Test(dependsOnGroups = { "first" } )
public void mainCheck() {
Map<Integer, Integer> numbers = FactoryWithInstanceInfoTest2.getNumbers();
- assert null != numbers.get(Integer.valueOf(42))
+ assert null != numbers.get(42)
: "Didn't find 42";
- assert null != numbers.get(Integer.valueOf(43))
+ assert null != numbers.get(43)
: "Didn't find 43";
assert 2 == numbers.size()
: "Expected 2 numbers, found " + (numbers.size());
diff --git a/src/test/java/test/thread/SequentialTest.java b/src/test/java/test/thread/SequentialTest.java
index 5870507..57b212b 100644
--- a/src/test/java/test/thread/SequentialTest.java
+++ b/src/test/java/test/thread/SequentialTest.java
@@ -77,9 +77,9 @@ public class SequentialTest extends BaseTest {
}
long[] ids = new long[] {
- maps[0].keySet().iterator().next().longValue(),
- maps[1].keySet().iterator().next().longValue(),
- maps[2].keySet().iterator().next().longValue(),
+ maps[0].keySet().iterator().next(),
+ maps[1].keySet().iterator().next(),
+ maps[2].keySet().iterator().next(),
};
Map<Long, Long> verifyMap = new HashMap<>();
diff --git a/src/test/java/test/timeout/TimeOutTest.java b/src/test/java/test/timeout/TimeOutTest.java
index 3545327..46ce74b 100644
--- a/src/test/java/test/timeout/TimeOutTest.java
+++ b/src/test/java/test/timeout/TimeOutTest.java
@@ -15,7 +15,7 @@ public class TimeOutTest extends BaseTest {
private Long m_id;
public TimeOutTest() {
- m_id = Long.valueOf(System.currentTimeMillis());
+ m_id = System.currentTimeMillis();
}
private void privateTimeOutTest(boolean parallel) {
diff --git a/src/test/java/test/tmp/AssertEqualsTest.java b/src/test/java/test/tmp/AssertEqualsTest.java
index 463f7a8..bcabe2a 100644
--- a/src/test/java/test/tmp/AssertEqualsTest.java
+++ b/src/test/java/test/tmp/AssertEqualsTest.java
@@ -41,17 +41,17 @@ public class AssertEqualsTest {
Set set1 = new LinkedHashSet();
Set set2 = new HashSet();
- set1.add(Integer.valueOf(5));
- set2.add(Integer.valueOf(5));
+ set1.add(5);
+ set2.add(5);
- set1.add(Integer.valueOf(6));
- set2.add(Integer.valueOf(6));
+ set1.add(6);
+ set2.add(6);
- set1.add(Integer.valueOf(1));
- set2.add(Integer.valueOf(1));
+ set1.add(1);
+ set2.add(1);
- set1.add(Integer.valueOf(9));
- set2.add(Integer.valueOf(9));
+ set1.add(9);
+ set2.add(9);
System.out.println("set1 is:" + set1.toString());
System.out.println("set2 is:" + set2.toString());
diff --git a/src/test/java/test/tmp/Test_TestListenerAppender.java b/src/test/java/test/tmp/Test_TestListenerAppender.java
index 72ab898..5bbfaba 100644
--- a/src/test/java/test/tmp/Test_TestListenerAppender.java
+++ b/src/test/java/test/tmp/Test_TestListenerAppender.java
@@ -8,7 +8,7 @@ public class Test_TestListenerAppender {
@DataProvider(name = "test1")
public Object[][] createData1() {
// throw new RuntimeException("Intentionally thrown exception");
- return new Object[][] { { "Cedric", Integer.valueOf(36) }, {"Anne", Integer.valueOf(37) }, };
+ return new Object[][] { { "Cedric", 36}, {"Anne", 37}, };
}
@Test(dataProvider = "test1")
diff --git a/src/test/java/test/triangle/CheckCount.java b/src/test/java/test/triangle/CheckCount.java
index 4dbf57b..40c4aa8 100644
--- a/src/test/java/test/triangle/CheckCount.java
+++ b/src/test/java/test/triangle/CheckCount.java
@@ -14,7 +14,7 @@ public class CheckCount {
try {
// System.out.println("\n\ntestCheckCount time = " + System.currentTimeMillis());
- int i = (Integer.valueOf(expectedCalls)).intValue();
+ int i = Integer.valueOf(expectedCalls);
int numCalls = CountCalls.getNumCalls();
assert (numCalls == i) : "Count calls expected " + i + " but got " + numCalls;
}
@@ -29,7 +29,7 @@ public class CheckCount {
try {
// System.out.println("\n\ntestCheckCount time = " + System.currentTimeMillis());
- int i = (Integer.valueOf(expectedCalls)).intValue();
+ int i = Integer.valueOf(expectedCalls);
int numCalls = CountCalls.getNumCalls();
assert (numCalls == i) : "Count calls expected " + i + " but got " + numCalls;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git
More information about the pkg-java-commits
mailing list