| Summary: | NPE entering special characters to customizer class combo | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Nan Li <nan.n.li> | ||||||
| Component: | General | Assignee: | Nan Li <nan.n.li> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | jolene.moffitt, neil.hauge | ||||||
| Version: | unspecified | Flags: | neil.hauge:
review+
|
||||||
| Target Milestone: | 3.1 M1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Nan Li
Created attachment 199585 [details]
stack trace
Created attachment 199759 [details]
Proposed Patch
The change for JavaEclipseLinkCustomizer is not related to this bug. It is for fixing NPE when the customizer class cannot be solved.
(In reply to comment #2) > Created attachment 199759 [details] > Proposed Patch > > The change for JavaEclipseLinkCustomizer is not related to this bug. It is for > fixing NPE when the customizer class cannot be solved. The fix for the NPE in JavaEclipseLinkCustomizer appears to be in the wrong place. Instead of avoiding this here, we should be avoiding the NPE in JDTTools.classHasPublicZeroArgConstructor(). If the resolved type is null (because the user has mistyped the class name) it should return false. Actually, we shouldn't even be getting to this check, since we should first be validating to see whether the class exists. Since the compiler is going to do this for us, I suppose the changes in JavaEclipseLinkCustomizer are still valid (to avoid going through unnecessary logic). We should just add a null check to JDTTools.classHasPublicZeroArgConstructor() in addition to the current patch. I will commit the patch and make the additional null check. Patch committed with some minor additions to head. Verified in Build I-3.4.0-20110826171354 Verified that the NPE does not appear if you enter period(.), comma(,) or other special characters into the Customizer class field for the entity in the JPA Details pane. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.1_M1 |