From: <fwi...@us...> - 2009-07-30 12:09:22
|
Revision: 6604 http://jython.svn.sourceforge.net/jython/?rev=6604&view=rev Author: fwierzbicki Date: 2009-07-30 12:09:14 +0000 (Thu, 30 Jul 2009) Log Message: ----------- More compiler warning fixes. Modified Paths: -------------- trunk/jython/src/org/python/antlr/PythonTree.java trunk/jython/src/org/python/compiler/Module.java trunk/jython/src/org/python/compiler/ScopesCompiler.java trunk/jython/src/org/python/core/PyList.java Modified: trunk/jython/src/org/python/antlr/PythonTree.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTree.java 2009-07-30 04:40:15 UTC (rev 6603) +++ trunk/jython/src/org/python/antlr/PythonTree.java 2009-07-30 12:09:14 UTC (rev 6604) @@ -202,7 +202,7 @@ buf.append(' '); } for (int i = 0; children != null && i < children.size(); i++) { - PythonTree t = (PythonTree)children.get(i); + PythonTree t = children.get(i); if (i > 0) { buf.append(' '); } @@ -269,7 +269,7 @@ public PythonTree getFirstChildWithType(int type) { for (int i = 0; children!=null && i < children.size(); i++) { - PythonTree t = (PythonTree) children.get(i); + PythonTree t = children.get(i); if ( t.getAntlrType()==type ) { return t; } @@ -306,7 +306,7 @@ if ( this.children!=null ) { // must copy, this has children already int n = childTree.children.size(); for (int i = 0; i < n; i++) { - PythonTree c = (PythonTree)childTree.children.get(i); + PythonTree c = childTree.children.get(i); this.children.add(c); // handle double-link stuff for each child of nil root c.setParent(this); @@ -335,7 +335,7 @@ /** Add all elements of kids list as children of this node */ public void addChildren(List<PythonTree> kids) { for (int i = 0; i < kids.size(); i++) { - PythonTree t = (PythonTree) kids.get(i); + PythonTree t = kids.get(i); addChild(t); } } @@ -359,7 +359,7 @@ if ( children==null ) { return null; } - PythonTree killed = (PythonTree)children.remove(i); + PythonTree killed = children.remove(i); // walk rest and decrement their child indexes this.freshenParentAndChildIndexes(i); return killed; @@ -398,7 +398,7 @@ if ( delta == 0 ) { int j = 0; // index into new children for (int i=startChildIndex; i<=stopChildIndex; i++) { - PythonTree child = (PythonTree)newChildren.get(j); + PythonTree child = newChildren.get(j); children.set(i, child); child.setParent(this); child.setChildIndex(i); @@ -413,7 +413,7 @@ int indexToDelete = startChildIndex+numNewChildren; for (int c=indexToDelete; c<=stopChildIndex; c++) { // delete same index, shifting everybody down each time - PythonTree killed = (PythonTree)children.remove(indexToDelete); + PythonTree killed = children.remove(indexToDelete); } freshenParentAndChildIndexes(startChildIndex); } Modified: trunk/jython/src/org/python/compiler/Module.java =================================================================== --- trunk/jython/src/org/python/compiler/Module.java 2009-07-30 04:40:15 UTC (rev 6603) +++ trunk/jython/src/org/python/compiler/Module.java 2009-07-30 12:09:14 UTC (rev 6604) @@ -332,7 +332,7 @@ Hashtable<Constant,Constant> constants; private Constant findConstant(Constant c) { - Constant ret = (Constant)constants.get(c); + Constant ret = constants.get(c); if (ret != null) return ret; ret = c; @@ -620,7 +620,7 @@ public String getFilename() { return sfilename; } public ScopeInfo getScopeInfo(PythonTree node) { - return (ScopeInfo) scopes.get(node); + return scopes.get(node); } public void error(String msg,boolean err,PythonTree node) Modified: trunk/jython/src/org/python/compiler/ScopesCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/ScopesCompiler.java 2009-07-30 04:40:15 UTC (rev 6603) +++ trunk/jython/src/org/python/compiler/ScopesCompiler.java 2009-07-30 12:09:14 UTC (rev 6604) @@ -66,7 +66,7 @@ level--; ScopeInfo up = null; if (!scopes.empty()) { - up = (ScopeInfo) scopes.pop(); + up = scopes.pop(); } //Go into the stack to find a non class containing scope to use making the closure //See PEP 227 @@ -74,7 +74,7 @@ ScopeInfo referenceable = up; for (int i = scopes.size() - 1; i >= 0 && referenceable.kind == CLASSSCOPE; i--, dist++) { - referenceable = ((ScopeInfo) scopes.get(i)); + referenceable = (scopes.get(i)); } cur.cook(referenceable, dist, code_compiler); cur.dump(); // debug Modified: trunk/jython/src/org/python/core/PyList.java =================================================================== --- trunk/jython/src/org/python/core/PyList.java 2009-07-30 04:40:15 UTC (rev 6603) +++ trunk/jython/src/org/python/core/PyList.java 2009-07-30 12:09:14 UTC (rev 6604) @@ -287,7 +287,7 @@ if (list instanceof ArrayList) { ((ArrayList) list).ensureCapacity(newSize); } - List oldList = new ArrayList<PyObject>(list); + List<PyObject> oldList = new ArrayList<PyObject>(list); for (int i = 1; i < count; i++) { list.addAll(oldList); } @@ -1152,7 +1152,7 @@ stop = start; } int n = sliceLength(start, stop, step); - List newList; + List<PyObject> newList; if (step == 1) { newList = new ArrayList<PyObject>(list.subList(start, stop)); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |