From: <fwi...@us...> - 2009-07-30 03:38:50
|
Revision: 6601 http://jython.svn.sourceforge.net/jython/?rev=6601&view=rev Author: fwierzbicki Date: 2009-07-30 03:38:40 +0000 (Thu, 30 Jul 2009) Log Message: ----------- Fix compiler warnings. Note that I am not replacing Vectors with Lists, etc (as much as I'd like to) since this is a minor release and most of these are public fields (yuck). Modified Paths: -------------- trunk/jython/src/org/python/compiler/CodeCompiler.java trunk/jython/src/org/python/compiler/ScopeInfo.java Modified: trunk/jython/src/org/python/compiler/CodeCompiler.java =================================================================== --- trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-07-30 03:12:37 UTC (rev 6600) +++ trunk/jython/src/org/python/compiler/CodeCompiler.java 2009-07-30 03:38:40 UTC (rev 6601) @@ -120,12 +120,12 @@ public ScopeInfo my_scope; boolean optimizeGlobals = true; - public Vector names; + public Vector<String> names; public String className; - public Stack continueLabels, breakLabels; - public Stack exceptionHandlers; - public Vector yields = new Vector(); + public Stack<Label> continueLabels, breakLabels; + public Stack<ExceptionHandler> exceptionHandlers; + public Vector<Label> yields = new Vector<Label>(); /* break/continue finally's level. * This is the lowest level in the exceptionHandlers which should @@ -148,9 +148,9 @@ mrefs = this; cw = module.classfile.cw; - continueLabels = new Stack(); - breakLabels = new Stack(); - exceptionHandlers = new Stack(); + continueLabels = new Stack<Label>(); + breakLabels = new Stack<Label>(); + exceptionHandlers = new Stack<ExceptionHandler>(); } public void getNone() throws IOException { @@ -682,7 +682,7 @@ private void restoreLocals() throws Exception { endExceptionHandlers(); - Vector v = code.getActiveLocals(); + Vector<String> v = code.getActiveLocals(); loadFrame(); code.getfield("org/python/core/PyFrame", "f_savedlocals", "[Ljava/lang/Object;"); @@ -735,7 +735,7 @@ } private void saveLocals() throws Exception { - Vector v = code.getActiveLocals(); + Vector<String> v = code.getActiveLocals(); code.iconst(v.size()); code.anewarray("java/lang/Object"); int locals = code.getLocal("[Ljava/lang/Object;"); @@ -1278,7 +1278,7 @@ * all the handlers above level temporarily. */ private void doFinallysDownTo(int level) throws Exception { - Stack poppedHandlers = new Stack(); + Stack<ExceptionHandler> poppedHandlers = new Stack<ExceptionHandler>(); while (exceptionHandlers.size() > level) { ExceptionHandler handler = (ExceptionHandler)exceptionHandlers.pop(); @@ -2414,8 +2414,8 @@ * We also need to stop coverage for the recovery of the locals after * a yield. */ - public Vector exceptionStarts = new Vector(); - public Vector exceptionEnds = new Vector(); + public Vector<Label> exceptionStarts = new Vector<Label>(); + public Vector<Label> exceptionEnds = new Vector<Label>(); public boolean bodyDone = false; @@ -2434,13 +2434,13 @@ public void addExceptionHandlers(Label handlerStart) throws Exception { for (int i = 0; i < exceptionStarts.size(); ++i) { - Label start = (Label)exceptionStarts.elementAt(i); - Label end = (Label)exceptionEnds.elementAt(i); + Label start = exceptionStarts.elementAt(i); + Label end = exceptionEnds.elementAt(i); //FIXME: not at all sure that getOffset() test is correct or necessary. if (start.getOffset() != end.getOffset()) { code.trycatch( - (Label)exceptionStarts.elementAt(i), - (Label)exceptionEnds.elementAt(i), + exceptionStarts.elementAt(i), + exceptionEnds.elementAt(i), handlerStart, "java/lang/Throwable"); } Modified: trunk/jython/src/org/python/compiler/ScopeInfo.java =================================================================== --- trunk/jython/src/org/python/compiler/ScopeInfo.java 2009-07-30 03:12:37 UTC (rev 6600) +++ trunk/jython/src/org/python/compiler/ScopeInfo.java 2009-07-30 03:38:40 UTC (rev 6601) @@ -69,7 +69,7 @@ public ArgListCompiler ac; public Map<String, SymInfo> tbl = new LinkedHashMap<String, SymInfo>(); - public Vector names = new Vector(); + public Vector<String> names = new Vector<String>(); public int addGlobal(String name) { // global kind = func vs. class @@ -116,11 +116,11 @@ private final static Object PRESENT = new Object(); - public Hashtable inner_free = new Hashtable(); + public Hashtable<String,Object> inner_free = new Hashtable<String,Object>(); - public Vector cellvars = new Vector(); + public Vector<String> cellvars = new Vector<String>(); - public Vector jy_paramcells = new Vector(); + public Vector<String> jy_paramcells = new Vector<String>(); public int jy_npurecell; @@ -135,7 +135,7 @@ this.up = up; this.distance = distance; boolean func = kind == FUNCSCOPE; - Vector purecells = new Vector(); + Vector<String> purecells = new Vector<String>(); cell = 0; boolean some_inner_free = inner_free.size() > 0; @@ -223,7 +223,7 @@ ctxt.error(illegal.toString(), true, scope_node); } - public Vector freevars = new Vector(); + public Vector<String> freevars = new Vector<String>(); /** * setup the closure on this scope using the scope passed into cook as up as This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |