File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
src/java.compiler/share/classes/javax/lang/model Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2005, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2005, 2026 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -120,6 +120,15 @@ public interface TypeMirror extends AnnotatedConstruct {
120120 * The results of {@code t1.equals(t2)} and
121121 * {@code Types.isSameType(t1, t2)} may differ.
122122 *
123+ * @apiNote The identity of a {@code TypeMirror} involves implicit
124+ * state not directly accessible from its methods, including state
125+ * about the presence of unrelated types. {@code TypeMirror}
126+ * objects created by different implementations of these
127+ * interfaces should <i>not</i> be expected to compare as equal
128+ * even if "the same" type is being modeled; this is
129+ * analogous to the inequality of {@code Class} objects for the
130+ * same class file loaded through different class loaders.
131+ *
123132 * @param obj the object to be compared with this type
124133 * @return {@code true} if the specified object is equal to this one
125134 */
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2005, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2005, 2026 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -106,6 +106,15 @@ public interface Types {
106106 * {@code TypeMirror} objects can have different annotations and
107107 * still be considered the same.
108108 *
109+ * @apiNote The identity of a {@code TypeMirror} involves implicit
110+ * state not directly accessible from its methods, including state
111+ * about the presence of unrelated types. {@code TypeMirror}
112+ * objects created by different implementations of these
113+ * interfaces should <i>not</i> be expected to compare as equal
114+ * even if "the same" type is being modeled; this is
115+ * analogous to the inequality of {@code Class} objects for the
116+ * same class file loaded through different class loaders.
117+ *
109118 * @param t1 the first type
110119 * @param t2 the second type
111120 * @return {@code true} if and only if the two types are the same
You can’t perform that action at this time.
0 commit comments