Added syncrhonization to methods who's overridden parent methods have synchronization as well. (cherry picking from commit 36d2021fe7178d6686b5843c6f57bbf41bfd30c2)
This commit is contained in:
parent
468a89bd05
commit
5abe737912
2 changed files with 13 additions and 13 deletions
|
@ -483,7 +483,7 @@ public class ResourceProperties extends Properties {
|
|||
* @param value value
|
||||
* @return the old value, if an old value got replaced
|
||||
*/
|
||||
public Object put(Object key, Object value) {
|
||||
public synchronized Object put(Object key, Object value) {
|
||||
if (value instanceof String) {
|
||||
value = ((String) value).trim();
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ public class ResourceProperties extends Properties {
|
|||
* @param key key
|
||||
* @return the old value
|
||||
*/
|
||||
public Object remove(Object key) {
|
||||
public synchronized Object remove(Object key) {
|
||||
String strkey = key.toString();
|
||||
if (ignoreCase) {
|
||||
strkey = (String) keyMap.remove(strkey.toLowerCase());
|
||||
|
|
|
@ -199,7 +199,7 @@ public final class SystemProperties extends Properties {
|
|||
* This should not be used directly if properties are read from file,
|
||||
* otherwise changes will be lost whe the file is next modified.
|
||||
*/
|
||||
public Object put(Object key, Object value) {
|
||||
public synchronized Object put(Object key, Object value) {
|
||||
// cut off trailing whitespace
|
||||
if (value != null) {
|
||||
value = value.toString().trim();
|
||||
|
@ -211,7 +211,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public Object get(Object key) {
|
||||
public synchronized Object get(Object key) {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -222,14 +222,14 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public Object remove(Object key) {
|
||||
public synchronized Object remove(Object key) {
|
||||
return super.remove(ignoreCase ? key.toString().toLowerCase() : key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public boolean contains(Object obj) {
|
||||
public synchronized boolean contains(Object obj) {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public boolean containsKey(Object key) {
|
||||
public synchronized boolean containsKey(Object key) {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
public synchronized boolean isEmpty() {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public Enumeration keys() {
|
||||
public synchronized Enumeration keys() {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public Enumeration elements() {
|
||||
public synchronized Enumeration elements() {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public int size() {
|
||||
public synchronized int size() {
|
||||
if ((System.currentTimeMillis() - lastcheck) > cacheTime) {
|
||||
checkFile();
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ public final class SystemProperties extends Properties {
|
|||
/**
|
||||
* Overrides method to act on the wrapped properties object.
|
||||
*/
|
||||
public String toString() {
|
||||
public synchronized String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue