how to tell 2 methods are override-equivalent
Hamlin Li
huaming.li at oracle.com
Fri Mar 17 03:15:30 UTC 2017
Hi,
( I'm not sure if this is the right alias to ask the question, please
help forward if necessary. )
I have a question about telling whether one method is subsignature of
another one. My situation is,
1. there is a TypeElement *t1 *which represents java.net.URL, and a
ExecutableElement *m1* which represents getContent(java.lang.Class*<?>*[]),
2. there is a String *t2* which is "java.net.URL", and another String
*m2 *which is "getContent(java.lang.Class[])".
The difference between m1 and m2 is that, m1 is an instance of
ExecutableElement, m2 is an instance of String; there is a wildcard type
argument in m1.
Is there a way to tell whether m1 and m2 are override-equivalent, m2 is
subsignature of m1?
I suppose I should use
javax.lang.model.util.Types.isSubsignature(ExecutableType m1,
ExecutableType m2), but I don't know how can I convert ExecutableElement
*m1* and String *m2* to**ExecutableType.
Or I'm in wrong direction?
Thank you
-Hamlin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20170317/379ccd8e/attachment.html>
More information about the compiler-dev
mailing list