You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mb...@apache.org on 2023/02/03 23:28:36 UTC
[netbeans] branch master updated: nbbuild dir: removed unessesary old forms of Integer type
This is an automated email from the ASF dual-hosted git repository.
mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new b33c63b08b nbbuild dir: removed unessesary old forms of Integer type
new 5c4bcf2ccf Merge pull request #5238 from tbw777/bumInteger/NBBuild
b33c63b08b is described below
commit b33c63b08bbb0ae19612df9f456cad709857bc86
Author: Andrei Briukhov <an...@gmail.com>
AuthorDate: Sat Jan 7 07:33:05 2023 -0300
nbbuild dir: removed unessesary old forms of Integer type
Changed boxing/autoboxing with Integer()/valueOf()/intValue() to raw int values or parseInt(some string)
---
nbbuild/antsrc/org/netbeans/nbbuild/ModuleDependencies.java | 8 ++++----
.../org/netbeans/installer/utils/applications/GlassFishUtils.java | 2 +-
.../wizard/components/sequences/netbeans/NbMainSequence.java | 2 +-
.../installer/test/test/org/netbeans/test/installer/TestData.java | 2 +-
.../installer/test/test/org/netbeans/test/installer/Utils.java | 8 ++++----
nbbuild/test/unit/src/org/netbeans/nbbuild/TestBase.java | 6 ++----
6 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/ModuleDependencies.java b/nbbuild/antsrc/org/netbeans/nbbuild/ModuleDependencies.java
index 3dd5ee8ba3..0350bcc8a3 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/ModuleDependencies.java
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/ModuleDependencies.java
@@ -179,7 +179,7 @@ public class ModuleDependencies extends Task {
majorVersion = -1;
} else {
codebasename = module.substring (0, slash);
- majorVersion = Integer.valueOf(module.substring(slash + 1));
+ majorVersion = Integer.parseInt(module.substring(slash + 1));
}
m = new ModuleInfo (input.name, f, codebasename);
m.majorVersion = majorVersion;
@@ -1172,11 +1172,11 @@ public class ModuleDependencies extends Task {
String major = token.substring (slash + 1);
int range = major.indexOf ('-');
if (range == -1) {
- this.majorVersionFrom = Integer.valueOf(major);
+ this.majorVersionFrom = Integer.parseInt(major);
this.majorVersionTo = majorVersionFrom;
} else {
- this.majorVersionFrom = Integer.valueOf(major.substring(0, range));
- this.majorVersionTo = Integer.valueOf(major.substring(range + 1));
+ this.majorVersionFrom = Integer.parseInt(major.substring(0, range));
+ this.majorVersionTo = Integer.parseInt(major.substring(range + 1));
}
}
this.type = type;
diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java
index 99b8887746..4ed66e6872 100644
--- a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java
+++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java
@@ -307,7 +307,7 @@ public class GlassFishUtils {
final String port = element.getAttribute("port");
if (id.contains("admin")) {
- return new Integer(port);
+ return Integer.parseInt(port);
}
}
}
diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java
index ae2f19a734..db300cd308 100644
--- a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java
+++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java
@@ -184,7 +184,7 @@ public class NbMainSequence extends WizardSequence {
progress.getDetail().substring(SIZE_MODULES_PATTERN.length()) :
progress.getDetail().substring(SIZE_UPDATES_PATTERN.length());
try {
- sizeOfModules = Integer.valueOf(size);
+ sizeOfModules = Integer.parseInt(size);
if (sizeOfModules > 0) {
spendPercentage = spendPercentage + INSTALL_STEP;
}
diff --git a/nbbuild/installer/test/test/org/netbeans/test/installer/TestData.java b/nbbuild/installer/test/test/org/netbeans/test/installer/TestData.java
index e200be2a47..aa8ee5cf20 100644
--- a/nbbuild/installer/test/test/org/netbeans/test/installer/TestData.java
+++ b/nbbuild/installer/test/test/org/netbeans/test/installer/TestData.java
@@ -267,7 +267,7 @@ public class TestData implements Serializable {
String proxyPort = System.getProperty("installer.proxy.port", null);
if (proxyHost != null && proxyPort != null) {
- proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, Integer.valueOf(proxyPort)));
+ proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort)));
} else {
proxy = Proxy.NO_PROXY;
}
diff --git a/nbbuild/installer/test/test/org/netbeans/test/installer/Utils.java b/nbbuild/installer/test/test/org/netbeans/test/installer/Utils.java
index 6f99335caf..67697960ab 100644
--- a/nbbuild/installer/test/test/org/netbeans/test/installer/Utils.java
+++ b/nbbuild/installer/test/test/org/netbeans/test/installer/Utils.java
@@ -461,7 +461,7 @@ public class Utils {
{
Utils.waitSecond(data, 5);
- TestCase.assertEquals("Installer Finshed", 0, ((Integer) System.getProperties().get("nbi.exit.code")).intValue());
+ TestCase.assertEquals("Installer Finshed", 0, (Integer) System.getProperties().get("nbi.exit.code"));
TestCase.assertEquals("NetBeans dir created", OK, Utils.dirExist(NB_DIR_NAME));
@@ -475,7 +475,7 @@ public class Utils {
Utils.waitSecond(data, 5);
- TestCase.assertEquals("Uninstaller Finshed", 0, ((Integer) System.getProperties().get("nbi.exit.code")).intValue());
+ TestCase.assertEquals("Uninstaller Finshed", 0, (Integer) System.getProperties().get("nbi.exit.code"));
TestCase.assertFalse("NetBeans dir deleted", Utils.dirExist(NB_DIR_NAME).equals(OK));
TestCase.assertFalse("Tomcat dir deleted", Utils.dirExist(TOMCAT_DIR_NAME).equals(OK));
@@ -493,7 +493,7 @@ public class Utils {
Utils.waitSecond(data, 5);
- TestCase.assertEquals("Installer Finshed", 0, ((Integer) System.getProperties().get("nbi.exit.code")).intValue());
+ TestCase.assertEquals("Installer Finshed", 0, (Integer) System.getProperties().get("nbi.exit.code"));
TestCase.assertEquals(
"NetBeans dir created",
@@ -519,7 +519,7 @@ public class Utils {
Utils.waitSecond(data, 5);
- TestCase.assertEquals("Uninstaller Finshed", 0, ((Integer) System.getProperties().get("nbi.exit.code")).intValue());
+ TestCase.assertEquals("Uninstaller Finshed", 0, (Integer) System.getProperties().get("nbi.exit.code"));
TestCase.assertFalse(
"NetBeans dir deleted",
diff --git a/nbbuild/test/unit/src/org/netbeans/nbbuild/TestBase.java b/nbbuild/test/unit/src/org/netbeans/nbbuild/TestBase.java
index 3d6e7342e7..9fc0634100 100644
--- a/nbbuild/test/unit/src/org/netbeans/nbbuild/TestBase.java
+++ b/nbbuild/test/unit/src/org/netbeans/nbbuild/TestBase.java
@@ -160,9 +160,7 @@ abstract class TestBase extends NbTestCase {
org.apache.tools.ant.Main.main(arr.toArray(new String[0]));
} catch (MySecExc ex) {
assertNotNull("The only one to throw security exception is MySecMan and should set exitCode", sec.exitCode);
- ExecutionError.assertExitCode(
- "Execution has to finish without problems",
- sec.exitCode.intValue());
+ ExecutionError.assertExitCode("Execution has to finish without problems", sec.exitCode);
} finally {
sec.setActive(false);
}
@@ -202,7 +200,7 @@ abstract class TestBase extends NbTestCase {
@Override
public void checkExit(int status) {
if (active) {
- exitCode = new Integer(status);
+ exitCode = status;
throw new MySecExc();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists