-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NETBEANS-1673]:Added support for auto-complete of enum case values i… #1059
Conversation
…n switch expression
* @return the result of the invoked method. | ||
* @since 2.41 | ||
*/ | ||
public static Object invokeMethod(String className, String methodName, List<Class> parameterTypes, Object obj, Object... paramArgs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I don't think we should have a method like this in the API. That is not bringing any real value to the clients, and the use is (hopefully) transient anyway.
My recommendation is to isolate the reflection into the TreeShims, providing "high-level" methods (like getExpressions(Tree), enforcing that the Tree is a SwitchExpressionTree). With:
#1074
The only copy of TreeShims is in java.source.base, and the methods can be reused by java.hints and java.completion (and if needed by any other module).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had removed ReflectionHelper in recent commit instead used TreeShims class
java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there should be an API change for this, and esp. not a method that only invokes reflection.
Also, tests appear to be missing?
…n switch expression
Had removed the API is recent commit instead TreeShims is used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK.
[NETBEANS-1673]:Added support for auto-complete of enum case values i…
…n switch expression(jdk-12 feature)
Jira link : https://issues.apache.org/jira/browse/NETBEANS-1673