Remove unnecessary parentheses.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/logging/trunk@1432026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -60,7 +60,7 @@ public class LogConfigurationException extends RuntimeException {
|
||||
*/
|
||||
public LogConfigurationException(Throwable cause) {
|
||||
|
||||
this((cause == null) ? null : cause.toString(), cause);
|
||||
this(cause == null ? null : cause.toString(), cause);
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class LogConfigurationException extends RuntimeException {
|
||||
*/
|
||||
public Throwable getCause() {
|
||||
|
||||
return (this.cause);
|
||||
return this.cause;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -683,7 +683,7 @@ public abstract class LogFactory {
|
||||
public static Log getLog(Class clazz)
|
||||
throws LogConfigurationException {
|
||||
|
||||
return (getFactory().getInstance(clazz));
|
||||
return getFactory().getInstance(clazz);
|
||||
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ public abstract class LogFactory {
|
||||
public static Log getLog(String name)
|
||||
throws LogConfigurationException {
|
||||
|
||||
return (getFactory().getInstance(name));
|
||||
return getFactory().getInstance(name);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ public class LogSource {
|
||||
|
||||
// Is JDK 1.4 Logging Available?
|
||||
try {
|
||||
jdk14IsAvailable = (null != Class.forName("java.util.logging.Logger")) &&
|
||||
(null != Class.forName("org.apache.commons.logging.impl.Jdk14Logger"));
|
||||
jdk14IsAvailable = null != Class.forName("java.util.logging.Logger") &&
|
||||
null != Class.forName("org.apache.commons.logging.impl.Jdk14Logger");
|
||||
} catch (Throwable t) {
|
||||
jdk14IsAvailable = false;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class LogSource {
|
||||
|
||||
/** Get a <code>Log</code> instance by class name */
|
||||
static public Log getInstance(String name) {
|
||||
Log log = (Log) (logs.get(name));
|
||||
Log log = (Log) logs.get(name);
|
||||
if (null == log) {
|
||||
log = makeNewLogInstance(name);
|
||||
logs.put(name, log);
|
||||
@@ -229,7 +229,7 @@ public class LogSource {
|
||||
Log log;
|
||||
try {
|
||||
Object[] args = { name };
|
||||
log = (Log) (logImplctor.newInstance(args));
|
||||
log = (Log) logImplctor.newInstance(args);
|
||||
} catch (Throwable t) {
|
||||
log = null;
|
||||
}
|
||||
@@ -246,7 +246,7 @@ public class LogSource {
|
||||
* all logs known to me.
|
||||
*/
|
||||
static public String[] getLogNames() {
|
||||
return (String[]) (logs.keySet().toArray(new String[logs.size()]));
|
||||
return (String[]) logs.keySet().toArray(new String[logs.size()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
if (logger == null) {
|
||||
logger = Logger.getLogger(name);
|
||||
}
|
||||
return (logger);
|
||||
return logger;
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* Is debug logging currently enabled?
|
||||
*/
|
||||
public boolean isDebugEnabled() {
|
||||
return (getLogger().isLoggable(Level.FINE));
|
||||
return getLogger().isLoggable(Level.FINE);
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* Is error logging currently enabled?
|
||||
*/
|
||||
public boolean isErrorEnabled() {
|
||||
return (getLogger().isLoggable(Level.SEVERE));
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* Is fatal logging currently enabled?
|
||||
*/
|
||||
public boolean isFatalEnabled() {
|
||||
return (getLogger().isLoggable(Level.SEVERE));
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* Is info logging currently enabled?
|
||||
*/
|
||||
public boolean isInfoEnabled() {
|
||||
return (getLogger().isLoggable(Level.INFO));
|
||||
return getLogger().isLoggable(Level.INFO);
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* Is trace logging currently enabled?
|
||||
*/
|
||||
public boolean isTraceEnabled() {
|
||||
return (getLogger().isLoggable(Level.FINEST));
|
||||
return getLogger().isLoggable(Level.FINEST);
|
||||
}
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
||||
* Is warn logging currently enabled?
|
||||
*/
|
||||
public boolean isWarnEnabled() {
|
||||
return (getLogger().isLoggable(Level.WARNING));
|
||||
return getLogger().isLoggable(Level.WARNING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
if (logger == null) {
|
||||
logger = Logger.getLogger(name);
|
||||
}
|
||||
return (logger);
|
||||
return logger;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* Is debug logging currently enabled?
|
||||
*/
|
||||
public boolean isDebugEnabled() {
|
||||
return (getLogger().isLoggable(Level.FINE));
|
||||
return getLogger().isLoggable(Level.FINE);
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* Is error logging currently enabled?
|
||||
*/
|
||||
public boolean isErrorEnabled() {
|
||||
return (getLogger().isLoggable(Level.SEVERE));
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* Is fatal logging currently enabled?
|
||||
*/
|
||||
public boolean isFatalEnabled() {
|
||||
return (getLogger().isLoggable(Level.SEVERE));
|
||||
return getLogger().isLoggable(Level.SEVERE);
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* Is info logging currently enabled?
|
||||
*/
|
||||
public boolean isInfoEnabled() {
|
||||
return (getLogger().isLoggable(Level.INFO));
|
||||
return getLogger().isLoggable(Level.INFO);
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* Is trace logging currently enabled?
|
||||
*/
|
||||
public boolean isTraceEnabled() {
|
||||
return (getLogger().isLoggable(Level.FINEST));
|
||||
return getLogger().isLoggable(Level.FINEST);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ public class Jdk14Logger implements Log, Serializable {
|
||||
* Is warn logging currently enabled?
|
||||
*/
|
||||
public boolean isWarnEnabled() {
|
||||
return (getLogger().isLoggable(Level.WARNING));
|
||||
return getLogger().isLoggable(Level.WARNING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ public class Log4JLogger implements Log, Serializable {
|
||||
if (logger == null) {
|
||||
logger = Logger.getLogger(name);
|
||||
}
|
||||
return (this.logger);
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
*/
|
||||
public Object getAttribute(String name) {
|
||||
|
||||
return (attributes.get(name));
|
||||
return attributes.get(name);
|
||||
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
*/
|
||||
public Log getInstance(Class clazz) throws LogConfigurationException {
|
||||
|
||||
return (getInstance(clazz.getName()));
|
||||
return getInstance(clazz.getName());
|
||||
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
instance = newInstance(name);
|
||||
instances.put(name, instance);
|
||||
}
|
||||
return (instance);
|
||||
return instance;
|
||||
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
logMethod.invoke(instance, params);
|
||||
}
|
||||
|
||||
return (instance);
|
||||
return instance;
|
||||
|
||||
} catch (LogConfigurationException lce) {
|
||||
|
||||
@@ -891,7 +891,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
"No user-specified Log implementation; performing discovery" +
|
||||
" using the standard supported logging implementations...");
|
||||
}
|
||||
for(int i=0; (i<classesToDiscover.length) && (result == null); ++i) {
|
||||
for(int i=0; i<classesToDiscover.length && result == null; ++i) {
|
||||
result = createLogFromClass(classesToDiscover[i], logCategory, true);
|
||||
}
|
||||
|
||||
@@ -1168,7 +1168,7 @@ public class LogFactoryImpl extends LogFactory {
|
||||
currentCL = getParentClassLoader(currentCL);
|
||||
}
|
||||
|
||||
if ((logAdapter != null) && affectState) {
|
||||
if (logAdapter != null && affectState) {
|
||||
// We've succeeded, so set instance fields
|
||||
this.logClassName = logAdapterClassName;
|
||||
this.logConstructor = constructor;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class LogKitLogger implements Log, Serializable {
|
||||
if (logger == null) {
|
||||
logger = Hierarchy.getDefaultHierarchy().getLoggerFor(name);
|
||||
}
|
||||
return (logger);
|
||||
return logger;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -128,10 +128,10 @@ public class SimpleLog implements Log, Serializable {
|
||||
public static final int LOG_LEVEL_FATAL = 6;
|
||||
|
||||
/** Enable all logging levels */
|
||||
public static final int LOG_LEVEL_ALL = (LOG_LEVEL_TRACE - 1);
|
||||
public static final int LOG_LEVEL_ALL = LOG_LEVEL_TRACE - 1;
|
||||
|
||||
/** Enable no logging levels */
|
||||
public static final int LOG_LEVEL_OFF = (LOG_LEVEL_FATAL + 1);
|
||||
public static final int LOG_LEVEL_OFF = LOG_LEVEL_FATAL + 1;
|
||||
|
||||
// ------------------------------------------------------------ Initializer
|
||||
|
||||
@@ -142,17 +142,17 @@ public class SimpleLog implements Log, Serializable {
|
||||
} catch (SecurityException e) {
|
||||
// Ignore
|
||||
}
|
||||
return (prop == null) ? simpleLogProps.getProperty(name) : prop;
|
||||
return prop == null ? simpleLogProps.getProperty(name) : prop;
|
||||
}
|
||||
|
||||
private static String getStringProperty(String name, String dephault) {
|
||||
String prop = getStringProperty(name);
|
||||
return (prop == null) ? dephault : prop;
|
||||
return prop == null ? dephault : prop;
|
||||
}
|
||||
|
||||
private static boolean getBooleanProperty(String name, boolean dephault) {
|
||||
String prop = getStringProperty(name);
|
||||
return (prop == null) ? dephault : "true".equalsIgnoreCase(prop);
|
||||
return prop == null ? dephault : "true".equalsIgnoreCase(prop);
|
||||
}
|
||||
|
||||
// Initialize class attributes.
|
||||
@@ -364,7 +364,7 @@ public class SimpleLog implements Log, Serializable {
|
||||
protected boolean isLevelEnabled(int logLevel) {
|
||||
// log level are numerically ordered so can use simple numeric
|
||||
// comparison
|
||||
return (logLevel >= currentLogLevel);
|
||||
return logLevel >= currentLogLevel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
changeCount = 0;
|
||||
}
|
||||
// do a partial purge more often
|
||||
else if ((changeCount % PARTIAL_PURGE_COUNT) == 0) {
|
||||
else if (changeCount % PARTIAL_PURGE_COUNT == 0) {
|
||||
purgeOne();
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
changeCount = 0;
|
||||
}
|
||||
// do a partial purge more often
|
||||
else if ((changeCount % PARTIAL_PURGE_COUNT) == 0) {
|
||||
else if (changeCount % PARTIAL_PURGE_COUNT == 0) {
|
||||
purgeOne();
|
||||
}
|
||||
return super.remove(new Referenced(key));
|
||||
@@ -436,7 +436,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
Object thisKeyValue = getValue();
|
||||
Object otherKeyValue = otherKey.getValue();
|
||||
if (thisKeyValue == null) {
|
||||
result = (otherKeyValue == null);
|
||||
result = otherKeyValue == null;
|
||||
|
||||
// Since our hashcode was calculated from the original
|
||||
// non-null referant, the above check breaks the
|
||||
@@ -444,7 +444,7 @@ public final class WeakHashtable extends Hashtable {
|
||||
// objects could test equal but have different hashcodes.
|
||||
// We can reduce (not eliminate) the chance of this
|
||||
// happening by comparing hashcodes.
|
||||
result = result && (this.hashCode() == otherKey.hashCode());
|
||||
result = result && this.hashCode() == otherKey.hashCode();
|
||||
// In any case, as our c'tor does not allow null referants
|
||||
// and Hashtable does not do equality checks between
|
||||
// existing keys, normal hashtable operations should never
|
||||
|
||||
@@ -270,7 +270,7 @@ public class WeakHashtableTest extends TestCase {
|
||||
|
||||
public void run() {
|
||||
for (int i = 0; i < RUN_LOOPS; i++) {
|
||||
hashtable.put("key" + ":" + (i%10), Boolean.TRUE);
|
||||
hashtable.put("key" + ":" + i%10, Boolean.TRUE);
|
||||
if(i%50 == 0) {
|
||||
yield();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TestHandler extends Handler {
|
||||
|
||||
|
||||
public Iterator records() {
|
||||
return (records.iterator());
|
||||
return records.iterator();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -170,22 +170,22 @@ public abstract class StandardTests extends TestCase {
|
||||
ev = (LogEvent) logEvents.get(0);
|
||||
assertEquals("Info message expected", "info", ev.msg);
|
||||
assertEquals("Info level expected", "INFO", ev.level);
|
||||
assertEquals("Exception data incorrect", (ev.throwable!=null), thrown);
|
||||
assertEquals("Exception data incorrect", ev.throwable!=null, thrown);
|
||||
|
||||
ev = (LogEvent) logEvents.get(1);
|
||||
assertEquals("Warn message expected", "warn", ev.msg);
|
||||
assertEquals("Warn level expected", "WARN", ev.level);
|
||||
assertEquals("Exception data incorrect", (ev.throwable!=null), thrown);
|
||||
assertEquals("Exception data incorrect", ev.throwable!=null, thrown);
|
||||
|
||||
ev = (LogEvent) logEvents.get(2);
|
||||
assertEquals("Error message expected", "error", ev.msg);
|
||||
assertEquals("Error level expected", "ERROR", ev.level);
|
||||
assertEquals("Exception data incorrect", (ev.throwable!=null), thrown);
|
||||
assertEquals("Exception data incorrect", ev.throwable!=null, thrown);
|
||||
|
||||
ev = (LogEvent) logEvents.get(3);
|
||||
assertEquals("Fatal message expected", "fatal", ev.msg);
|
||||
assertEquals("Fatal level expected", "FATAL", ev.level);
|
||||
assertEquals("Exception data incorrect", (ev.throwable!=null), thrown);
|
||||
assertEquals("Exception data incorrect", ev.throwable!=null, thrown);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public class TestAppender extends AppenderSkeleton {
|
||||
|
||||
|
||||
public boolean requiresLayout() {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,27 +43,27 @@ public class DecoratedSimpleLog extends SimpleLog {
|
||||
// ------------------------------------------------------------- Properties
|
||||
|
||||
public DateFormat getDateTimeFormatter() {
|
||||
return (dateFormatter);
|
||||
return dateFormatter;
|
||||
}
|
||||
|
||||
|
||||
public String getDateTimeFormat() {
|
||||
return (dateTimeFormat);
|
||||
return dateTimeFormat;
|
||||
}
|
||||
|
||||
|
||||
public String getLogName() {
|
||||
return (logName);
|
||||
return logName;
|
||||
}
|
||||
|
||||
|
||||
public boolean getShowDateTime() {
|
||||
return (showDateTime);
|
||||
return showDateTime;
|
||||
}
|
||||
|
||||
|
||||
public boolean getShowShortName() {
|
||||
return (showShortName);
|
||||
return showShortName;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class DecoratedSimpleLog extends SimpleLog {
|
||||
|
||||
// Return cache
|
||||
public List getCache() {
|
||||
return (this.cache);
|
||||
return this.cache;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user