Skip to content

Commit

Permalink
Revert "LPS-162237 Log exception instead of swallowing"
Browse files Browse the repository at this point in the history
This reverts commit bed57fc.
  • Loading branch information
shuyangzhou authored and brianchandotcom committed Sep 14, 2022
1 parent 5978afc commit 7fe3fcc
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 157 deletions.
Expand Up @@ -14,9 +14,6 @@

package com.liferay.portal.kernel.concurrent;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -582,9 +579,6 @@ else if ((_poolSize > _corePoolSize) ||
}
}
catch (InterruptedException interruptedException) {
if (_log.isDebugEnabled()) {
_log.debug(interruptedException);
}
}
}
}
Expand Down Expand Up @@ -621,9 +615,6 @@ private void _tryTerminate() {

private static final int _TERMINATED = 3;

private static final Log _log = LogFactoryUtil.getLog(
ThreadPoolExecutor.class);

private volatile boolean _allowCoreThreadTimeout;
private long _completedTaskCount;
private volatile int _corePoolSize;
Expand Down
Expand Up @@ -18,8 +18,6 @@
import com.liferay.petra.concurrent.NoticeableFuture;
import com.liferay.petra.executor.PortalExecutorManager;
import com.liferay.petra.function.UnsafeConsumer;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
Expand Down Expand Up @@ -86,9 +84,6 @@ public static PreparedStatement concurrentAutoBatch(
PreparedStatement.class
};

private static final Log _log = LogFactoryUtil.getLog(
AutoBatchPreparedStatementUtil.class);

private static final Method _addBatchMethod;
private static final Method _closeMethod;
private static final Method _executeBatchMethod;
Expand Down Expand Up @@ -257,9 +252,6 @@ protected void executeAsync(
_futures.remove(future);
}
catch (Throwable throwable) {
if (_log.isDebugEnabled()) {
_log.debug(throwable);
}
}
});

Expand Down
Expand Up @@ -14,8 +14,6 @@

package com.liferay.portal.kernel.deploy.hot;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.messaging.MessageListener;
import com.liferay.portal.kernel.util.ProxyFactory;

Expand Down Expand Up @@ -67,9 +65,6 @@ protected String getClpServletContextName(
return clpServletContextName.toString();
}
catch (Exception exception2) {
if (_log.isDebugEnabled()) {
_log.debug(exception2);
}
}

throw exception1;
Expand All @@ -93,7 +88,4 @@ protected Object newInstance(
portletClassLoader, interfaceClasses, implClassName);
}

private static final Log _log = LogFactoryUtil.getLog(
BaseHotDeployListener.class);

}
Expand Up @@ -14,9 +14,6 @@

package com.liferay.portal.kernel.internal.util;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.lang.reflect.Method;

import java.net.URL;
Expand Down Expand Up @@ -76,15 +73,8 @@ private static <T> T _visitResources(
bundle, path, filePattern, true));
}
catch (ReflectiveOperationException reflectiveOperationException) {
if (_log.isDebugEnabled()) {
_log.debug(reflectiveOperationException);
}

return null;
}
}

private static final Log _log = LogFactoryUtil.getLog(
ContextResourcePathsUtil.class);

}
Expand Up @@ -14,9 +14,6 @@

package com.liferay.portal.kernel.servlet;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.io.IOException;
import java.io.InputStream;

Expand Down Expand Up @@ -52,10 +49,6 @@ public boolean isFinished() {
return false;
}
catch (IOException ioException) {
if (_log.isDebugEnabled()) {
_log.debug(ioException);
}

return true;
}
}
Expand All @@ -70,10 +63,6 @@ public boolean isReady() {
return false;
}
catch (IOException ioException) {
if (_log.isDebugEnabled()) {
_log.debug(ioException);
}

return false;
}
}
Expand Down Expand Up @@ -120,7 +109,4 @@ public long skip(long skip) throws IOException {

protected InputStream inputStream;

private static final Log _log = LogFactoryUtil.getLog(
ServletInputStreamAdapter.class);

}
Expand Up @@ -16,8 +16,6 @@

import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.configuration.Filter;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
Expand Down Expand Up @@ -94,19 +92,12 @@ public String getTemplatesHelpContent(String language) {
clazz.getClassLoader(), getTemplatesHelpPath(language));
}
catch (IOException ioException1) {
if (_log.isDebugEnabled()) {
_log.debug(ioException1);
}

try {
content = StringUtil.read(
PortalClassLoaderUtil.getClassLoader(),
getTemplatesHelpPath(language));
}
catch (IOException ioException2) {
if (_log.isDebugEnabled()) {
_log.debug(ioException2);
}
}
}

Expand All @@ -128,7 +119,4 @@ protected String getTemplatesConfigPath() {
return null;
}

private static final Log _log = LogFactoryUtil.getLog(
BaseTemplateHandler.class);

}
Expand Up @@ -14,9 +14,6 @@

