From: <pj...@us...> - 2009-05-12 02:22:27
|
Revision: 6344 http://jython.svn.sourceforge.net/jython/?rev=6344&view=rev Author: pjenvey Date: 2009-05-12 01:51:08 +0000 (Tue, 12 May 2009) Log Message: ----------- quiet some warnings and small cleanup Modified Paths: -------------- trunk/jython/src/org/python/modules/itertools.java trunk/jython/src/org/python/util/JLineConsole.java trunk/jython/tests/java/javatests/Dict2JavaTest.java Modified: trunk/jython/src/org/python/modules/itertools.java =================================================================== --- trunk/jython/src/org/python/modules/itertools.java 2009-05-12 01:35:11 UTC (rev 6343) +++ trunk/jython/src/org/python/modules/itertools.java 2009-05-12 01:51:08 UTC (rev 6344) @@ -1,3 +1,4 @@ +/* Copyright (c) Jython Developers */ package org.python.modules; import java.util.ArrayList; @@ -134,7 +135,7 @@ // start over again counter = 0; } - return (PyObject)saved.get(counter++); + return saved.get(counter++); } }; Modified: trunk/jython/src/org/python/util/JLineConsole.java =================================================================== --- trunk/jython/src/org/python/util/JLineConsole.java 2009-05-12 01:35:11 UTC (rev 6343) +++ trunk/jython/src/org/python/util/JLineConsole.java 2009-05-12 01:51:08 UTC (rev 6344) @@ -1,3 +1,4 @@ +/* Copyright (c) Jython Developers */ package org.python.util; import java.io.File; @@ -87,6 +88,7 @@ return getClass().getResourceAsStream("jline-keybindings.properties"); } + @Override public String raw_input(PyObject prompt) { String line = null; try { Modified: trunk/jython/tests/java/javatests/Dict2JavaTest.java =================================================================== --- trunk/jython/tests/java/javatests/Dict2JavaTest.java 2009-05-12 01:35:11 UTC (rev 6343) +++ trunk/jython/tests/java/javatests/Dict2JavaTest.java 2009-05-12 01:51:08 UTC (rev 6344) @@ -1,9 +1,10 @@ +/* Copyright (c) Jython Developers */ package javatests; + import java.util.Map; import java.util.Set; import java.util.Collection; import java.util.HashMap; -import java.util.Iterator; /** * This class is used by the test_dict2java.py test script for testing @@ -13,21 +14,21 @@ */ public class Dict2JavaTest { - private Map map = null; + private Map<Object, Object> map; - public Dict2JavaTest(Map map) { + public Dict2JavaTest(Map<Object, Object> map) { this.map = map; } - - public Set entrySet() { + + public Set<Map.Entry<Object, Object>> entrySet() { return map.entrySet(); } - public Set keySet() { + public Set<Object> keySet() { return map.keySet(); } - public Collection values() { + public Collection<Object> values() { return map.values(); } @@ -41,7 +42,7 @@ } public boolean test_putAll_efg() { - HashMap hmap = new HashMap(); + HashMap<String, String> hmap = new HashMap<String, String>(); hmap.put("e", "1"); hmap.put("f", null); hmap.put("g", "2"); @@ -70,21 +71,21 @@ public boolean test_java_mapentry() { // created outside of Jython with non PyOjects - HashMap hmap = new HashMap(); + HashMap<String, Object> hmap = new HashMap<String, Object>(); hmap.put("b", "y"); - Map.Entry entry = (Map.Entry)hmap.entrySet().iterator().next(); + Map.Entry<String, Object> entry = hmap.entrySet().iterator().next(); if (!map.entrySet().contains(entry)) return false; // Test a number - hmap = new HashMap(); + hmap = new HashMap<String, Object>(); hmap.put("i", new Integer(3)); - entry = (Map.Entry)hmap.entrySet().iterator().next(); + entry = hmap.entrySet().iterator().next(); if (!map.entrySet().contains(entry)) return false; // test Null - hmap = new HashMap(); + hmap = new HashMap<String, Object>(); hmap.put("f", null); - entry = (Map.Entry)hmap.entrySet().iterator().next(); + entry = hmap.entrySet().iterator().next(); if (!map.entrySet().contains(entry)) return false; return true; } @@ -92,7 +93,7 @@ // make sure nulls are handled and other object types, nulls // should never match anything in the entry set. public boolean test_entry_set_nulls() { - Set set = map.entrySet(); + Set<Map.Entry<Object, Object>> set = map.entrySet(); return set.contains(null) == false && set.remove(null) == false && set.contains(new Boolean(true)) == false && set.remove(new String("")) == false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |