From: <zy...@us...> - 2009-05-11 03:49:09
|
Revision: 6336 http://jython.svn.sourceforge.net/jython/?rev=6336&view=rev Author: zyasoft Date: 2009-05-11 03:48:59 +0000 (Mon, 11 May 2009) Log Message: ----------- More findbugs fixes: removed inconsistent synchronization for cPickle.PickleMemo (should be thread confined anyway). Modified Paths: -------------- trunk/jython/src/org/python/modules/_marshal.java trunk/jython/src/org/python/modules/cPickle.java Modified: trunk/jython/src/org/python/modules/_marshal.java =================================================================== --- trunk/jython/src/org/python/modules/_marshal.java 2009-05-11 02:39:06 UTC (rev 6335) +++ trunk/jython/src/org/python/modules/_marshal.java 2009-05-11 03:48:59 UTC (rev 6336) @@ -416,8 +416,7 @@ int size = read_int(); String s = read_string(size); if (type == TYPE_INTERNED) { - s.intern(); // do we really honor like this? - PyString pys = PyString.fromInterned(s); + PyString pys = PyString.fromInterned(s.intern()); strings.append(pys); return pys; } else { Modified: trunk/jython/src/org/python/modules/cPickle.java =================================================================== --- trunk/jython/src/org/python/modules/cPickle.java 2009-05-11 02:39:06 UTC (rev 6335) +++ trunk/jython/src/org/python/modules/cPickle.java 2009-05-11 03:48:59 UTC (rev 6336) @@ -1426,7 +1426,7 @@ /* * A very specialized and simplified version of PyStringMap. It can * only use integers as keys and stores both an integer and an object - * as value. It is very private! + * as value. It is very private! And should only be used thread-confined. */ static private class PickleMemo { //Table of primes to cycle through @@ -1456,7 +1456,7 @@ this(4); } - public synchronized int size() { + public int size() { return size; } @@ -1521,7 +1521,7 @@ } - private synchronized final void resize(int capacity) { + private final void resize(int capacity) { int p = prime; for(; p<primes.length; p++) { if (primes[p] >= capacity) break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |