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

Bug 346498

Summary: NullPointerException with converterClass attribute specified for custom converter
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: GeneralAssignee: Brian Vosburgh <brian.vosburgh>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jolene.moffitt, neil.hauge
Version: unspecified   
Target Milestone: 3.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Stack Trace none

Description Nan Li CLA 2011-05-19 12:01:34 EDT
Build Identifier: I20110512-2000

Define a custom converter for an ID mapping like this:

    @Id
    @Convert("BALABA")  
    @Converter(converterClass = MyConv.class, name = "CONV")
    private int id;

Once saving the java source, the following NPE is thrown and prevents the validation messages from showing up in the Problem view. This problem happens no matter whether the converter class is valid or not.

java.lang.NullPointerException
	at org.eclipse.jpt.common.core.internal.utility.jdt.AbstractJDTType.types(AbstractJDTType.java:171)

Full stack trace is attached.

Reproducible: Always
Comment 1 Nan Li CLA 2011-05-19 12:02:49 EDT
Created attachment 196133 [details]
Stack Trace
Comment 2 Nan Li CLA 2011-05-19 12:15:49 EDT
Same problem exists when defining a custom converter at Java entity level. Custom converters defined in mapping file don't have such problem.
Comment 3 Neil Hauge CLA 2011-05-19 16:08:38 EDT
From my testing, and from discussion with Brian, this bug is a result of a proposed fix for bug 346005.  As such, I don't think it would qualify as a bug since it doesn't exist in any development stream.

Please let me know if this is incorrect.
Comment 4 Neil Hauge CLA 2011-05-19 16:16:42 EDT
(In reply to comment #3)
> From my testing, and from discussion with Brian, this bug is a result of a
> proposed fix for bug 346005.  As such, I don't think it would qualify as a bug
> since it doesn't exist in any development stream.
> 
> Please let me know if this is incorrect.

OK...I finally reproduced this exception.  I must not have had a converter class set previously.
Comment 5 Neil Hauge CLA 2011-05-24 14:45:24 EDT
This is fixed with the patch from bug 346535.
Comment 6 Neil Hauge CLA 2011-05-25 11:32:15 EDT
Fixed by patch from bug 346535.
Comment 7 Jolene Moffitt CLA 2011-07-06 10:40:50 EDT
Verified in Build R-3.3.0-20110607160810

Verified you can add custom converter(s) to id mapping without NPE errors.  See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0_RC3