Bug 120865 - ICompilationUnit.findPrimaryType(..) should not throw internal AFE
Summary: ICompilationUnit.findPrimaryType(..) should not throw internal AFE
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-14 09:09 EST by Markus Keller CLA
Modified: 2006-08-07 05:30 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-12-14 09:09:01 EST
I20051213-0010

From bug 120570.

ICompilationUnit.findPrimaryType(..) should not throw an internal AFE it the target CU has an invalid CU name. Rather, it should return null.

org.eclipse.jdt.internal.core.Assert$AssertionFailedException: Assertion failed; The source type has an invalid name: A.B
at org.eclipse.jdt.internal.core.Assert.isTrue(Assert.java:89)
at org.eclipse.jdt.internal.core.SourceType.<init>(SourceType.java:43)
at org.eclipse.jdt.internal.core.CompilationUnit.getType(CompilationUnit.java:831)
at org.eclipse.jdt.internal.core.CompilationUnit.findPrimaryType(CompilationUnit.java:531)
...
Comment 1 Jerome Lanneluc CLA 2005-12-14 10:42:51 EST
Good fine ! Thanks.

Need to check all senders of Util.getNameWithoutJavaLikeExtension(String) ...
Comment 2 Jerome Lanneluc CLA 2006-06-28 04:50:09 EDT
Changed SourceType constructor to not throw an IAE any longer and verified that all senders of Util.getNameWithoutJavaLikeExtension(String) are behaving correctly.
Added regression test CompilationUnitTests#testFindPrimaryType2().
Released for 3.3 M1 in HEAD.
Comment 3 Frederic Fusier CLA 2006-08-07 05:30:54 EDT
Verified for 3.3 M1 using build I20060807-0010