diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2015-11-27 08:22:17 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2015-12-22 01:59:02 +0000 |
commit | 11d1d8efc1b17eb87b4cd6aa5ae82f67cb862e96 (patch) | |
tree | bb2ab2a0c820ddcb5a8a91e76f5da0e522e662eb /javax/lang/model/util/SimpleElementVisitor6.java | |
parent | f41a2c18c6dd259d21cf72a0e66e68c7a0c9a808 (diff) | |
download | classpath-11d1d8efc1b17eb87b4cd6aa5ae82f67cb862e96.tar.gz |
Add remaining javax.lang.model.util classes for Java 7.
2015-11-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
* javax/lang/model/util/AbstractAnnotationValueVisitor6.java:
Fix missing brace in Javadoc.
* javax/lang/model/util/AbstractAnnotationValueVisitor7.java:
New abstract class.
(AbstractAnnotationValueVisitor7()): Implemented.
* javax/lang/model/util/AbstractElementVisitor7.java,
New abstract class.
(AbstractElementVisitor7()): Implemented.
* javax/lang/model/util/AbstractTypeVisitor6.java:
Fix missing brace in Javadoc.
* javax/lang/model/util/AbstractTypeVisitor7.java:
New abstract class.
(AbstractTypeVisitor7()): Implemented.
(visitUnion(UnionType,P)): Likewise.
* javax/lang/model/util/ElementKindVisitor6.java:
(visitVariableAsResourceVariable(VariableElement,P)):
Should call visitUnknown for version 6.
* javax/lang/model/util/ElementKindVisitor7.java:
New class.
(ElementKindVisitor7()): Implemented.
(ElementKindVisitor7(R)): Likewise.
(visitVariableAsResourceVariable(VariableElement,P)):
Implemented to return the result of defaultAction.
* javax/lang/model/util/ElementScanner6.java:
Fix missing brace in Javadoc. Add missing @return
documentation.
(visitVariable(VariableElement,P)): Should call visitUnknown
on 6 if the element is a resource variable element.
* javax/lang/model/util/ElementScanner7.java,
New class.
(ElementScanner7()): Implemented.
(ElementScanner7(R)): Likewise.
(visitVariable(VariableElement,P)): Implemented.
* javax/lang/model/util/SimpleAnnotationValueVisitor7.java:
New class.
(SimpleAnnotationValueVisitor7()): Implemented.
(SimpleAnnotationValueVisitor7(R)): Likewise.
* javax/lang/model/util/SimpleElementVisitor6.java:
(visitVariable(VariableElement,P)): Should call visitUnknown
on 6 if the element is a resource variable element.
* javax/lang/model/util/SimpleElementVisitor7.java:
New class.
(SimpleElementVisitor7()): Implemented.
(SimpleElementVisitor7(R)): Likewise.
(visitVariable(VariableElement,P)): Implemented.
* javax/lang/model/util/SimpleTypeVisitor6.java:
(SimpleTypeVisitor6): Fix copy-and-paste error in documentation.
* javax/lang/model/util/SimpleTypeVisitor7.java:
New class.
(SimpleTypeVisitor7()): Implemented.
(SimpleTypeVisitor7(R)): Likewise.
(visitUnion(UnionType,P)): Implemented.
* javax/lang/model/util/TypeKindVisitor7.java,
New class.
(TypeKindVisitor7()): Implemented.
(TypeKindVisitor7(R)): Likewise.
(visitUnion(UnionType,P)): Implemented.
Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
Diffstat (limited to 'javax/lang/model/util/SimpleElementVisitor6.java')
-rw-r--r-- | javax/lang/model/util/SimpleElementVisitor6.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/javax/lang/model/util/SimpleElementVisitor6.java b/javax/lang/model/util/SimpleElementVisitor6.java index f41315087..f0aacd34b 100644 --- a/javax/lang/model/util/SimpleElementVisitor6.java +++ b/javax/lang/model/util/SimpleElementVisitor6.java @@ -1,5 +1,5 @@ /* SimpleElementVisitor6.java -- A simple visitor implementation for 1.6. - Copyright (C) 2013 Free Software Foundation, Inc. + Copyright (C) 2013, 2015 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -42,6 +42,7 @@ import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; import javax.lang.model.element.ElementVisitor; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.PackageElement; @@ -177,17 +178,23 @@ public class SimpleElementVisitor6<R,P> extends AbstractElementVisitor6<R,P> } /** - * Visits a variable element. This implementation simply - * calls {@code defaultAction(element, parameter)}. + * Visits a variable element. This implementation calls + * {@code defaultAction(element, parameter)}, unless the element is a + * {@code RESOURCE_VARIABLE}, in which case it calls + * {@code visitUnknown(element, parameter)} to retain 1.6 behaviour. * * @param element the variable element to visit. * @param parameter the additional parameter, specific to the visitor. * May be {@code null}. - * @return the result of {@code defaultAction(element, parameter)}. + * @return the result of {@code defaultAction(element, parameter)}, + * or {@code visitUnknown(element, parameter)} if the element + * is a {@code RESOURCE_VARIABLE}. */ @Override public R visitVariable(VariableElement element, P parameter) { + if (element.getKind() == ElementKind.RESOURCE_VARIABLE) + return visitUnknown(element, parameter); return defaultAction(element, parameter); } |