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

Bug 317963

Summary: JAXB Externalized Metadata: GetMethod should be checked for zero input arguments, and non-void return type
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: David McCann <david.mccann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 354646    
Attachments:
Description Flags
Contains proposed fix + supporting test case none

Description David McCann CLA 2010-06-25 08:52:15 EDT
When we process get method in getPropertyPropertiesForClass in AnnotationsProcessor, we should only process ones that have exactly one input parameter, and a non-void return type.

More than likely the change will be required to the following line of code:

if ((next.getName().startsWith("get") && next.getName().length() > 3) || (next.getName().startsWith("is") && next.getName().length() > 2)) {
Comment 1 David McCann CLA 2010-10-05 10:54:02 EDT
(In reply to comment #0)
> When we process get method in getPropertyPropertiesForClass in
> AnnotationsProcessor, we should only process ones that have exactly one input
> parameter, and a non-void return type.
> 
> More than likely the change will be required to the following line of code:
> 
> if ((next.getName().startsWith("get") && next.getName().length() > 3) ||
> (next.getName().startsWith("is") && next.getName().length() > 2)) {

The get method should have zero arguments, and a non-void return type.
Comment 2 David McCann CLA 2010-10-05 12:00:16 EDT
Created attachment 180253 [details]
Contains proposed fix + supporting test case
Comment 3 David McCann CLA 2010-10-05 12:10:32 EDT
Reviewed by:  matt.macivor@oracle.com
Tests:  jaxb/xmlelement/XmlElementNamespaceTestCases; all unit tests pass as expected
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:05:20 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink