Bug 120865

Summary: ICompilationUnit.findPrimaryType(..) should not throw internal AFE
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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