Search in sources :

Example 6 with Lint

use of com.sun.tools.javac.code.Lint in project ceylon-compiler by ceylon.

the class Check method setLint.

/* *************************************************************************
 * Errors and Warnings
 **************************************************************************/
Lint setLint(Lint newLint) {
    Lint prev = lint;
    lint = newLint;
    return prev;
}
Also used : Lint(com.sun.tools.javac.code.Lint)

Example 7 with Lint

use of com.sun.tools.javac.code.Lint in project ceylon-compiler by ceylon.

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(com.sun.tools.javac.code.Lint) Location(javax.tools.JavaFileManager.Location)

Aggregations

Lint (com.sun.tools.javac.code.Lint)7 Type (com.sun.tools.javac.code.Type)3 ArrayType (com.sun.tools.javac.code.Type.ArrayType)3 ClassType (com.sun.tools.javac.code.Type.ClassType)3 MethodType (com.sun.tools.javac.code.Type.MethodType)3 UnionClassType (com.sun.tools.javac.code.Type.UnionClassType)3 WildcardType (com.sun.tools.javac.code.Type.WildcardType)3 ClassSymbol (com.sun.tools.javac.code.Symbol.ClassSymbol)2 JavaFileObject (javax.tools.JavaFileObject)2 Scope (com.sun.tools.javac.code.Scope)1 DelegatedScope (com.sun.tools.javac.code.Scope.DelegatedScope)1 DynamicMethodSymbol (com.sun.tools.javac.code.Symbol.DynamicMethodSymbol)1 MethodSymbol (com.sun.tools.javac.code.Symbol.MethodSymbol)1 VarSymbol (com.sun.tools.javac.code.Symbol.VarSymbol)1 JCBlock (com.sun.tools.javac.tree.JCTree.JCBlock)1 JCExpression (com.sun.tools.javac.tree.JCTree.JCExpression)1 JCTypeParameter (com.sun.tools.javac.tree.JCTree.JCTypeParameter)1 JCVariableDecl (com.sun.tools.javac.tree.JCTree.JCVariableDecl)1 Location (javax.tools.JavaFileManager.Location)1