test/tools/javac/processing/filer/TestPackageInfo.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 24,33 ****
--- 24,34 ----
/*
* @test
* @bug 6380018 6392177
* @summary Test the ability to create and process package-info.java files
* @author Joseph D. Darcy
+ * @library ../../lib
* @compile TestPackageInfo.java
* @compile -processor TestPackageInfo -proc:only foo/bar/package-info.java TestPackageInfo.java
*/
import java.util.Set;
*** 47,63 ****
/**
* Test the ability to process annotations on package-info.java files:
* 1) Visibility of package-info files from the command line
* 2) Visibility of generated package-info.java source files
*/
! @SupportedAnnotationTypes("*")
! public class TestPackageInfo extends AbstractProcessor {
! private Elements eltUtils;
! private Messager messager;
! private Filer filer;
! private Map<String,String> options;
!
private int round = 0;
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
round++;
--- 48,58 ----
/**
* Test the ability to process annotations on package-info.java files:
* 1) Visibility of package-info files from the command line
* 2) Visibility of generated package-info.java source files
*/
! public class TestPackageInfo extends JavacTestingAbstractProcessor {
private int round = 0;
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
round++;
*** 125,142 ****
throw new RuntimeException("Unexpected round number " + round);
}
}
return false;
}
-
- public SourceVersion getSupportedSourceVersion() {
- return SourceVersion.latest();
- }
-
- public void init(ProcessingEnvironment processingEnv) {
- super.init(processingEnv);
- eltUtils = processingEnv.getElementUtils();
- messager = processingEnv.getMessager();
- filer = processingEnv.getFiler();
- options = processingEnv.getOptions();
- }
}
--- 120,125 ----