felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1574745 - /felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
Date Thu, 06 Mar 2014 02:12:10 GMT
Author: gnodet
Date: Thu Mar  6 02:12:10 2014
New Revision: 1574745

URL: http://svn.apache.org/r1574745
Log:
[FELIX-4363] Fix NPE when setting a variable to null

Modified:
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java?rev=1574745&r1=1574744&r2=1574745&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
(original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandSessionImpl.java
Thu Mar  6 02:12:10 2014
@@ -53,7 +53,7 @@ public class CommandSessionImpl implemen
     PrintStream err;
     
     private final CommandProcessorImpl processor;
-    protected final Map<String, Object> variables = new ConcurrentHashMap<String,
Object>();
+    protected final Map<String, Object> variables = new HashMap<String, Object>();
     private boolean closed;
 
     protected CommandSessionImpl(CommandProcessorImpl shell, InputStream in, PrintStream
out, PrintStream err)
@@ -153,7 +153,10 @@ public class CommandSessionImpl implemen
 
     public void put(String name, Object value)
     {
-        variables.put(name, value);
+        synchronized (variables)
+        {
+            variables.put(name, value);
+        }
     }
 
     public PrintStream getConsole()



Mime
View raw message