src/share/classes/javax/lang/model/util/ElementScanner6.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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.  Oracle designates this

@@ -150,56 +150,63 @@
     }
 
     /**
      * {@inheritDoc} This implementation scans the enclosed elements.
      *
-     * @param e  the element to visit
-     * @param p  a visitor-specified parameter
+     * @param e  {@inheritDoc}
+     * @param p  {@inheritDoc}
      * @return the result of scanning
      */
     public R visitPackage(PackageElement e, P p) {
         return scan(e.getEnclosedElements(), p);
     }
 
     /**
      * {@inheritDoc} This implementation scans the enclosed elements.
      *
-     * @param e  the element to visit
-     * @param p  a visitor-specified parameter
+     * @param e  {@inheritDoc}
+     * @param p  {@inheritDoc}
      * @return the result of scanning
      */
     public R visitType(TypeElement e, P p) {
         return scan(e.getEnclosedElements(), p);
     }
 
     /**
-     * {@inheritDoc} This implementation scans the enclosed elements.
+     * {@inheritDoc}
+     *
+     * This implementation scans the enclosed elements, unless the
+     * element is a {@code RESOURCE_VARIABLE} in which case {@code
+     * visitUnknown} is called.
      *
-     * @param e  the element to visit
-     * @param p  a visitor-specified parameter
+     * @param e  {@inheritDoc}
+     * @param p  {@inheritDoc}
      * @return the result of scanning
      */
     public R visitVariable(VariableElement e, P p) {
+        if (e.getKind() != ElementKind.RESOURCE_VARIABLE)
         return scan(e.getEnclosedElements(), p);
+        else
+            return visitUnknown(e, p);
     }
 
     /**
      * {@inheritDoc} This implementation scans the parameters.
      *
-     * @param e  the element to visit
-     * @param p  a visitor-specified parameter
+     * @param e  {@inheritDoc}
+     * @param p  {@inheritDoc}
      * @return the result of scanning
      */
     public R visitExecutable(ExecutableElement e, P p) {
         return scan(e.getParameters(), p);
     }
 
     /**
      * {@inheritDoc} This implementation scans the enclosed elements.
      *
-     * @param e  the element to visit
-     * @param p  a visitor-specified parameter
+     * @param e  {@inheritDoc}
+     * @param p  {@inheritDoc}
      * @return the result of scanning
      */
     public R visitTypeParameter(TypeParameterElement e, P p) {
         return scan(e.getEnclosedElements(), p);
     }