Bug 331074

Summary: DOM AST IdentifierTypePattern and Type nodes require concrete visitor implementations
Product: [Tools] AspectJ Reporter: Nieraj Singh <dv.nisingh>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: DEVELOPMENT   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Nieraj Singh CLA 2010-11-24 18:31:18 EST
Build Identifier: Eclipse 3.6 I20100608-0911


For DOM AST IdentifierTypePattern nodes, whose subtypes include WildTypePatterns, ExactTypePatterns, and BindingTypePatterns, as well as DOM AST Type nodes, the following enhancements may need to be considered:


1. AjASTVisitor should have visit methods for each concrete IdentifierTypePattern type (ExactTypePattern, WildTypePattern, and BindingTypePattern), instead of a generalized visit(IdentifierTypePattern). The same may apply for the AjASTMatcher.

2. The accept0(ASTVisitor visitor) implementation in IdentifierTypePattern that currently visits the child Type node should be pushed down to ExactTypePattern, and perhaps even WildTypePattern (see point 3 below). 

3. Further investigation should be made on whether DOM WildTypePatterns should hold a Type node as a child node, or just a String representation of the unresolved type, as it currently does. If WildTypePatterns should be containing Type nodes, they need to be constructed in the AjASTConverter at the time when the weaver WildTypePattern is converted to the DOM equivalent. In this case, the WildTypePattern and the ExactTypePattern should both visit their child Type nodes in their accept0(ASTVisitor visitor) implementation.

4. DOM BindingTypePattern nodes already visit FormalBinding nodes, and in turn, the FormalBinding nodes visit the enclosing Type nodes. However, at this stage, it may be necessary to visit each concrete Type node separately (SimpleType, QualifiedType, etc..), therefore visit methods for each concrete Type should be added to the AjASTVisitor

5. As mentioned in point 4, the AjASTVisitor should be expanded to support visits to concrete Type nodes like SimpleType, QualifiedType and ParameterizedType, and calls to these visitor methods should occur in the accept0(..) methods in TypePattern nodes that contain Types, like ExactTypePattern, FormalBinding, AnnotationTypePatterns (when bugzilla 331069 gets implemented), and possibly WildTypePatterns.

6. For TypePattern nodes that contain a Type node, the Type node should never be null. 




Reproducible: Always