ASTParser newParser = ASTParser.newParser(AST.JLS3);
newParser.setSource(str.toCharArray());
StringBuilder bls=new StringBuilder(str);
CompilationUnit createAST = (CompilationUnit) newParser.createAST(null);
//ArrayList<String> results = new ArrayList<String>();
for (Object n : createAST.imports()) {
ImportDeclaration decl = (ImportDeclaration) n;
String name = decl.getName().getFullyQualifiedName();
if (decl.isOnDemand()) {
bs.append("import "+name+".*;");