Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323005

Summary: NPE in AnnotationContainerTools
Product: [WebTools] Dali JPA Tools Reporter: Dmitry Geraskov <geraskov>
Component: GeneralAssignee: Karen Butzke <karenfbutzke>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: karenfbutzke, neil.hauge
Version: unspecifiedFlags: neil.hauge: review+
Target Milestone: 2.3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch for 2.3 maintenance none

Description Dmitry Geraskov CLA 2010-08-18 06:13:04 EDT
Build Identifier: I20100608-0911

java.lang.NullPointerException
	at org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools.getNestedAstAnnotations(AnnotationContainerTools.java:139)
	at org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools.synchronize(AnnotationContainerTools.java:240)
	at org.eclipse.jpt.core.internal.resource.java.source.SourceBaseNamedQueryAnnotation.synchronizeWith(SourceBaseNamedQueryAnnotation.java:74)
	at org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools.synchronize(AnnotationContainerTools.java:247)
	at org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueriesAnnotation.synchronizeWith(SourceNamedQueriesAnnotation.java:52)
	at org.eclipse.jpt.core.internal.resource.java.source.SourcePersistentMember.addOrSyncAnnotation_(SourcePersistentMember.java:349)

Reproducible: Always

Steps to Reproduce:
The NPE appears for code @NamedQueries(@NamedQuer)
Comment 1 Karen Butzke CLA 2010-08-23 11:49:02 EDT
Created attachment 177232 [details]
proposed patch for 2.3 maintenance

A simple null check and a test case specific to NamedQueries annotation
Comment 2 Karen Butzke CLA 2010-08-23 13:09:39 EDT
fixed for 2.3.2