Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » VariableDeclarationFragment /resolveBinding() is returning null
VariableDeclarationFragment /resolveBinding() is returning null [message #922953] Tue, 25 September 2012 13:37
San Kallada is currently offline San KalladaFriend
Messages: 3
Registered: August 2012
Junior Member
Hi All,

I'm trying to develop a plugin for Eclipse to generate code for one of our internal framework. As you can see I'm trying to create an AST parser for a Type which is dynamically identified.
private void parse(Vector categories,ICompilationUnit icompUnit) {
		
		  ASTParser parser1 = ASTParser.newParser(AST.JLS4); 
		   IJavaProject project = icompUnit.getJavaProject();
		  parser1.setKind(ASTParser.K_COMPILATION_UNIT);
		  Document doc= null;
			try {
				doc = new Document(icompUnit.getSource());
			} catch (JavaModelException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		 parser1.setProject(project);
          parser1.setSource(doc.get().toCharArray());
		  parser1.setResolveBindings(true); 
		  parser1.setBindingsRecovery(true);
		  parser1.setStatementsRecovery(true);
		  CompilationUnit parsedUnit =
				  (CompilationUnit)parser1.createAST(null);
		  parsedUnit.accept(new FVisitor(parsedUnit,categories));
		  
	}
	

But in the visitor (MyVisitor),
public boolean visit(VariableDeclarationFragment node) {
		.............................
		
		node.resolveBinding();
		.............................
}	


node.resolveBinding()is returning null.
Please help me to solve this issue by giving some pointers.

San

[Updated on: Tue, 25 September 2012 13:51]

Report message to a moderator

Previous Topic:ScrolledComposite is not displaying scroll bars
Next Topic:markerResolution to add quick fixes has no effect
Goto Forum:
  


Current Time: Tue Apr 23 10:11:34 GMT 2024

Powered by FUDForum. Page generated in 0.02863 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top