Re: [Codenarc-user] Incomplete AST nodes?
Brought to you by:
chrismair
From: Hamlet D. <ham...@ca...> - 2011-04-13 19:32:55
|
CodeNarc runs in a fairly early compiler phase. We do this so that you don't need to have the project's compiled class files on the classpath... you can still run CodeNarc even if your build/code is broken! On the negative side, that means a lot of type information is missing. Be careful when referencing types because any non-JDK types may not exist at the time you run CodeNarc. Do you have a simple example of the source the shows Object as the parent class with the missing inheritence problem? SOmething like {code} class A {} class B extends A {} class C extends B {} {code} Or something simple like that? ALso, I'd love to hear the specifics of the rule. Perhaps I can quickly write it for you, that way we can include it in the base product rather than leave it to something for you to maintain. (just a thought) ----- Original Message ----- > I'm trying to build a rather complex rule based on information also > kept in the super class of a classnode. I made several observations: > 1. The class hierarchy seems broken with some classes. That is, > walking up along the superClass members I see java.lang.Object too > soon > 2. Not all fields of a class are visible in the classNode. > > I've built a rule based on the AbstractAstVisitor and overloaded > multiple visit* methods, such as visitClassEx and > visitConstructorOrMethodEx. > > For the incomplete fields information I suspect the threaded > execution > of the rules against the fileset. But why some superClass info is > missing I cannot explain. > > Any idea, what goes wrong here? > > Regards, > klaus. > > ------------------------------------------------------------------------------ > Forrester Wave Report - Recovery time is now measured in hours and > minutes > not days. Key insights are discussed in the 2010 Forrester Wave > Report as > part of an in-depth evaluation of disaster recovery service > providers. > Forrester found the best-in-class provider in terms of services and > vision. > Read this report now! http://p.sf.net/sfu/ibm-webcastpromo > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > |