On Thu, 2002-02-07 at 18:51, Jason Boehle wrote:
> Find usages on a toString() method of a class does not find implicit usages
> (ie. System.out.println(obj);), only explicit usages (ie.
> System.out.println(obj.toString());).

Well, technically it isn't really an implicit usage...  It's just that
when you call println(obj) in a PrintStream, it calls
String.valueOf(obj), which in turn returns obj.toString().

It might be useful to add a special case for it but then you might also
want that for PrintWriters and various other methods that call other
methods that call toString().  And for operands of the "+" operator,
which result in implicit calls to StringBuffer.append(obj) ->
String.valueOf(obj) -> obj.toString().

I wonder if this could be extended to a generic feature that searches
for all places where a certain type might be used as argument to a
specific method.  That is, searching for all places where
PrintStream.println() might be called with a MyType object as an
argument.  Would this make sense?  I'm too tired right now...



_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to