langtools/test/tools/javac/processing/errors/StopOnInapplicableAnnotations/Processor.java
equal
deleted
inserted
replaced
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) { } |