Q:

Using ICompilationUnit for ASTParser.setSource() method in eclipse jdt/ast

ASTParser.setSource has polymorphic methods with different input types. 

However, when I use ICompilationUnit as an input to setSource method,

I got an error saying I didn't use char[] as an input parameter. 

Why this error? 
ADDED
I use eclipse jdt/ast as a part of stand alone java program. In the course of doing that, I don't use eclipse project/resources, but load the java source into char[] as a parameter for setSource(). I'm not sure, but the eclipse may recognize that it's not run as a plugin to block the usage of other polymorphic methods. 

A:

I was trying to execute the jdt/ast as a library for stand-alone java program. When I rerun them in plugin context, everything works fine. 

