Bug 153303 - IBinding.getAnnotations() returns array with null element
Summary: IBinding.getAnnotations() returns array with null element
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 10:33 EDT by Markus Keller CLA
Modified: 2006-09-18 10:18 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 2006-08-09 10:33:10 EDT
I20060807-2000

IBinding.getAnnotations() returns array with a null element when the annotation type could not be resolved. Expected: empty array.

Steps:
- In a 1.5 project without JUnit4 on the classpath, create CU (with compile errors):

package tst;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class Tester23 {
    @Test
    public void testComparison2( ) {
        assertEquals( "Gah", "Gooh" );
    }
}

- Set caret into "Gah" and press Ctrl+1.

java.lang.NullPointerException
	at org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor.isInsideJUnit4Test(JUnitQuickFixProcessor.java:164)
	at org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor.getAddAssertImportProposals(JUnitQuickFixProcessor.java:106)
	at org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor.getCorrections(JUnitQuickFixProcessor.java:93)
...
Comment 1 Olivier Thomann CLA 2006-08-14 17:42:17 EDT
Fixed and released in HEAD.
Added regression tests org.eclipse.jdt.core.tests.dom.ASTConverter15Test#test0223/0224/0225/0226
Comment 2 Olivier Thomann CLA 2006-08-15 13:56:18 EDT
Released for 3.3 M2.
Comment 3 Maxime Daniel CLA 2006-09-18 10:18:51 EDT
Verified for 3.3 M2 using build I20060918-0010.