langtools/test/tools/javac/processing/errors/StopOnInapplicableAnnotations/Processor.java
changeset 34560 b6a567b677f7
parent 27852 2e6ad0e4fe20
child 45090 a0908e5be3bc
equal deleted inserted replaced
34481:e0ff9821f1e8 34560:b6a567b677f7
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    69         JavacFileManager fm = JavacTool.create().getStandardFileManager(null, null, null);
    69         JavacFileManager fm = JavacTool.create().getStandardFileManager(null, null, null);
    70         for (File sp : sourcePath) {
    70         for (File sp : sourcePath) {
    71             File inp = new File(sp, args[0]);
    71             File inp = new File(sp, args[0]);
    72 
    72 
    73             if (inp.canRead()) {
    73             if (inp.canRead()) {
    74                 testContent = fm.getRegularFile(inp.toPath()).getCharContent(true).toString();
    74                 testContent = fm.getJavaFileObject(inp.toPath()).getCharContent(true).toString();
    75             }
    75             }
    76         }
    76         }
    77         if (testContent == null) throw new IllegalStateException();
    77         if (testContent == null) throw new IllegalStateException();
    78         DiagnosticListener<JavaFileObject> devNull = new DiagnosticListener<JavaFileObject>() {
    78         DiagnosticListener<JavaFileObject> devNull = new DiagnosticListener<JavaFileObject>() {
    79             @Override public void report(Diagnostic<? extends JavaFileObject> diagnostic) { }
    79             @Override public void report(Diagnostic<? extends JavaFileObject> diagnostic) { }