-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
Document existing behavior.
-
Java API
-
SE
Summary
Clarify that the Elements.overrides
relation is irreflexive, that is, a method does not override itself.
Problem
Users may have unnecessary difficulty using this method if they need to reason through whether or not the property holds or code as if the property did not hold.
Solution
Add the necessary spec clarification.
Specification
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java
index f567c7f3b1b..c8849d6f612 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java
@@ -622,6 +622,8 @@ public interface Elements {
* overrides another method.
* When a non-abstract method overrides an abstract one, the
* former is also said to <i>implement</i> the latter.
+ * As implied by JLS {@jls 8.4.8.1}, a method does <em>not</em>
+ * override itself. The overrides relation is <i>irreflexive</i>.
*
* <p> In the simplest and most typical usage, the value of the
* {@code type} parameter will simply be the class or interface
- csr of
-
JDK-8297305 Clarify that javax.lang.model.util.Elements.overrides is irreflexive
-
- Resolved
-