jlahoda opened a new pull request #2151:
URL: https://github.com/apache/netbeans/pull/2151


   …face methods when determining if cast is required.
   
   Consider code like:
   `package test;\n" +
   public class Test {\n" +
       public interface Base {\n" +
           public void test() { }\n" +
       }\n" +
       public interface Int extends Base {\n" +
       }\n" +
       public static class Impl implements Int {\n" +
            public void test() { }\n" +
       }\n" +
       private t(Int b) {\n" +
           if (b instanceof Impl) {\n" +
               b.tes",
   `
   
   And invoke code completion, and choose "test()". The code completion then 
needs to determine if a cast of "b" to "Impl" is needed of not. So it will look 
into the type of "b", which is "Int", to see if "test()" is declared there. But 
it is not, and so the cast will be generated, despite the method being declared 
in a supertype.
   
   I believe it should look not only at methods declared directly in "Int", but 
on all members of "Int", even those that are inherited. Which is what this 
patch tries to do.
   


----------------------------------------------------------------
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]



---------------------------------------------------------------------
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