Tidy up uses of Integer.valueOf.
Use parseInt when the result is assigned to an int. Allocates fewer
objects.
bug: 28078871
(cherry picked from commit a4db66765c8f9bb482d348830b562a54ac28bb5c)
Change-Id: I1e612dea34347d0ccf2bc47ca6c7219fd51a42a9
diff --git a/ojluni/src/main/java/sun/misc/Version.java b/ojluni/src/main/java/sun/misc/Version.java
index 0a7de82..2908005 100644
--- a/ojluni/src/main/java/sun/misc/Version.java
+++ b/ojluni/src/main/java/sun/misc/Version.java
@@ -280,7 +280,7 @@
int nextChar = 3;
try {
String uu = cs.subSequence(1, 3).toString();
- jvm_update_version = Integer.valueOf(uu).intValue();
+ jvm_update_version = Integer.parseInt(uu);
if (cs.length() >= 4) {
char c = cs.charAt(3);
if (c >= 'a' && c <= 'z') {
@@ -305,7 +305,7 @@
Character.isDigit(s.charAt(1)) &&
Character.isDigit(s.charAt(2))) {
jvm_build_number =
- Integer.valueOf(s.substring(1, 3)).intValue();
+ Integer.parseInt(s.substring(1, 3));
break;
}
}
diff --git a/ojluni/src/main/java/sun/nio/ch/EPollSelectorImpl.java b/ojluni/src/main/java/sun/nio/ch/EPollSelectorImpl.java
index aac539b..113f84b 100755
--- a/ojluni/src/main/java/sun/nio/ch/EPollSelectorImpl.java
+++ b/ojluni/src/main/java/sun/nio/ch/EPollSelectorImpl.java
@@ -159,7 +159,7 @@
if (closed)
throw new ClosedSelectorException();
SelChImpl ch = ski.channel;
- int fd = Integer.valueOf(ch.getFDVal());
+ Integer fd = Integer.valueOf(ch.getFDVal());
fdToKey.put(fd, ski);
pollWrapper.add(fd);
keys.add(ski);
diff --git a/ojluni/src/main/java/sun/security/ssl/SSLSessionContextImpl.java b/ojluni/src/main/java/sun/security/ssl/SSLSessionContextImpl.java
index 51fac9b..756a48e 100755
--- a/ojluni/src/main/java/sun/security/ssl/SSLSessionContextImpl.java
+++ b/ojluni/src/main/java/sun/security/ssl/SSLSessionContextImpl.java
@@ -207,7 +207,7 @@
"javax.net.ssl.sessionCacheSize");
}
});
- cacheLimit = (s != null) ? Integer.valueOf(s).intValue() : 0;
+ cacheLimit = (s != null) ? Integer.parseInt(s) : 0;
} catch (Exception e) {
}