Examples of useSource()


Examples of com.sun.tools.javac.util.Log.useSource()

     * Replace Placeholders for repeating annotations with their containers
     */
    private <T extends Attribute.Compound> void complete(Annotate.AnnotateRepeatedContext<T> ctx) {
        Log log = ctx.log;
        Env<AttrContext> env = ctx.env;
        JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
        try {
            // TODO: can we reduce duplication in the following branches?
            if (ctx.isTypeCompound) {
                Assert.check(!isTypesEmpty());

View Full Code Here

Examples of com.sun.tools.javac.util.Log.useSource()

                attributes = result.reverse();

                Assert.check(SymbolMetadata.this.getPlaceholders().isEmpty());
            }
        } finally {
            log.useSource(oldSource);
        }
    }

    private <T extends Attribute.Compound> T replaceOne(Placeholder<T> placeholder, Annotate.AnnotateRepeatedContext<T> ctx) {
        Log log = ctx.log;
View Full Code Here

Examples of com.sun.tools.javac.util.Log.useSource()

            + "    else\n"
            + "      System.out.println(args.length + \" args\");\n"
            + "  }\n"
            + "}\n";
        JavaFileObject fo = new StringJavaFileObject("Foo", text);
        log.useSource(fo);

        Scanner s = sfac.newScanner(fo.getCharContent(true));
        Parser parser = pfac.newParser(s, false, genEndPos);
        JCTree.JCCompilationUnit tree = parser.compilationUnit();
        log.setEndPosTable(fo, tree.endPositions);
View Full Code Here

Examples of com.sun.tools.javac.util.Log.useSource()

            + "    else\n"
            + "      System.out.println(args.length + \" args\");\n"
            + "  }\n"
            + "}\n";
        JavaFileObject fo = new StringJavaFileObject("Foo", text);
        log.useSource(fo);

        CharSequence cs = fo.getCharContent(true);
        Parser parser = pfac.newParser(cs, false, genEndPos, false);
        JCTree.JCCompilationUnit tree = parser.parseCompilationUnit();
        log.setEndPosTable(fo, tree.endPositions);
View Full Code Here

Examples of com.sun.tools.javac.util.Log.useSource()

            + "    else\n"
            + "      System.out.println(args.length + \" args\");\n"
            + "  }\n"
            + "}\n";
        JavaFileObject fo = new StringJavaFileObject("Foo", text);
        log.useSource(fo);

        Scanner s = sfac.newScanner(fo.getCharContent(true));
        Parser parser = pfac.newParser(s, false, genEndPos);
        JCTree.JCCompilationUnit tree = parser.compilationUnit();
        log.setEndPosTable(fo, tree.endPositions);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.