Revision: 3672
          http://vexi.svn.sourceforge.net/vexi/?rev=3672&view=rev
Author:   clrg
Date:     2009-09-13 16:18:04 +0000 (Sun, 13 Sep 2009)

Log Message:
-----------
Partially revert r3670 on advice from mike (put(s,null)->remove is left in)

Modified Paths:
--------------
    trunk/core/org.ibex.js/src/org/ibex/js/JSString.java

Modified: trunk/core/org.ibex.js/src/org/ibex/js/JSString.java
===================================================================
--- trunk/core/org.ibex.js/src/org/ibex/js/JSString.java        2009-09-11 
18:15:57 UTC (rev 3671)
+++ trunk/core/org.ibex.js/src/org/ibex/js/JSString.java        2009-09-13 
16:18:04 UTC (rev 3672)
@@ -4,7 +4,7 @@
 
 package org.ibex.js;
 
-import java.lang.ref.SoftReference;
+//import java.lang.ref.SoftReference;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -38,11 +38,14 @@
     private final static Map internHash = new HashMap();
     static synchronized JS intern(String s) {
         synchronized (internHash) {
-            SoftReference ref = (SoftReference)internHash.get(s);
-            JS js = ref==null ? null : (JS)(ref.get());
+            // FIXME: a memory leak ? or not...
+            //SoftReference ref = (SoftReference)internHash.get(s);
+            //JS js = ref==null ? null : (JS)ref.get();
+            JS js = (JS)internHash.get(s);
             if (js == null) {
                 //System.out.println("caching: "+s);
-                internHash.put(s, new SoftReference(js = new Intern(s)));
+                //internHash.put(s, new SoftReference(js = new Intern(s)));
+                internHash.put(s, js = new Intern(s));
             }
             return js;
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to