test/tools/javac/processing/model/element/TestPackageElement.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,35 ----
/*
* @test
* @bug 6449798 6399404
* @summary Test basic workings of PackageElement
* @author Joseph D. Darcy
+ * @library ../../../lib
+ * @build JavacTestingAbstractProcessor
* @build TestPackageElement
* @compile -processor TestPackageElement -proc:only TestPackageElement.java
*/
import java.util.Set;
*** 41,55 ****
import static javax.tools.StandardLocation.*;
/**
* Test basic workings of PackageElement.
*/
! @SupportedAnnotationTypes("*")
! public class TestPackageElement extends AbstractProcessor {
! private Filer filer;
! private Elements eltUtils;
!
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
if (!roundEnv.processingOver()) {
PackageElement unnamedPkg = eltUtils.getPackageElement("");
--- 43,53 ----
import static javax.tools.StandardLocation.*;
/**
* Test basic workings of PackageElement.
*/
! public class TestPackageElement extends JavacTestingAbstractProcessor {
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
if (!roundEnv.processingOver()) {
PackageElement unnamedPkg = eltUtils.getPackageElement("");
*** 69,85 ****
if (javaLang.isUnnamed())
throw new RuntimeException("Package java.lang is unnamed!");
}
return true;
}
-
- public SourceVersion getSupportedSourceVersion() {
- return SourceVersion.latest();
- }
-
- public void init(ProcessingEnvironment processingEnv) {
- super.init(processingEnv);
- filer = processingEnv.getFiler();
- eltUtils = processingEnv.getElementUtils();
- }
-
}
--- 67,72 ----