Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341) In many Java and Groovy files we have auto generated catch blocks or empty catch blocks. To avoid such exception swallowing this should be improved to at least log the error and also return error in case of service. Here we use 3 try-with-ressource blocks and log some errors git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866957 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -19,11 +19,10 @@
|
||||
package org.apache.ofbiz.webtools;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@@ -1027,7 +1027,9 @@ public class WebToolsServices {
|
||||
if (bundle != null) {
|
||||
try {
|
||||
entityDescription = bundle.getString("EntityDescription." + entity.getEntityName());
|
||||
} catch (Exception exception) {}
|
||||
} catch (Exception exception) {
|
||||
Debug.logError(exception, module);
|
||||
}
|
||||
}
|
||||
if (UtilValidate.isEmpty(entityDescription)) {
|
||||
entityDescription = entity.getDescription();
|
||||
@@ -1046,7 +1048,9 @@ public class WebToolsServices {
|
||||
if (bundle != null) {
|
||||
try {
|
||||
fieldDescription = bundle.getString("FieldDescription." + entity.getEntityName() + "." + field.getName());
|
||||
} catch (Exception exception) {}
|
||||
} catch (Exception exception) {
|
||||
Debug.logError(exception, module);
|
||||
}
|
||||
}
|
||||
if (UtilValidate.isEmpty(fieldDescription)) {
|
||||
fieldDescription = field.getDescription();
|
||||
@@ -1054,7 +1058,9 @@ public class WebToolsServices {
|
||||
if (UtilValidate.isEmpty(fieldDescription) && bundle != null) {
|
||||
try {
|
||||
fieldDescription = bundle.getString("FieldDescription." + field.getName());
|
||||
} catch (Exception exception) {}
|
||||
} catch (Exception exception) {
|
||||
Debug.logError(exception, module);
|
||||
}
|
||||
}
|
||||
if (UtilValidate.isEmpty(fieldDescription)) {
|
||||
fieldDescription = ModelUtil.javaNameToDbName(field.getName()).toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user