|
35 | 35 | import javax.lang.model.element.ModuleElement; |
36 | 36 | import javax.lang.model.element.Name; |
37 | 37 | import javax.lang.model.element.Parameterizable; |
38 | | -import javax.lang.model.element.QualifiedNameable; |
39 | | -import javax.lang.model.element.RecordComponentElement; |
40 | 38 | import javax.lang.model.element.TypeElement; |
41 | 39 |
|
42 | 40 | import javax.lang.model.util.Elements; |
@@ -82,7 +80,8 @@ public DefaultDomain() { |
82 | 80 | } |
83 | 81 |
|
84 | 82 | /** |
85 | | - * Creates a new {@link DefaultDomain} whose usage type is determined by the argument supplied to this constructor. |
| 83 | + * Creates a new {@link DefaultDomain} <strong>normally for use at annotation processing time</strong>, whose usage |
| 84 | + * type is actually determined by the argument supplied to this constructor. |
86 | 85 | * |
87 | 86 | * @param pe a {@link ProcessingEnvironment}; may be {@code null} in which case the return value of an invocation of |
88 | 87 | * {@link Supplier#get()} on the return value of an invocation of {@link RuntimeProcessingEnvironmentSupplier#of()} |
@@ -113,16 +112,17 @@ public DefaultDomain(final Lock lock) { |
113 | 112 | } |
114 | 113 |
|
115 | 114 | /** |
116 | | - * Creates a new {@link DefaultDomain} whose usage type is determined by the arguments supplied to this constructor. |
| 115 | + * Creates a new {@link DefaultDomain} <strong>normally for use at annotation processing time</strong>, whose usage |
| 116 | + * type is actually determined by the arguments supplied to this constructor. |
117 | 117 | * |
118 | 118 | * @param pe a {@link ProcessingEnvironment}; may be {@code null} in which case the return value of an invocation of |
119 | 119 | * {@link Supplier#get()} on the return value of an invocation of {@link RuntimeProcessingEnvironmentSupplier#of()} |
120 | 120 | * will be used instead |
121 | 121 | * |
122 | 122 | * @param lock a {@link Lock} to use to serialize symbol completion; if {@code null} and {@code pe} is {@code null}, |
123 | 123 | * then a global {@link ReentrantLock} will be used instead; if {@code null} and {@code pe} is non-{@code null}, then |
124 | | - * no serialization of symbol completion will occur and this {@link DefaultDomain} will not be safe for concurrent use |
125 | | - * by multiple threads |
| 124 | + * no serialization of symbol completion will occur <strong>and this {@link DefaultDomain} therefore will not be safe |
| 125 | + * for concurrent use by multiple threads</strong> |
126 | 126 | * |
127 | 127 | * @see RuntimeProcessingEnvironmentSupplier |
128 | 128 | * |
@@ -285,7 +285,8 @@ public UniversalType elementType(final TypeMirror t) { |
285 | 285 | return UniversalType.of(Domain.super.elementType(t), this); |
286 | 286 | } |
287 | 287 |
|
288 | | - private final Elements elements() { |
| 288 | + // Non-private for testing only. |
| 289 | + final Elements elements() { |
289 | 290 | return this.pe().getElementUtils(); |
290 | 291 | } |
291 | 292 |
|
@@ -331,6 +332,12 @@ public UniversalElement javaLangObject() { |
331 | 332 | return UniversalElement.of(Domain.super.javaLangObject(), this); |
332 | 333 | } |
333 | 334 |
|
| 335 | + // (Convenience.) |
| 336 | + @Override // Domain |
| 337 | + public UniversalType javaLangObjectType() { |
| 338 | + return UniversalType.of(Domain.super.javaLangObjectType(), this); |
| 339 | + } |
| 340 | + |
334 | 341 | /** |
335 | 342 | * Returns a non-{@code null} {@link Unlockable} that should be used in a {@code try}-with-resources block guarding |
336 | 343 | * operations that might cause symbol completion. |
@@ -559,7 +566,8 @@ public UniversalElement typeParameterElement(final Parameterizable p, final Char |
559 | 566 | return UniversalElement.of(Domain.super.typeParameterElement(p, name), this); |
560 | 567 | } |
561 | 568 |
|
562 | | - private final Types types() { |
| 569 | + // Non-private for testing only. |
| 570 | + final Types types() { |
563 | 571 | return this.pe().getTypeUtils(); |
564 | 572 | } |
565 | 573 |
|
|
0 commit comments