[ductilej] push by samskivert - We need not only to avoid detyping direct children of junit.TestCase, ... on 2010-08-13 18:16 GMT

1 view
Skip to first unread message

duct...@googlecode.com

unread,
Aug 13, 2010, 2:17:11 PM8/13/10
to ductil...@googlegroups.com
Revision: 6dcb7f1fa6
Author: Michael Bayne <m...@samskivert.com>
Date: Fri Aug 13 11:16:25 2010
Log: We need not only to avoid detyping direct children of junit.TestCase,
but also
grandchildren and so on.
http://code.google.com/p/ductilej/source/detail?r=6dcb7f1fa6

Modified:
/src/org/ductilej/detyper/Detype.java

=======================================
--- /src/org/ductilej/detyper/Detype.java Mon Jul 19 22:58:56 2010
+++ /src/org/ductilej/detyper/Detype.java Fri Aug 13 11:16:25 2010
@@ -1218,10 +1218,13 @@

// avoid detyping constructors of classes that extend
junit.framework.TestCase that take a
// single String argument
- if (mname == _names.init && pcount == 1 &&
-
String.valueOf(_env.enclClass.sym.getSuperclass()).equals(JUNIT_TESTCASE) &&
- String.valueOf(meth.params.head.vartype).equals("String")) {
- return true;
+ for (Type t = _env.enclClass.sym.getSuperclass(); t !=
_syms.objectType && t.tsym != null;
+ t = ((ClassSymbol)t.tsym).getSuperclass()) {
+ if (mname == _names.init && pcount == 1 &&
+ String.valueOf(t).equals(JUNIT_TESTCASE) &&
+ String.valueOf(meth.params.head.vartype).equals("String"))
{
+ return true;
+ }
}

return false;

Reply all
Reply to author
Forward
0 new messages