[Fb-contrib-commit] SF.net SVN: fb-contrib: [567] trunk/fb-contrib/samples
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-06-19 05:48:06
|
Revision: 567 Author: dbrosius Date: 2006-06-18 22:47:54 -0700 (Sun, 18 Jun 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=567&view=rev Log Message: ----------- allow iterators Modified Paths: -------------- trunk/fb-contrib/samples/UTA_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java Modified: trunk/fb-contrib/samples/UTA_Sample.java =================================================================== --- trunk/fb-contrib/samples/UTA_Sample.java 2006-06-19 05:28:38 UTC (rev 566) +++ trunk/fb-contrib/samples/UTA_Sample.java 2006-06-19 05:47:54 UTC (rev 567) @@ -1,3 +1,4 @@ +import java.util.Iterator; import java.util.List; public class UTA_Sample @@ -20,4 +21,14 @@ return data; } + + public Long[] testList3(List<Long> l) + { + Iterator<Long> it = l.iterator(); + Long[] data = new Long[l.size()]; + for (int i = 0; i < l.size(); i++) + data[i] = it.next(); + + return data; + } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java 2006-06-19 05:28:38 UTC (rev 566) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java 2006-06-19 05:47:54 UTC (rev 567) @@ -116,6 +116,14 @@ sawAlias = true; } } + } else if ("keySet".equals(methodName) || "values".equals(methodName) || "iterator".equals(methodName) || "next".equals(methodName)) { + if (stack.getStackDepth() > 1) { + OpcodeStack.Item itm = stack.getStackItem(1); + reg = isLocalCollection(itm); + if (reg >= 0) { + sawAlias = true; + } + } } } else if (((seen == ISTORE) || ((seen >= ISTORE_0) && (seen <= ISTORE_3))) || ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3)))) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |