[ductilej] 2 new revisions pushed by samskivert on 2010-08-16 21:01 GMT

1 view
Skip to first unread message

duct...@googlecode.com

unread,
Aug 16, 2010, 5:02:30 PM8/16/10
to ductil...@googlegroups.com
2 new revisions:

Revision: 4b599fd338
Author: Michael Bayne <m...@samskivert.com>
Date: Mon Aug 16 14:00:27 2010
Log: Use exn$W to match our other name augmentations, like param$T.
http://code.google.com/p/ductilej/source/detail?r=4b599fd338

Revision: cf5aa9b88e
Author: Michael Bayne <m...@samskivert.com>
Date: Mon Aug 16 14:01:06 2010
Log: Merge.
http://code.google.com/p/ductilej/source/detail?r=cf5aa9b88e

==============================================================================
Revision: 4b599fd338
Author: Michael Bayne <m...@samskivert.com>
Date: Mon Aug 16 14:00:27 2010
Log: Use exn$W to match our other name augmentations, like param$T.
http://code.google.com/p/ductilej/source/detail?r=4b599fd338

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 Mon Aug 16 14:00:27 2010
@@ -972,7 +972,7 @@
// insert an inner try/catch that catches WrappedException,
dynamically checks whether its
// cause is the caught type and casts and rethrows the cause if so
if (!tree.catchers.isEmpty()) {
- Name cvname = _names.fromString("_rt_" +
tree.catchers.head.param.name);
+ Name cvname = _names.fromString(tree.catchers.head.param.name
+ "$W");
JCCatch catcher = _tmaker.Catch(
_tmaker.VarDef(_tmaker.Modifiers(0L), cvname,

mkFA("org.ductilej.runtime.WrappedException", 0), null),

==============================================================================
Revision: cf5aa9b88e
Author: Michael Bayne <m...@samskivert.com>
Date: Mon Aug 16 14:01:06 2010
Log: Merge.
http://code.google.com/p/ductilej/source/detail?r=cf5aa9b88e

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

=======================================
--- /src/org/ductilej/detyper/Detype.java Mon Aug 16 14:00:27 2010
+++ /src/org/ductilej/detyper/Detype.java Mon Aug 16 14:01:06 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;
@@ -1410,7 +1413,13 @@

protected JCExpression typeToTree (Type type, final int pos)
{
- JCExpression expr = _tmaker.at(pos).Type(type);
+ // note: we use _rootmaker here instead of _tmaker because _tmaker
will try to generate
+ // unqualified names for classes that are imported, but this opens
us up to name collisions
+ // when we are resolving the name of a type that does not normally
appear in the source
+ // file but we happen to need, and said type happens to be
shadowed by a local type name;
+ // _tmaker will assume the imported name can be referenced
unqualified, but that will
+ // resolve to the incorrect shadowing type
+ JCExpression expr = _rootmaker.at(pos).Type(type);

// there's a pesky bug in TreeMaker.Type that puts
java.lang.Object as the "inner" field of
// a JCWildcard for unbound declarations (i.e. Class<?>) which
later causes havoc to be

Reply all
Reply to author
Forward
0 new messages