Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] code assist labels and captured types

Tom,

Maybe I missed something, but why is Signature#getTypeParameterBounds
(char[]) not sufficient ?

Jerome



                                                                           
             Tom Eicher                                                    
             <eclipse@xxxxxxxx                                             
             er.name>                                                   To 
             Sent by:                  jdt-core-dev@xxxxxxxxxxx            
             jdt-core-dev-boun                                          cc 
             ces@xxxxxxxxxxx                                               
                                                                   Subject 
                                       [jdt-core-dev] code assist labels   
             05/19/2005 12:18          and captured types                  
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
             "Eclipse JDT Core                                             
             developers list."                                             
                                                                           
                                                                           




Implementation of captured types and capture signatures has some
influence on code assist display labels: Try code assist in this snippet
(from bug 89562) in N20050519 and see how the proposals get quite
complicated due to "capture-of" expressions:

import java.util.*;

public class StarGeneric {
    void foo(List<?> star) {
        star.|
    }
}

In the above example, it does not make sense to offer the

add(capture-of ? o)

proposal to the user if all he can pass as an argument is 'null'. I
would prefer to show a simpler proposal similar to what we did for m6:

add(Null o)

or similar.


We used to apply some heuristics to filter the type signatures in
proposals to create the user displayable strings, which does not work
any longer with captures. No blame, the behavior was not specified...
but I think that the proper way to do this would not be UI relying on
heuristics, but that Jdt-core should offer a way to tranform a signature
to a nice display string. See also bug 85293 (which is not accurate any
longer, but the same problem exists now with captured types).

Is there any chance that jdt-core could offer such a functionality? I
would imagine something along these lines:

o.e.jdt.core.Signature {
  // returns the method signature (lower bound of parameters, upper
bound of return type)
  char[] unboundedMethodSignature(char[] methodSignature);

  // or
  char[] upperBound(char[] typeSignature);
  char[] lowerBound(char[] typeSignature);
}

-tom
_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-core-dev




Back to the top