From: <pj...@us...> - 2009-05-07 00:48:19
|
Revision: 6306 http://jython.svn.sourceforge.net/jython/?rev=6306&view=rev Author: pjenvey Date: 2009-05-07 00:48:18 +0000 (Thu, 07 May 2009) Log Message: ----------- java.lang.String has cached its hashCode forever Modified Paths: -------------- trunk/jython/src/org/python/core/PyString.java Modified: trunk/jython/src/org/python/core/PyString.java =================================================================== --- trunk/jython/src/org/python/core/PyString.java 2009-05-06 20:07:47 UTC (rev 6305) +++ trunk/jython/src/org/python/core/PyString.java 2009-05-07 00:48:18 UTC (rev 6306) @@ -18,7 +18,6 @@ { public static final PyType TYPE = PyType.fromClass(PyString.class); protected String string; - private transient int cached_hashcode=0; protected transient boolean interned=false; // for PyJavaClass.init() @@ -579,9 +578,7 @@ @ExposedMethod(doc = BuiltinDocs.str___hash___doc) final int str___hash__() { - if (cached_hashcode == 0) - cached_hashcode = string.hashCode(); - return cached_hashcode; + return string.hashCode(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |