From a5d0685903f6cad0b7d33599c04a2a75b548ced3 Mon Sep 17 00:00:00 2001 From: Arun Patidar Date: Tue, 2 Aug 2016 14:31:39 +0000 Subject: [PATCH] Applied patch from jira issue - OFBIZ-7806 - Enforce noninstantiability to UtilProperties class. Thanks Aman Mishra and Rishi Solanki for your contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1754938 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/ofbiz/base/util/UtilProperties.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java index 54c4ea6f2c..38aa0ca9ca 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java @@ -63,10 +63,12 @@ import org.w3c.dom.Element; * method).

*/ @SuppressWarnings("serial") -public class UtilProperties implements Serializable { +public final class UtilProperties implements Serializable { public static final String module = UtilProperties.class.getName(); + private UtilProperties() {} + /** * A cache for storing Properties instances. Each Properties instance is keyed by its URL. */ @@ -666,7 +668,7 @@ public class UtilProperties implements Serializable { return getMessage(resource, name, UtilGenerics.toMap(String.class, context), locale); } - protected static Set resourceNotFoundMessagesShown = new HashSet(); + private static Set resourceNotFoundMessagesShown = new HashSet(); /** Returns the specified resource/properties file as a ResourceBundle * @param resource The name of the resource - can be a file, class, or URL * @param locale The locale that the given resource will correspond to