From: SourceForge.net <no...@so...> - 2008-09-05 04:05:34
|
Feature Requests item #2094343, was opened at 2008-09-05 04:05 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=365278&aid=2094343&group_id=15278 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Filter.describe is unnecessary; should be toString Initial Comment: Why introduce a new method like describe, when there is a standard Java method for this purpose called toString? Using toString is superior in general because Java knows, for instance, to automatically invoke it in contexts where a String is needed. By the way, if you are worried about forcing subclasses to reimplement toString in a meaningful way and NOT rely on the version from Object, note that in Java an abstract class can declare public abstract String toString(); to achieve this goal. For instance: public abstract class ForcesSubclassesToReimplToString { public abstract String toString(); } public class Subclass extends ForcesSubclassesToReimplToString { public String toString() { return "Subclass.toString works...";} } will NOT compile if you comment out Subclass 's toString reimplementation. This trick does not, unfortunately, work with interfaces. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=365278&aid=2094343&group_id=15278 |