test/tools/javac/api/TestOperators.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 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.
--- 1,7 ----
/*
! * Copyright (c) 2005, 2011, 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,34 ****
/*
* @test
* @bug 6338064 6346249 6340951 6392177
* @summary Tree API: can't determine kind of operator
* @author Peter von der Ah\u00e9
! * @compile TestOperators.java
* @compile -processor TestOperators -proc:only TestOperators.java
*/
import java.util.Set;
import javax.annotation.processing.*;
--- 24,35 ----
/*
* @test
* @bug 6338064 6346249 6340951 6392177
* @summary Tree API: can't determine kind of operator
* @author Peter von der Ah\u00e9
! * @library ../lib
! * @build JavacTestingAbstractProcessor TestOperators
* @compile -processor TestOperators -proc:only TestOperators.java
*/
import java.util.Set;
import javax.annotation.processing.*;
*** 44,54 ****
@interface TestMe {
Tree.Kind value();
}
@SupportedAnnotationTypes("TestMe")
! public class TestOperators extends AbstractProcessor {
@TestMe(POSTFIX_INCREMENT)
public int test_POSTFIX_INCREMENT(int i) {
return i++;
}
--- 45,55 ----
@interface TestMe {
Tree.Kind value();
}
@SupportedAnnotationTypes("TestMe")
! public class TestOperators extends JavacTestingAbstractProcessor {
@TestMe(POSTFIX_INCREMENT)
public int test_POSTFIX_INCREMENT(int i) {
return i++;
}
*** 297,307 ****
RoundEnvironment roundEnvironment)
{
final Trees trees = Trees.instance(processingEnv);
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
! class Scan extends ElementScanner7<Void,Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
Object debug = e; // info for exception handler
try {
TestMe info = e.getAnnotation(TestMe.class);
--- 298,308 ----
RoundEnvironment roundEnvironment)
{
final Trees trees = Trees.instance(processingEnv);
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
! class Scan extends ElementScanner<Void,Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
Object debug = e; // info for exception handler
try {
TestMe info = e.getAnnotation(TestMe.class);
*** 341,347 ****
for (Element e : roundEnvironment.getRootElements()) {
scan.scan(e);
}
return true;
}
-
}
--- 342,347 ----