From: <zy...@us...> - 2010-04-26 18:24:50
|
Revision: 7049 http://jython.svn.sourceforge.net/jython/?rev=7049&view=rev Author: zyasoft Date: 2010-04-26 18:24:42 +0000 (Mon, 26 Apr 2010) Log Message: ----------- Actual fix for missing synchronized on PyObject#getJavaProxy (missed checkin) Modified Paths: -------------- trunk/jython/src/org/python/core/PyObject.java Modified: trunk/jython/src/org/python/core/PyObject.java =================================================================== --- trunk/jython/src/org/python/core/PyObject.java 2010-04-26 18:16:08 UTC (rev 7048) +++ trunk/jython/src/org/python/core/PyObject.java 2010-04-26 18:24:42 UTC (rev 7049) @@ -174,6 +174,7 @@ return new PyString(toString()); } + @Override public String toString() { return object_toString(); } @@ -220,6 +221,7 @@ return new PyInteger(hashCode()); } + @Override public int hashCode() { return object___hash__(); } @@ -234,6 +236,7 @@ * If overridden, it is the subclasses responsibility to ensure that * <code>a.equals(b) == true</code> iff <code>cmp(a,b) == 0</code> **/ + @Override public boolean equals(Object ob_other) { if(ob_other == this) { return true; @@ -291,7 +294,7 @@ return Py.NoConversion; } - protected Object getJavaProxy() { + protected synchronized Object getJavaProxy() { if (javaProxy == null) { proxyInit(); } @@ -1890,7 +1893,7 @@ // situations // XXX: This method isn't expensive but could (and maybe // should?) be optimized for worst case scenarios - return op == "+" && (t1 == PyString.TYPE || t1 == PyUnicode.TYPE) && + return (op == "+") && (t1 == PyString.TYPE || t1 == PyUnicode.TYPE) && (t2.isSubType(PyString.TYPE) || t2.isSubType(PyUnicode.TYPE)); } @@ -4116,6 +4119,7 @@ list = elements; } + @Override public int hashCode() { int x, y; int len = list.length; @@ -4129,6 +4133,7 @@ return x; } + @Override public boolean equals(Object o) { if (!(o instanceof PyIdentityTuple)) return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |