aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--plugin/icedteanp/java/sun/applet/PluginObjectStore.java20
2 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 6953aed..c2ca840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java:
* netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java:
Fix javadoc warnings.
+ * plugin/icedteanp/java/sun/applet/PluginObjectStore.java (contains):
+ Fix a small bug that prevents the only user of this method
+ (PluginAppletSecurity line 1064) to work correctly.
2012-08-18 Jiri Vanek <[email protected]>
diff --git a/plugin/icedteanp/java/sun/applet/PluginObjectStore.java b/plugin/icedteanp/java/sun/applet/PluginObjectStore.java
index b06f7ad..87dec78 100644
--- a/plugin/icedteanp/java/sun/applet/PluginObjectStore.java
+++ b/plugin/icedteanp/java/sun/applet/PluginObjectStore.java
@@ -45,9 +45,9 @@ import java.util.Map;
enum PluginObjectStore {
INSTANCE;
- private HashMap<Integer, Object> objects = new HashMap<Integer, Object>();
- private HashMap<Integer, Integer> counts = new HashMap<Integer, Integer>();
- private HashMap<Object, Integer> identifiers = new HashMap<Object, Integer>();
+ private final Map<Integer, Object> objects = new HashMap<Integer, Object>();
+ private final Map<Integer, Integer> counts = new HashMap<Integer, Integer>();
+ private final Map<Object, Integer> identifiers = new HashMap<Object, Integer>();
private final Object lock = new Object();
private boolean wrapped = false;
@@ -64,20 +64,22 @@ enum PluginObjectStore {
}
public Integer getIdentifier(Object object) {
+ if (object == null)
+ return 0;
+
synchronized(lock) {
- if (object == null)
- return 0;
return identifiers.get(object);
}
}
public boolean contains(Object object) {
- synchronized(lock) {
- if (object == null)
+ if (object != null) {
+ synchronized(lock) {
return identifiers.containsKey(object);
-
- return false;
+ }
}
+ return false;
+
}
public boolean contains(int identifier) {