Camel-case parameter and internal names
Spelling
This commit is contained in:
@@ -1061,8 +1061,8 @@ public abstract class LogFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a filename, return an enumeration of URLs pointing to
|
* Given a file name, return an enumeration of URLs pointing to
|
||||||
* all the occurrences of that filename in the classpath.
|
* all the occurrences of that file name in the classpath.
|
||||||
* <p>
|
* <p>
|
||||||
* This is just like ClassLoader.getResources except that the
|
* This is just like ClassLoader.getResources except that the
|
||||||
* operation is done under an AccessController so that this method will
|
* operation is done under an AccessController so that this method will
|
||||||
@@ -1205,7 +1205,7 @@ public abstract class LogFactory {
|
|||||||
* Determines whether the user wants internal diagnostic output. If so,
|
* Determines whether the user wants internal diagnostic output. If so,
|
||||||
* returns an appropriate writer object. Users can enable diagnostic
|
* returns an appropriate writer object. Users can enable diagnostic
|
||||||
* output by setting the system property named {@link #DIAGNOSTICS_DEST_PROPERTY} to
|
* output by setting the system property named {@link #DIAGNOSTICS_DEST_PROPERTY} to
|
||||||
* a filename, or the special values STDOUT or STDERR.
|
* a file name, or the special values STDOUT or STDERR.
|
||||||
*/
|
*/
|
||||||
private static PrintStream initDiagnostics() {
|
private static PrintStream initDiagnostics() {
|
||||||
String dest;
|
String dest;
|
||||||
|
|||||||
@@ -118,15 +118,15 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
*/
|
*/
|
||||||
public void addLogicalLib(final String logicalLib) {
|
public void addLogicalLib(final String logicalLib) {
|
||||||
// first, check the system properties
|
// first, check the system properties
|
||||||
final String filename = System.getProperty(logicalLib);
|
final String fileName = System.getProperty(logicalLib);
|
||||||
if (filename != null) {
|
if (fileName != null) {
|
||||||
try {
|
try {
|
||||||
final URL libUrl = new File(filename).toURL();
|
final URL libUrl = new File(fileName).toURL();
|
||||||
addURL(libUrl);
|
addURL(libUrl);
|
||||||
return;
|
return;
|
||||||
} catch (final java.net.MalformedURLException e) {
|
} catch (final java.net.MalformedURLException e) {
|
||||||
throw new UnknownError(
|
throw new UnknownError(
|
||||||
"Invalid file [" + filename + "] for logical lib [" + logicalLib + "]");
|
"Invalid file [" + fileName + "] for logical lib [" + logicalLib + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* of {@code file:///some/where/foo-2.7.jar}.
|
* of {@code file:///some/where/foo-2.7.jar}.
|
||||||
* <p>
|
* <p>
|
||||||
* When multiple classpath entries match the specified logicalLib string,
|
* When multiple classpath entries match the specified logicalLib string,
|
||||||
* the one with the shortest filename component is returned. This means that
|
* the one with the shortest file name component is returned. This means that
|
||||||
* if "foo-1.1.jar" and "foobar-1.1.jar" are in the path, then a logicalLib
|
* if "foo-1.1.jar" and "foobar-1.1.jar" are in the path, then a logicalLib
|
||||||
* name of "foo" will match the first entry above.
|
* name of "foo" will match the first entry above.
|
||||||
*/
|
*/
|
||||||
@@ -268,22 +268,22 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
URL shortestMatch = null;
|
URL shortestMatch = null;
|
||||||
int shortestMatchLen = Integer.MAX_VALUE;
|
int shortestMatchLen = Integer.MAX_VALUE;
|
||||||
for (final URL u : path) {
|
for (final URL u : path) {
|
||||||
// extract the filename bit on the end of the url
|
// extract the file name bit on the end of the URL
|
||||||
String filename = u.toString();
|
String fileName = u.toString();
|
||||||
if (!filename.endsWith(".jar")) {
|
if (!fileName.endsWith(".jar")) {
|
||||||
// not a jarfile, ignore it
|
// not a jarfile, ignore it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int lastSlash = filename.lastIndexOf('/');
|
final int lastSlash = fileName.lastIndexOf('/');
|
||||||
if (lastSlash >= 0) {
|
if (lastSlash >= 0) {
|
||||||
filename = filename.substring(lastSlash+1);
|
fileName = fileName.substring(lastSlash+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok, this is a candidate
|
// ok, this is a candidate
|
||||||
if (filename.startsWith(logicalLib) && filename.length() < shortestMatchLen) {
|
if (fileName.startsWith(logicalLib) && fileName.length() < shortestMatchLen) {
|
||||||
shortestMatch = u;
|
shortestMatch = u;
|
||||||
shortestMatchLen = filename.length();
|
shortestMatchLen = fileName.length();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ public class ChildFirstTestCase extends TestCase {
|
|||||||
|
|
||||||
// getResource where it is accessable to both classloaders. The one visible
|
// getResource where it is accessable to both classloaders. The one visible
|
||||||
// to the child should be returned. The URL returned will be of form
|
// to the child should be returned. The URL returned will be of form
|
||||||
// jar:file:/x/y.jar!path/to/resource. The filename part should include the jarname
|
// jar:file:/x/y.jar!path/to/resource. The file name part should include the jarname
|
||||||
// of form commons-logging-adapters-nnnn.jar, not commons-logging-nnnn.jar
|
// of form commons-logging-adapters-nnnn.jar, not commons-logging-nnnn.jar
|
||||||
resource = childLoader.getResource("org/apache/commons/logging/impl/Log4JLogger.class");
|
resource = childLoader.getResource("org/apache/commons/logging/impl/Log4JLogger.class");
|
||||||
assertNotNull("Unable to locate Log4JLogger.class resource", resource);
|
assertNotNull("Unable to locate Log4JLogger.class resource", resource);
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ public class ParentFirstTestCase extends TestCase {
|
|||||||
|
|
||||||
// getResource where it is accessable to both classloaders. The one visible
|
// getResource where it is accessable to both classloaders. The one visible
|
||||||
// to the parent should be returned. The URL returned will be of form
|
// to the parent should be returned. The URL returned will be of form
|
||||||
// jar:file:/x/y.jar!path/to/resource. The filename part should include the jarname
|
// jar:file:/x/y.jar!path/to/resource. The file name part should include the jarname
|
||||||
// of form commons-logging-nnnn.jar, not commons-logging-adapters-nnnn.jar
|
// of form commons-logging-nnnn.jar, not commons-logging-adapters-nnnn.jar
|
||||||
resource = childLoader.getResource("org/apache/commons/logging/impl/Log4JLogger.class");
|
resource = childLoader.getResource("org/apache/commons/logging/impl/Log4JLogger.class");
|
||||||
assertNotNull("Unable to locate Log4JLogger.class resource", resource);
|
assertNotNull("Unable to locate Log4JLogger.class resource", resource);
|
||||||
|
|||||||
Reference in New Issue
Block a user