You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Svatopluk Dedic (Jira)" <ji...@apache.org> on 2021/09/09 09:09:00 UTC

[jira] [Created] (NETBEANS-5991) Completion does not substitute type parameters into superclass methods.

Svatopluk Dedic created NETBEANS-5991:
-----------------------------------------

             Summary: Completion does not substitute type parameters into superclass methods.
                 Key: NETBEANS-5991
                 URL: https://issues.apache.org/jira/browse/NETBEANS-5991
             Project: NetBeans
          Issue Type: Bug
          Components: groovy - Editor
    Affects Versions: 12.5
            Reporter: Svatopluk Dedic


Consider type like *java.util.Properties* extends Hastable<Object, Object>. When going up, the completion calls *ClassNode.getSuperclass()*.

Internally the ClassNode's superClass fields leads to
{quote}superClass ClassNode #9125 java.util.Hashtable <java.lang.Object, java.lang.Object> -> java.util.Hashtable <K extends java.lang.Object, V extends java.lang.Object>
{quote}
But as the getSuperClass() redirects, it will return
{quote}typeNode.getSuperClass() DecompiledClassNode #8988 java.util.Hashtable <K extends java.lang.Object, V extends java.lang.Object>
{quote}
The redirect target type declares type variables, but the substitutions are in the ClassNode that redirects to the target.

Completion should probably circumvent that using *getSuperclassUnresolved* or something like that.

Because of that, *FieldsCCTest.testFields2_javaPropertyReference* displays both
{quote}METHOD getOrDefault(Object, Object) [PUBLIC] Object
METHOD getOrDefault(Object, V) [PUBLIC] V
{quote}
the second method comes from Hashtable, but V := Object is lost.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

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