use of com.sun.tools.javac.util.ListBuffer in project ceylon-compiler by ceylon.
the class JavacPathFileManager method list.
@Override
public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
// validatePackageName(packageName);
nullCheck(packageName);
nullCheck(kinds);
Iterable<? extends Path> paths = getLocation(location);
if (paths == null)
return List.nil();
ListBuffer<JavaFileObject> results = new ListBuffer<JavaFileObject>();
for (Path path : paths) list(path, packageName, kinds, recurse, results);
return results.toList();
}
use of com.sun.tools.javac.util.ListBuffer in project ceylon-compiler by ceylon.
the class JavacPathFileManager method getClassLoader.
@Override
public ClassLoader getClassLoader(Location location) {
nullCheck(location);
Iterable<? extends Path> path = getLocation(location);
if (path == null)
return null;
ListBuffer<URL> lb = new ListBuffer<URL>();
for (Path p : path) {
try {
lb.append(p.toUri().toURL());
} catch (MalformedURLException e) {
throw new AssertionError(e);
}
}
return getClassLoader(lb.toArray(new URL[lb.size()]));
}
use of com.sun.tools.javac.util.ListBuffer in project ceylon-compiler by ceylon.
the class ExpressionTransformer method transformLet.
// this one trusts the expected type
private JCExpression transformLet(LetExpression op, Type expectedType) {
ListBuffer<JCStatement> defs = new ListBuffer<JCStatement>();
for (Tree.Statement stmt : op.getLetClause().getVariables()) {
defs.addAll(statementGen().transformVariableOrDestructure(stmt));
}
Tree.Term term = op.getLetClause().getExpression().getTerm();
BoxingStrategy boxingStrategy = CodegenUtil.getBoxingStrategy(term);
JCExpression expr = transformExpression(term, boxingStrategy, expectedType);
at(op);
if (isAnything(op.getTypeModel()) && CodegenUtil.isUnBoxed(term)) {
defs.add(make().Exec(expr));
expr = makeNull();
}
return make().LetExpr(defs.toList(), expr);
}
Aggregations