From: <cg...@us...> - 2009-01-11 06:24:51
|
Revision: 5917 http://jython.svn.sourceforge.net/jython/?rev=5917&view=rev Author: cgroves Date: 2009-01-11 06:24:45 +0000 (Sun, 11 Jan 2009) Log Message: ----------- Huh, I guess ECJ can handle inferring these generics, but javac sure can't. Modified Paths: -------------- trunk/jython/src/org/python/core/PyJavaType.java trunk/jython/src/org/python/core/PyType.java trunk/jython/tests/java/javatests/ListTest.java Modified: trunk/jython/src/org/python/core/PyJavaType.java =================================================================== --- trunk/jython/src/org/python/core/PyJavaType.java 2009-01-11 06:04:11 UTC (rev 5916) +++ trunk/jython/src/org/python/core/PyJavaType.java 2009-01-11 06:24:45 UTC (rev 5917) @@ -87,7 +87,8 @@ bases[i] = PyType.fromClass(underlying_class.getInterfaces()[i - 1]); } Set<PyObject> seen = Generic.set(); - List<PyObject> mros = Generic.list(this); + List<PyObject> mros = Generic.list(); + mros.add(this); for (PyObject obj : bases) { for (PyObject mroObj : ((PyType)obj).mro) { if (seen.add(mroObj)) { Modified: trunk/jython/src/org/python/core/PyType.java =================================================================== --- trunk/jython/src/org/python/core/PyType.java 2009-01-11 06:04:11 UTC (rev 5916) +++ trunk/jython/src/org/python/core/PyType.java 2009-01-11 06:24:45 UTC (rev 5917) @@ -722,7 +722,8 @@ to_merge[n] = bases; remain[n] = 0; - List<PyObject> acc = Generic.list(this); + List<PyObject> acc = Generic.list(); + acc.add(this); int empty_cnt = 0; Modified: trunk/jython/tests/java/javatests/ListTest.java =================================================================== --- trunk/jython/tests/java/javatests/ListTest.java 2009-01-11 06:04:11 UTC (rev 5916) +++ trunk/jython/tests/java/javatests/ListTest.java 2009-01-11 06:24:45 UTC (rev 5917) @@ -472,7 +472,8 @@ int prevIndex = li.previousIndex(); TestSupport.assertThat(prevIndex == -1, "ListIterator.previousIndex() on empty List did not return -1"); - List<Object> l = Generic.list(1); + List<Object> l = Generic.list(); + l.add(1); li = newInstance(l).listIterator(); TestSupport.assertThat(!li.hasPrevious(), "ListIterator.hasPrevious() is true with nothing previous"); @@ -493,7 +494,7 @@ TestSupport.fail("expected IllegalStateException"); } catch (IllegalStateException e) {} } - l = Generic.list(0, 1, 2); + l = Generic.list(new Object[]{0, 1, 2}); li = newInstance(l).listIterator(); for (int i = 0, n = l.size(); i < n; i++) { TestSupport.assertThat(li.next().equals(i), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |