[Fb-contrib-commit] SF.net SVN: fb-contrib: [993] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-03-09 04:03:10
|
Revision: 993 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=993&view=rev Author: dbrosius Date: 2008-03-08 20:03:15 -0800 (Sat, 08 Mar 2008) Log Message: ----------- allow for arguments that have paths specified with / Modified Paths: -------------- trunk/fb-contrib/samples/ITC_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java Modified: trunk/fb-contrib/samples/ITC_Sample.java =================================================================== --- trunk/fb-contrib/samples/ITC_Sample.java 2008-03-09 03:46:50 UTC (rev 992) +++ trunk/fb-contrib/samples/ITC_Sample.java 2008-03-09 04:03:15 UTC (rev 993) @@ -5,8 +5,19 @@ public class ITC_Sample { - public String test(List<String> l) + class A { + + } + + class B extends A + {} + + class C extends A + {} + + public String testOthers(List<String> l) + { if (l instanceof ArrayList) return (String)((ArrayList)l).remove(0); else if (l instanceof LinkedList) @@ -16,4 +27,14 @@ else return null; } + + public String testMine(A a) + { + if (a instanceof B) + return "Yes"; + else if (a instanceof C) + return "No"; + else + return "Unknown"; + } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java 2008-03-09 03:46:50 UTC (rev 992) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java 2008-03-09 04:03:15 UTC (rev 993) @@ -47,10 +47,13 @@ * * @return if they are similar */ - public static boolean similarPackages(final String packName1, final String packName2, int depth) { + public static boolean similarPackages(String packName1, String packName2, int depth) { if (depth == 0) return true; + packName1 = packName1.replace('/', '.'); + packName2 = packName2.replace('/', '.'); + int dot1 = packName1.indexOf('.'); int dot2 = packName2.indexOf('.'); if (dot1 < 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |