|Problem with ModifierRuleFilter and Interfaces [message #116022]
||Fri, 19 October 2007 13:16
Originally posted by: saorf.de.ibm.com|
I've got to implement a rule that checks if somebody unnecessarily
declared an interface 'abstract'.
Interface nodes are found together with type declarations, therefore my
idea was to filter all interfaces and type declarations that are abstract
by using a ModifierRuleFilter in the first step.
The second step would have been to loop through the results and ask every
type declaration, if it is an interface.
This way I should have found interfaces declared abstract...
After using the ModifierRuleFilter, none of the interfaces I declared
abstract for testing purposes are in the result list, only types. Why?
Is there another way to solve this problem without the need to parse the
whole type declaration string?
Here's my code:
CodeReviewResource resource =
List typeDeclarations =
ModifierRuleFilter filterAbstract = new
//get abstract types
//loop through abstract types
for(Iterator typeDeclarationsIterator = typeDeclarations.iterator();
TypeDeclaration td = (TypeDeclaration) typeDeclarationsIterator.next();
Powered by FUDForum
. Page generated in 0.01868 seconds