package com.liferay.portal.kernel.util;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
Expand Down Expand Up @@ -82,9 +79,6 @@ protected Object handleGetObject(String key) {
return resourceBundle.getObject(key);
}
catch (MissingResourceException missingResourceException) {
if (_log.isDebugEnabled()) {
_log.debug(missingResourceException);
}
}
}

Expand All @@ -106,9 +100,6 @@ protected Set<String> handleKeySet() {
return _keys;
}

private static final Log _log = LogFactoryUtil.getLog(
AggregateResourceBundle.class);

private volatile Set<String> _keys;
private final ResourceBundle[] _resourceBundles;

Expand Down
20 changes: 0 additions & 20 deletions portal-kernel/src/com/liferay/portal/kernel/util/GetterUtil.java
Expand Up @@ -16,8 +16,6 @@

import com.liferay.petra.string.CharPool;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.math.BigDecimal;

Expand Down Expand Up @@ -310,10 +308,6 @@ public static Number get(Object value, Number defaultValue) {
return new BigDecimal(valueString.trim());
}
catch (NumberFormatException numberFormatException) {
if (_log.isDebugEnabled()) {
_log.debug(numberFormatException);
}

return defaultValue;
}
}
Expand Down Expand Up @@ -492,9 +486,6 @@ public static Date get(
}
}
catch (Exception exception) {
if (_log.isDebugEnabled()) {
_log.debug(exception);
}
}

return defaultValue;
Expand Down Expand Up @@ -533,9 +524,6 @@ public static double get(String value, double defaultValue, Locale locale) {
return Double.parseDouble(value);
}
catch (Exception exception) {
if (_log.isDebugEnabled()) {
_log.debug(exception);
}
}
}
else {
Expand All @@ -551,9 +539,6 @@ public static double get(String value, double defaultValue, Locale locale) {
}
}
catch (Exception exception) {
if (_log.isDebugEnabled()) {
_log.debug(exception);
}
}
}

Expand All @@ -577,9 +562,6 @@ public static float get(String value, float defaultValue) {
return Float.parseFloat(value.trim());
}
catch (Exception exception) {
if (_log.isDebugEnabled()) {
_log.debug(exception);
}
}

return defaultValue;
Expand Down Expand Up @@ -2132,6 +2114,4 @@ private static short _parseShort(String value, short defaultValue) {
return (short)i;
}

private static final Log _log = LogFactoryUtil.getLog(GetterUtil.class);

}
Expand Up @@ -16,8 +16,6 @@

import com.liferay.petra.string.CharPool;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -107,9 +105,6 @@ private Class<?> _getGenericType(
return Class.forName(className, true, contextClassLoader);
}
catch (ClassNotFoundException classNotFoundException) {
if (_log.isDebugEnabled()) {
_log.debug(classNotFoundException);
}
}
}

Expand Down Expand Up @@ -227,9 +222,6 @@ private boolean _isPrimitive(char c) {
return false;
}

private static final Log _log = LogFactoryUtil.getLog(
MethodParameter.class);

private final Class<?>[] _genericTypes;
private final String _name;
private final Class<?> _type;
Expand Down
Expand Up @@ -19,8 +19,6 @@
import com.liferay.petra.lang.HashUtil;
import com.liferay.petra.memory.FinalizeManager;
import com.liferay.petra.reflect.ReflectionUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
Expand Down Expand Up @@ -180,8 +178,6 @@ public static Object newProxyInstance(
InvocationHandler.class
};

private static final Log _log = LogFactoryUtil.getLog(ProxyUtil.class);

private static final ConcurrentMap
<ClassLoader, ConcurrentMap<LookupKey, Class<?>>> _classReferences =
new ConcurrentReferenceKeyHashMap<>(
Expand Down Expand Up @@ -279,9 +275,6 @@ private DelegateInvocationHandler(
delegateMethods.put(interfaceMethod, delegateMethod);
}
catch (NoSuchMethodException noSuchMethodException) {
if (_log.isDebugEnabled()) {
_log.debug(noSuchMethodException);
}
}
}
else {
Expand Down
12 changes: 0 additions & 12 deletions portal-kernel/src/com/liferay/portal/kernel/util/SocketUtil.java
Expand Up @@ -14,9 +14,6 @@

package com.liferay.portal.kernel.util;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import java.io.IOException;

import java.net.InetAddress;
Expand Down Expand Up @@ -56,10 +53,6 @@ public static ServerSocketChannel createServerSocketChannel(
return serverSocketChannel;
}
catch (IOException ioException) {
if (_log.isDebugEnabled()) {
_log.debug(ioException);
}

port++;
}
}
Expand Down Expand Up @@ -91,9 +84,6 @@ public static BindInfo getBindInfo(String host, int port)
socket.close();
}
catch (IOException ioException) {
if (_log.isDebugEnabled()) {
_log.debug(ioException);
}
}
}
}
Expand Down Expand Up @@ -128,6 +118,4 @@ public interface ServerSocketConfigurator {

}

private static final Log _log = LogFactoryUtil.getLog(SocketUtil.class);

}

0 comments on commit 7fe3fcc

Please sign in to comment.