Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 Build Identifier: It is worth clarifying the javadoc for ICompilationUnit? This is what it says now: WorkingCopyOwner org.eclipse.jdt.core.ICompilationUnit.getOwner() Returns the working copy owner of this working copy. Returns null if it is not a working copy or if it has no owner. Returns: WorkingCopyOwner the owner of this working copy or null Since: 3.0 It says it returns "null" if it has no owner which is deceptive since when ( isWorkingCopy() && getOwner()==null) == true that means it's a primary working copy owner. Reproducible: Always
Agree, could be clarified.
Created attachment 151872 [details] Proposed fix Would this make it clearer ?
I'm still confused by the text. What about: @return <tt>null</tt> if this <code>ICompilationUnit</code> is the primary working copy, or this <code>ICompilationUnit</code> is not a working copy, otherwise the <code>WorkingCopyOwner</code>. In the proposed text, it seems that null can have two meanings if it is a working copy.
Honestly, a new API method named isPrimaryWorkingCopy() seems like a good addition. It would return true if it is a working copy AND primary, false otherwise.
(In reply to comment #4) > Honestly, a new API method named isPrimaryWorkingCopy() seems like a good > addition. It would return true if it is a working copy AND primary, false > otherwise. I opened bug 294804 for this.
Created attachment 151940 [details] Proposed fix Here is the new patch based on last proposal.
Released for 3.6M4.
Verified for 3.6M4.