1
0

Format: "catch(" -> "catch ("

This commit is contained in:
Gary Gregory
2023-04-18 10:56:16 -04:00
parent f87a49c957
commit 869eaa18df
14 changed files with 28 additions and 28 deletions

View File

@@ -83,7 +83,7 @@ public class Log4JLogger implements Log, Serializable {
Priority _traceLevel;
try {
_traceLevel = (Priority) Level.class.getDeclaredField("TRACE").get(null);
} catch(final Exception ex) {
} catch (final Exception ex) {
// ok, trace not available
_traceLevel = Level.DEBUG;
}

View File

@@ -102,19 +102,19 @@ public class ServletContextCleaner implements ServletContextListener {
final Method releaseMethod = logFactoryClass.getMethod("release", RELEASE_SIGNATURE);
releaseMethod.invoke(null, params);
loader = logFactoryClass.getClassLoader().getParent();
} catch(final ClassNotFoundException ex) {
} catch (final ClassNotFoundException ex) {
// Neither the current classloader nor any of its ancestors could find
// the LogFactory class, so we can stop now.
loader = null;
} catch(final NoSuchMethodException ex) {
} catch (final NoSuchMethodException ex) {
// This is not expected; every version of JCL has this method
System.err.println("LogFactory instance found which does not support release method!");
loader = null;
} catch(final IllegalAccessException ex) {
} catch (final IllegalAccessException ex) {
// This is not expected; every ancestor class should be accessible
System.err.println("LogFactory instance found which is not accessable!");
loader = null;
} catch(final InvocationTargetException ex) {
} catch (final InvocationTargetException ex) {
// This is not expected
System.err.println("LogFactory instance release method failed!");
loader = null;

View File

@@ -182,7 +182,7 @@ public class SimpleLog implements Log, Serializable {
dateTimeFormat);
try {
dateFormatter = new SimpleDateFormat(dateTimeFormat);
} catch(final IllegalArgumentException e) {
} catch (final IllegalArgumentException e) {
// If the format pattern is invalid - use the default format
dateTimeFormat = DEFAULT_DATE_TIME_FORMAT;
dateFormatter = new SimpleDateFormat(dateTimeFormat);

View File

@@ -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
}
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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);

View File

@@ -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");
}
}

View File

@@ -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);

View File

@@ -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");
}
}