Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2021-03-26 11:07:26 +0000
committerLars Vogel2021-04-01 09:17:51 +0000
commit387bf8c03d0de22aea41c733c35dc152d68c4f75 (patch)
tree704759b6986e3a43c97724a14aae16953caa3786
parent5317f1b31fdf822f57fb825b216019695f62dc69 (diff)
downloadeclipse.platform.ua-I20210405-0630.tar.gz
eclipse.platform.ua-I20210405-0630.tar.xz
eclipse.platform.ua-I20210405-0630.zip
A boxed primitive is created from a String, just to extract the unboxed primitive value.It is more efficient to just call the static parseXXX method. Before: int number = Integer.valueOf("42", 8); new Double("42.42").doubleValue(); After: int number = Integer.parseInt("42", 8); Double.parseDouble("42.42"); Change-Id: I86f3ec28abf9d9258516161bc5933b0c1d247079 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/HttpsUtility.java2
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteContextProvider.java2
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteSearchManager.java2
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteTocProvider.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/HttpsUtility.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/HttpsUtility.java
index a0054d779..6b9d3dffd 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/HttpsUtility.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/HttpsUtility.java
@@ -59,7 +59,7 @@ public class HttpsUtility {
public static InputStream getHttpsInputStream(String thisProtocol,String thisHost, String thisPort, String thisPath, String locale)
{
try {
- URL url = new URL(thisProtocol, thisHost, Integer.valueOf(thisPort) .intValue(),
+ URL url = new URL(thisProtocol, thisHost, Integer.parseInt(thisPort),
thisPath + PATH_TOC + '?' + PARAM_LANG + '=' + locale);
return getHttpsStream(url);
} catch (Exception e) {
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteContextProvider.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteContextProvider.java
index fabd05f83..ebde30fdb 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteContextProvider.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteContextProvider.java
@@ -65,7 +65,7 @@ public class RemoteContextProvider extends AbstractContextProvider {
HttpURLConnection connection;
if(protocols[i].equals(PROTOCOL))
{
- url = new URL(PROTOCOL, host[i], Integer.valueOf(port[i]).intValue(), path[i]+ PATH_CONTEXT + '?' + PARAM_ID + '=' + id + '&' + PARAM_LANG + '=' + locale);
+ url = new URL(PROTOCOL, host[i], Integer.parseInt(port[i]), path[i]+ PATH_CONTEXT + '?' + PARAM_ID + '=' + id + '&' + PARAM_LANG + '=' + locale);
connection = (HttpURLConnection)ProxyUtil.getConnection(url);
if (connection.getResponseCode() == 200) {
in = connection.getInputStream();
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteSearchManager.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteSearchManager.java
index b30deaeea..27bf22c15 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteSearchManager.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteSearchManager.java
@@ -68,7 +68,7 @@ public class RemoteSearchManager {
if(protocols[i].equals(PROTOCOL_HTTP))
{
- url = new URL("http", host[i], Integer.valueOf(port[i]).intValue(), path[i] + PATH_SEARCH + '?' + PARAM_PHRASE + '=' + URLCoder.encode(searchQuery.getSearchWord()) + '&' + PARAM_LANG + '=' + searchQuery.getLocale()); //$NON-NLS-1$
+ url = new URL("http", host[i], Integer.parseInt(port[i]), path[i] + PATH_SEARCH + '?' + PARAM_PHRASE + '=' + URLCoder.encode(searchQuery.getSearchWord()) + '&' + PARAM_LANG + '=' + searchQuery.getLocale()); //$NON-NLS-1$
in = ProxyUtil.getStream(url);
}
else
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteTocProvider.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteTocProvider.java
index 60e5287b8..51dcc962d 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteTocProvider.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteTocProvider.java
@@ -80,7 +80,7 @@ public class RemoteTocProvider extends AbstractTocProvider {
if(protocol[i].equalsIgnoreCase(PROTOCOL))
{
- url = new URL(protocol[i], host[i], Integer.valueOf(port[i]) .intValue(),
+ url = new URL(protocol[i], host[i], Integer.parseInt(port[i]),
path[i] + PATH_TOC + '?' + PARAM_LANG + '=' + locale);
in = ProxyUtil.getStream(url);

Back to the top