From: <otm...@us...> - 2009-06-11 11:56:09
|
Revision: 6474 http://jython.svn.sourceforge.net/jython/?rev=6474&view=rev Author: otmarhumbel Date: 2009-06-11 11:56:08 +0000 (Thu, 11 Jun 2009) Log Message: ----------- removal of unnecessary casts Modified Paths: -------------- trunk/jython/src/org/python/antlr/PythonTree.java trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java Modified: trunk/jython/src/org/python/antlr/PythonTree.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTree.java 2009-06-11 11:55:18 UTC (rev 6473) +++ trunk/jython/src/org/python/antlr/PythonTree.java 2009-06-11 11:56:08 UTC (rev 6474) @@ -296,7 +296,7 @@ if ( t==null ) { return; // do nothing upon addChild(null) } - PythonTree childTree = (PythonTree)t; + PythonTree childTree = t; if ( childTree.isNil() ) { // t is an empty node possibly with children if ( this.children!=null && this.children == childTree.children ) { throw new RuntimeException("attempt to add child list to itself"); @@ -444,7 +444,7 @@ public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { - PythonTree child = (PythonTree)getChild(c); + PythonTree child = getChild(c); child.setChildIndex(c); child.setParent(this); } Modified: trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java =================================================================== --- trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java 2009-06-11 11:55:18 UTC (rev 6473) +++ trunk/jython/src/org/python/antlr/PythonTreeAdaptor.java 2009-06-11 11:56:08 UTC (rev 6474) @@ -72,7 +72,7 @@ // handle ^(nil real-node) if ( newRootTree.isNil() ) { int nc = newRootTree.getChildCount(); - if ( nc==1 ) newRootTree = (PythonTree)newRootTree.getChild(0); + if ( nc==1 ) newRootTree = newRootTree.getChild(0); else if ( nc >1 ) { // TODO: make tree run time exceptions hierarchy throw new RuntimeException("more than one node as root (TODO: make exception hierarchy)"); @@ -93,7 +93,7 @@ r = null; } else if ( r.getChildCount()==1 ) { - r = (PythonTree)r.getChild(0); + r = r.getChild(0); // whoever invokes rule will set parent and child index r.setParent(null); r.setChildIndex(-1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |