Skip to content

Commit 8e2a533

Browse files
committed
8315137: Add explicit override RecordComponentElement.asType()
Reviewed-by: jjg
1 parent b4b2fec commit 8e2a533

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/java.compiler/share/classes/javax/lang/model/element/Element.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public interface Element extends AnnotatedConstruct {
6868
* @see TypeElement#asType
6969
* @see TypeParameterElement#asType
7070
* @see VariableElement#asType
71+
* @see RecordComponentElement#asType
7172
*/
7273
TypeMirror asType();
7374

src/java.compiler/share/classes/javax/lang/model/element/RecordComponentElement.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, 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
@@ -25,13 +25,28 @@
2525

2626
package javax.lang.model.element;
2727

28+
import javax.lang.model.type.TypeMirror;
29+
import javax.lang.model.type.TypeKind;
30+
2831
/**
2932
* Represents a record component.
3033
*
3134
* @jls 8.10.1 Record Components
3235
* @since 16
3336
*/
3437
public interface RecordComponentElement extends Element {
38+
/**
39+
* {@return the type of this record component}
40+
*
41+
* Note that the types of record components range over {@linkplain
42+
* TypeKind many kinds} of types, including primitive types,
43+
* declared types, and array types.
44+
*
45+
* @see TypeKind
46+
*/
47+
@Override
48+
TypeMirror asType();
49+
3550
/**
3651
* {@return the enclosing element of this record component}
3752
*

0 commit comments

Comments
 (0)