1 /* |
1 /* |
2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2010, 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. |
46 JavacTool tool = JavacTool.create(); |
46 JavacTool tool = JavacTool.create(); |
47 MyDiagListener dl = new MyDiagListener(); |
47 MyDiagListener dl = new MyDiagListener(); |
48 StandardJavaFileManager fm = tool.getStandardFileManager(dl, null, null); |
48 StandardJavaFileManager fm = tool.getStandardFileManager(dl, null, null); |
49 Iterable<? extends JavaFileObject> files = |
49 Iterable<? extends JavaFileObject> files = |
50 fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(testSrc, T6439826.class.getName()+".java"))); |
50 fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(testSrc, T6439826.class.getName()+".java"))); |
51 Iterable<String> opts = Arrays.asList("-source","1.6", |
51 Iterable<String> opts = Arrays.asList("-proc:only", |
52 "-proc:only", |
|
53 "-processor", "T6439826", |
52 "-processor", "T6439826", |
54 "-processorpath", testClasses); |
53 "-processorpath", testClasses); |
55 StringWriter out = new StringWriter(); |
54 StringWriter out = new StringWriter(); |
56 JavacTask task = tool.getTask(out, fm, dl, opts, null, files); |
55 JavacTask task = tool.getTask(out, fm, dl, opts, null, files); |
57 task.call(); |
56 task.call(); |