8274244: ReportOnImportedModuleAnnotation.java fails on rerun
Reviewed-by: jjg
This commit is contained in:
parent
37890650a7
commit
c391e59ea6
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -27,7 +27,10 @@
|
|||||||
* 8235458
|
* 8235458
|
||||||
* @summary javac shouldn't fail when an annotation processor report a message about an annotation on a module
|
* @summary javac shouldn't fail when an annotation processor report a message about an annotation on a module
|
||||||
* javac should process annotated module when imports statement are present
|
* javac should process annotated module when imports statement are present
|
||||||
|
* @library /tools/lib
|
||||||
* @modules jdk.compiler
|
* @modules jdk.compiler
|
||||||
|
* @build toolbox.ToolBox
|
||||||
|
* @run main ReportOnImportedModuleAnnotation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@ -41,6 +44,8 @@ import javax.tools.StandardJavaFileManager;
|
|||||||
import javax.tools.StandardLocation;
|
import javax.tools.StandardLocation;
|
||||||
import javax.tools.ToolProvider;
|
import javax.tools.ToolProvider;
|
||||||
|
|
||||||
|
import toolbox.ToolBox;
|
||||||
|
|
||||||
public class ReportOnImportedModuleAnnotation {
|
public class ReportOnImportedModuleAnnotation {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
@ -49,6 +54,9 @@ public class ReportOnImportedModuleAnnotation {
|
|||||||
|
|
||||||
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
|
||||||
|
|
||||||
|
// Clean any existing files in output directory
|
||||||
|
(new ToolBox()).cleanDirectory(testOutputPath);
|
||||||
|
|
||||||
// Compile annotation and processor modules
|
// Compile annotation and processor modules
|
||||||
StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
|
StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
|
||||||
fileManager.setLocationFromPaths(StandardLocation.MODULE_SOURCE_PATH, List.of(testBasePath.resolve("mods-src1/")));
|
fileManager.setLocationFromPaths(StandardLocation.MODULE_SOURCE_PATH, List.of(testBasePath.resolve("mods-src1/")));
|
||||||
|
Loading…
Reference in New Issue
Block a user