Format: "catch(" -> "catch ("
This commit is contained in:
@@ -141,7 +141,7 @@ public class LoadTestCase extends TestCase{
|
||||
setAllowFlawedContext(cls, "false");
|
||||
execute(cls);
|
||||
fail("Logging config succeeded when context classloader was null!");
|
||||
} catch(final LogConfigurationException ex) {
|
||||
} catch (final LogConfigurationException ex) {
|
||||
// expected; the boot classloader doesn't *have* JCL available
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class LoadTestCase extends TestCase{
|
||||
execute(cls);
|
||||
fail("Error: somehow downcast a Logger loaded via system classloader"
|
||||
+ " to the Log interface loaded via a custom classloader");
|
||||
} catch(final LogConfigurationException ex) {
|
||||
} catch (final LogConfigurationException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
final URL libUrl = new File(filename).toURL();
|
||||
addURL(libUrl);
|
||||
return;
|
||||
} catch(final java.net.MalformedURLException e) {
|
||||
} catch (final java.net.MalformedURLException e) {
|
||||
throw new UnknownError(
|
||||
"Invalid file [" + filename + "] for logical lib [" + logicalLib + "]");
|
||||
}
|
||||
@@ -322,7 +322,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
resolveClass(clazz);
|
||||
}
|
||||
return clazz;
|
||||
} catch(final ClassNotFoundException e) {
|
||||
} catch (final ClassNotFoundException e) {
|
||||
return super.loadClass(name, resolve);
|
||||
}
|
||||
}
|
||||
@@ -413,7 +413,7 @@ public class PathableClassLoader extends URLClassLoader {
|
||||
if (local != null) {
|
||||
try {
|
||||
return local.openStream();
|
||||
} catch(final IOException e) {
|
||||
} catch (final IOException e) {
|
||||
// TODO: check if this is right or whether we should
|
||||
// fall back to trying parent. The javadoc doesn't say...
|
||||
return null;
|
||||
|
||||
@@ -135,7 +135,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
targetCL.loadClass(className);
|
||||
// fail("Class already in target classloader");
|
||||
return;
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok, go ahead and load it
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
||||
args[3] = new Integer(classData.length);
|
||||
m.setAccessible(true);
|
||||
m.invoke(targetCL, args);
|
||||
} catch(final Exception e) {
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
fail("Unable to load class " + className);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public class ChildFirstTestCase extends TestCase {
|
||||
final Class noSuchClass = contextLoader.loadClass("no.such.class");
|
||||
fail("Class no.such.class is unexpectedly available");
|
||||
assertNotNull(noSuchClass); // silence warning about unused var
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ public class ParentFirstTestCase extends TestCase {
|
||||
final Class noSuchClass = contextLoader.loadClass("no.such.class");
|
||||
fail("Class no.such.class is unexpectedly available");
|
||||
assertNotNull(noSuchClass); // silence warning about unused var
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public class SecurityAllowedTestCase extends TestCase
|
||||
// we better compare that we have no security exception during the call to log
|
||||
// IBM JVM tries to load bundles during the invoke call, which increase the count
|
||||
assertEquals("Untrusted code count", untrustedCodeCount, mySecurityManager.getUntrustedCodeCount());
|
||||
} catch(final Throwable t) {
|
||||
} catch (final Throwable t) {
|
||||
// Restore original security manager so output can be generated; the
|
||||
// PrintWriter constructor tries to read the line.separator
|
||||
// system property.
|
||||
|
||||
@@ -131,7 +131,7 @@ public class SecurityForbiddenTestCase extends TestCase
|
||||
CustomHashtable.class.getName(), ftClassName);
|
||||
|
||||
assertEquals(0, mySecurityManager.getUntrustedCodeCount());
|
||||
} catch(final Throwable t) {
|
||||
} catch (final Throwable t) {
|
||||
// Restore original security manager so output can be generated; the
|
||||
// PrintWriter constructor tries to read the line.separator
|
||||
// system property.
|
||||
@@ -164,7 +164,7 @@ public class SecurityForbiddenTestCase extends TestCase
|
||||
|
||||
System.setSecurityManager(oldSecMgr);
|
||||
assertEquals(0, mySecurityManager.getUntrustedCodeCount());
|
||||
} catch(final Throwable t) {
|
||||
} catch (final Throwable t) {
|
||||
// Restore original security manager so output can be generated; the
|
||||
// PrintWriter constructor tries to read the line.separator
|
||||
// system property.
|
||||
|
||||
@@ -122,7 +122,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
final Class clazz = thisClassLoader.loadClass(MY_LOG_IMPL);
|
||||
fail("Unexpectedly able to load MyLog via test class classloader");
|
||||
assertNotNull(clazz); // silence warnings about unused var
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok, expected
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
try {
|
||||
final Class clazz = tcclLoader.loadClass(MY_LOG_IMPL);
|
||||
assertNotNull(clazz);
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
fail("Unexpectedly unable to load MyLog via tccl classloader");
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
fail("Unexpectedly succeeded in loading a custom Log class"
|
||||
+ " that is only accessable via the tccl.");
|
||||
assertNotNull(log); // silence compiler warning about unused var
|
||||
} catch(final LogConfigurationException ex) {
|
||||
} catch (final LogConfigurationException ex) {
|
||||
// ok, expected
|
||||
final int index = ex.getMessage().indexOf(MY_LOG_IMPL);
|
||||
assertTrue("MyLog not found", index >= 0);
|
||||
|
||||
@@ -122,7 +122,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
final Class clazz = thisClassLoader.loadClass(MY_LOG_IMPL);
|
||||
fail("Unexpectedly able to load MyLog via test class classloader");
|
||||
assertNotNull(clazz); // silence warnings about unused var
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok, expected
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
try {
|
||||
final Class clazz = tcclLoader.loadClass(MY_LOG_IMPL);
|
||||
assertNotNull(clazz);
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
fail("Unexpectedly unable to load MyLog via tccl classloader");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
final Class clazz = thisClassLoader.loadClass(MY_LOG_FACTORY_IMPL);
|
||||
fail("Unexpectedly able to load MyLogFactoryImpl via test class classloader");
|
||||
assertNotNull(clazz); // silence warning about unused var
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok, expected
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
try {
|
||||
final Class clazz = tcclLoader.loadClass(MY_LOG_FACTORY_IMPL);
|
||||
assertNotNull(clazz);
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
fail("Unexpectedly unable to load MyLogFactoryImpl via tccl classloader");
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class TcclDisabledTestCase extends TestCase {
|
||||
final LogFactory instance = LogFactory.getFactory();
|
||||
fail("Unexpectedly succeeded in loading custom factory, though TCCL disabled.");
|
||||
assertNotNull(instance); // silence warning about unused var
|
||||
} catch(final org.apache.commons.logging.LogConfigurationException ex) {
|
||||
} catch (final org.apache.commons.logging.LogConfigurationException ex) {
|
||||
// ok, custom MyLogFactoryImpl as specified in props_disable_tccl
|
||||
// could not be found.
|
||||
final int index = ex.getMessage().indexOf(MY_LOG_FACTORY_IMPL);
|
||||
|
||||
@@ -119,7 +119,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
"org.apache.commons.logging.tccl.custom.MyLogFactoryImpl");
|
||||
fail("Unexpectedly able to load MyLogFactoryImpl via test class classloader");
|
||||
assertNotNull(clazz); // silence warning about unused var
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
// ok, expected
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class TcclEnabledTestCase extends TestCase {
|
||||
final Class clazz = tcclLoader.loadClass(
|
||||
"org.apache.commons.logging.tccl.custom.MyLogFactoryImpl");
|
||||
assertNotNull(clazz);
|
||||
} catch(final ClassNotFoundException ex) {
|
||||
} catch (final ClassNotFoundException ex) {
|
||||
fail("Unexpectedly unable to load MyLogFactoryImpl via tccl classloader");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user