[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2217) Array Index Out of Bounds in ClassFieldInspector with certain method signatures

Justin Waugh (JIRA) jira-events at lists.jboss.org
Thu Jul 23 15:23:29 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBRULES-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Waugh updated JBRULES-2217:
----------------------------------

    Description: 
If a class has a method named setXXX but is not a traditional bean method, (particularly that it does not have a single parameter and returns a value) an ArrayOutOfBoundsException will be thrown during class processing from ClassFieldInspector.storeGetterSetter (line 261).  This is because in ClassFieldInspector.processClassWithoutByteCode() it improperly detects the method as being a getter, because it does not filter by method name prefix when trying to process get/is methods, but uses the common method ClassFieldInspector.addToMapping() to handle the method. 

an example problem method name would be:

public boolean setDefaultValueAndCheckValidity();

Granted, methods like that might not be ideal programming style, but shouldn't break the processor





  was:
If a class has a method named setXXX but is not a traditional bean method, (particularly that it does not have a single parameter) an ArrayOutOfBoundsException will be thrown during class processing from ClassFieldInspector.storeGetterSetter (line 261).  This is because in ClassFieldInspector.processClassWithoutByteCode() it does not filter by method name prefix when trying to process get/is methods, but uses the common method ClassFieldInspector.addToMapping() to handle the method.

an example problem method name would be:

public void setTimestampFromCurrentTime();







> Array Index Out of Bounds in ClassFieldInspector with certain method signatures
> -------------------------------------------------------------------------------
>
>                 Key: JBRULES-2217
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2217
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 5.0.1.FINAL
>         Environment: JBOSS 4.0.5, Windows Server 2003
>            Reporter: Justin Waugh
>            Assignee: Mark Proctor
>
> If a class has a method named setXXX but is not a traditional bean method, (particularly that it does not have a single parameter and returns a value) an ArrayOutOfBoundsException will be thrown during class processing from ClassFieldInspector.storeGetterSetter (line 261).  This is because in ClassFieldInspector.processClassWithoutByteCode() it improperly detects the method as being a getter, because it does not filter by method name prefix when trying to process get/is methods, but uses the common method ClassFieldInspector.addToMapping() to handle the method. 
> an example problem method name would be:
> public boolean setDefaultValueAndCheckValidity();
> Granted, methods like that might not be ideal programming style, but shouldn't break the processor

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list