Search in sources :

Example 1 with Lint

use of org.eclipse.ceylon.langtools.tools.javac.code.Lint in project ceylon by eclipse.

the class JavacFiler method createSourceOrClassFile.

private JavaFileObject createSourceOrClassFile(boolean isSourceFile, String name) throws IOException {
    if (lint) {
        int periodIndex = name.lastIndexOf(".");
        if (periodIndex != -1) {
            String base = name.substring(periodIndex);
            String extn = (isSourceFile ? ".java" : ".class");
            if (base.equals(extn))
                log.warning("proc.suspicious.class.name", name, extn);
        }
    }
    checkNameAndExistence(name, isSourceFile);
    Location loc = (isSourceFile ? SOURCE_OUTPUT : CLASS_OUTPUT);
    JavaFileObject.Kind kind = (isSourceFile ? JavaFileObject.Kind.SOURCE : JavaFileObject.Kind.CLASS);
    JavaFileObject fileObject = fileManager.getJavaFileForOutput(loc, name, kind, null);
    checkFileReopening(fileObject, true);
    if (lastRound)
        log.warning("proc.file.create.last.round", name);
    if (isSourceFile)
        aggregateGeneratedSourceNames.add(name);
    else
        aggregateGeneratedClassNames.add(name);
    openTypeNames.add(name);
    return new FilerOutputJavaFileObject(name, fileObject);
}
Also used : Lint(org.eclipse.ceylon.langtools.tools.javac.code.Lint) Location(org.eclipse.ceylon.javax.tools.JavaFileManager.Location)

Aggregations

Location (org.eclipse.ceylon.javax.tools.JavaFileManager.Location)1 Lint (org.eclipse.ceylon.langtools.tools.javac.code.Lint)1