Bug 129560 - [spec] Questionable javadoc for IJavaElement#isStructureKnown()
Summary: [spec] Questionable javadoc for IJavaElement#isStructureKnown()
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 08:31 EST by Markus Keller CLA
Modified: 2007-08-03 10:52 EDT (History)
0 users

See Also:


Attachments
Proposed fix (1.19 KB, patch)
2007-07-03 10:38 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-02-27 08:31:43 EST
I20060223-1656

The javadoc of IJavaElement#isStructureKnown() seems to be somewhat outdated. According to bug 106603 comment 3, isStructureKnown() only seems to be implemented for ICompilationUnits and returns true for all other cases. AFAICS, it returns false iff a syntax error was detected while parsing.

It also says: "If the structure of an element is unknown, navigations will return reasonable defaults. For example, <code>getChildren</code> will return an empty collection." But if you e.g. take the CU ...
	class Test {
		void m() {
			int err
		}
	}
... then ICompilationUnit#isStructureKnown() is false, but #getChildren() is not empty.

The javadoc should tell that it just checks for syntax errors in a CU and it should not repudiate the existence of the CU's children.
Comment 1 Jerome Lanneluc CLA 2007-07-03 10:38:10 EDT
Created attachment 72956 [details]
Proposed fix
Comment 2 Jerome Lanneluc CLA 2007-07-03 10:39:35 EDT
Fix released for 3.4M1 in HEAD.
Comment 3 Frederic Fusier CLA 2007-08-03 10:52:17 EDT
Verified for 3.4M1 using build I20070802-0800.