Author: markt
Date: Fri Dec 5 15:26:05 2014
New Revision: 1643329
URL: http://svn.apache.org/r1643329
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57308
Avoid unnecessary use of System.getProperty("file.separator")
Modified:
tomcat/tc8.0.x/trunk/ (props changed)
tomcat/tc8.0.x/trunk/java/javax/el/ExpressionFactory.java
tomcat/tc8.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc8.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 5 15:26:05 2014
@@ -1 +1 @@
-/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642668,1642679,1642697,1642699,1643002,1643066,1643121,1643206,1643209-1643210,1643216,1643249,1643270,1643283
+/tomcat/trunk:1636524,1637156,1637176,1637188,1637331,1637684,1637695,1638720-1638725,1639653,1640010,1640084,1640088,1640275,1640322,1640347,1640361,1640365,1640403,1640410,1640652,1640655-1640658,1640688,1640700-1640883,1640903,1640976,1640978,1641000,1641026,1641038-1641039,1641051-1641052,1641058,1641064,1641300,1641369,1641374,1641380,1641486,1641634,1641656-1641692,1641704,1641707-1641718,1641720-1641722,1641735,1641981,1642668,1642679,1642697,1642699,1643002,1643066,1643121,1643206,1643209-1643210,1643216,1643249,1643270,1643283,1643309
Modified: tomcat/tc8.0.x/trunk/java/javax/el/ExpressionFactory.java
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/javax/el/ExpressionFactory.java?rev=1643329&r1=1643328&r2=1643329&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/javax/el/ExpressionFactory.java (original)
+++ tomcat/tc8.0.x/trunk/java/javax/el/ExpressionFactory.java Fri Dec 5
15:26:05 2014
@@ -53,7 +53,6 @@ public abstract class ExpressionFactory
private static final String PROPERTY_NAME = "javax.el.ExpressionFactory";
- private static final String SEP;
private static final String PROPERTY_FILE;
private static final CacheValue nullTcclFactory = new CacheValue();
@@ -62,29 +61,19 @@ public abstract class ExpressionFactory
static {
if (IS_SECURITY_ENABLED) {
- SEP = AccessController.doPrivileged(
- new PrivilegedAction<String>(){
- @Override
- public String run() {
- return System.getProperty("file.separator");
- }
-
- }
- );
PROPERTY_FILE = AccessController.doPrivileged(
new PrivilegedAction<String>(){
@Override
public String run() {
- return System.getProperty("java.home") + SEP +
- "lib" + SEP + "el.properties";
+ return System.getProperty("java.home") +
File.separator +
+ "lib" + File.separator + "el.properties";
}
}
);
} else {
- SEP = System.getProperty("file.separator");
- PROPERTY_FILE = System.getProperty("java.home") + SEP + "lib" +
- SEP + "el.properties";
+ PROPERTY_FILE = System.getProperty("java.home") + File.separator +
"lib" +
+ File.separator + "el.properties";
}
}
Modified:
tomcat/tc8.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java?rev=1643329&r1=1643328&r2=1643329&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
(original)
+++ tomcat/tc8.0.x/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
Fri Dec 5 15:26:05 2014
@@ -16,6 +16,7 @@
*/
package org.apache.juli;
+import java.io.File;
import java.util.Collections;
import java.util.Random;
import java.util.logging.LogManager;
@@ -39,22 +40,22 @@ public class TestClassLoaderLogManager {
Assert.assertEquals(
System.getProperty("line.separator")
+ System.getProperty("path.separator")
- + System.getProperty("file.separator"),
+ + File.separator,
logManager
.replace("${line.separator}${path.separator}${file.separator}"));
Assert.assertEquals(
- "foo" + System.getProperty("file.separator") + "bar"
+ "foo" + File.separator + "bar"
+ System.getProperty("line.separator")
+ System.getProperty("path.separator") + "baz",
logManager
.replace("foo${file.separator}bar${line.separator}${path.separator}baz"));
// BZ 51249
Assert.assertEquals(
- "%{file.separator}" + System.getProperty("file.separator"),
+ "%{file.separator}" + File.separator,
logManager.replace("%{file.separator}${file.separator}"));
Assert.assertEquals(
- System.getProperty("file.separator") + "${undefinedproperty}"
- + System.getProperty("file.separator"),
+ File.separator + "${undefinedproperty}"
+ + File.separator,
logManager
.replace("${file.separator}${undefinedproperty}${file.separator}"));
Assert.assertEquals("${}" + System.getProperty("path.separator"),
Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1643329&r1=1643328&r2=1643329&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Fri Dec 5 15:26:05 2014
@@ -108,6 +108,11 @@
configured programmatically via the Servlet 3.0 API and then used
without error when running under a SecurityManager. (markt)
</fix>
+ <fix>
+ <bug>57308</bug>: Remove unnecessary calls to
+ <code>System.getProperty()</code> where more suitable API calls are
+ available. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]