lahodaj commented on a change in pull request #1877: [NETBEANS-3604]Supports 
for Records (JEP 359) in JDK-14"
URL: https://github.com/apache/netbeans/pull/1877#discussion_r367892316
 
 

 ##########
 File path: 
java/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java
 ##########
 @@ -381,6 +385,35 @@ public static Context resolveContext(CompilationInfo 
controller, Document doc, i
                             el = e;
                         }
                     }
+                    if (el != null && el.getKind() == ElementKind.METHOD) {
+                        for (Element peer : 
el.getEnclosingElement().getEnclosedElements()) {
+                            if 
(peer.getKind().name().contains("RECORD_COMPONENT")) {
+                                try {
+                                    Class<?> recordComponent = 
Class.forName("javax.lang.model.element.RecordComponentElement", true, 
VariableTree.class.getClassLoader());
+                                    Method getAccessor = 
recordComponent.getDeclaredMethod("getAccessor");
+                                    Method getRecordComponents = 
TypeElement.class.getDeclaredMethod("getRecordComponents");
 
 Review comment:
   I wonder if the reflection should be separated into TreeShims. But this can 
wait.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to