diff options
author | Lars Vogel | 2021-03-19 09:19:25 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-03-19 10:23:55 +0000 |
commit | 254ebab55170f7d237d8498eccc72c3be873c7c4 (patch) | |
tree | 0ae6e063871862b7a21a369447b1bf37c98d8776 | |
parent | bf7f5c79a7d69f6babc596a1817d9f7552e2a92b (diff) | |
download | eclipse.platform.ua-254ebab55170f7d237d8498eccc72c3be873c7c4.tar.gz eclipse.platform.ua-254ebab55170f7d237d8498eccc72c3be873c7c4.tar.xz eclipse.platform.ua-254ebab55170f7d237d8498eccc72c3be873c7c4.zip |
[Cleanup] Redundant substring() operation in help.webappI20210321-1800I20210321-0340I20210320-1800I20210320-0650I20210319-1800
Removes the second substring() parameter if this parameter is the length
of the string. It's the default value.
Found during testing of Bug 569800 (new JDT cleanup for this case).
Change-Id: I5e4f5fb3fb20eea1b05a44bbd604483b032358cb
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r-- | org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/PrintData.java | 2 | ||||
-rw-r--r-- | org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/ServletResources.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/PrintData.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/PrintData.java index f5ad0122f..80cea8319 100644 --- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/PrintData.java +++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/PrintData.java @@ -506,7 +506,7 @@ public class PrintData extends RequestData { private static String getAnchor(String href) { int index = href.indexOf('#'); if (index != -1) { - return href.substring(index, href.length()); + return href.substring(index); } return ""; //$NON-NLS-1$ } diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/ServletResources.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/ServletResources.java index 63cf28df0..63577de35 100644 --- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/ServletResources.java +++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/ServletResources.java @@ -59,7 +59,7 @@ public class ServletResources { return property; } return property.substring(0, amp) - + property.substring(amp + 1, property.length()); + + property.substring(amp + 1); } /** @@ -119,7 +119,7 @@ public class ServletResources { return property.substring(0, amp) + acceleratorPrefix + property.charAt(amp+1) + acceleratorSuffix - + property.substring(amp + 2, property.length()); + + property.substring(amp + 2); } /** |