Scott, Do you mean the JMethodCall produced by CastNormalizer.ReplaceTypeChecksVisitor? I looked at doing this, but it seems by the time you get to this stage, you know longer can tell the difference between a cast inserted automatically because of generics, or a cast inserted by the programmer (from JDT CastExpression). I suppose an extra field could be added to JCastOperation to tell if it came from an automatically generated cast, but perhaps this is not what you were thinking of?
-Ray On Thu, Jan 29, 2009 at 1:23 PM, Scott Blum <sco...@google.com> wrote: > On Thu, Jan 29, 2009 at 3:41 PM, Ray Cromwell <cromwell...@gmail.com> wrote: >> >> If I add a check for an option, and make this routine a no-op, is it >> going to work, or break something? Alternatively, I can replace calls >> to canCastUnsafe/dynamicCast with no-ops further down in the >> processing and get rid of all casts. > > This is going to break stuff because the return type of the called method > will be seen to be Object without the cast, which will destroy > TypeTightener's ability to optimize, and generally the AST won't be valid > without it. What you would need to do is modify the JMethodCall being > produced to override the return type of the target JMethod given your better > generic information. > Scott > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---