You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "J.W. Janssen (JIRA)" <ji...@apache.org> on 2012/11/15 14:16:12 UTC

[jira] [Created] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

J.W. Janssen created FELIX-3757:
-----------------------------------

             Summary: MetaType AD.validate() ignored mandatory fields without min, max or optionValues
                 Key: FELIX-3757
                 URL: https://issues.apache.org/jira/browse/FELIX-3757
             Project: Felix
          Issue Type: Bug
          Components: Metatype Service
    Affects Versions:  metatype-1.0.6
            Reporter: J.W. Janssen


If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "J.W. Janssen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498704#comment-13498704 ] 

J.W. Janssen commented on FELIX-3757:
-------------------------------------

I've applied the correct code formatting rules (sorry about that) and applied your proposed fix for the min/max validation. 

The changes are in rev #1410279.

Thanks for reviewing my changes!

                
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>             Fix For: metatype-1.0.8
>
>         Attachments: FELIX-3757.patch
>
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "J.W. Janssen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

J.W. Janssen resolved FELIX-3757.
---------------------------------

    Resolution: Fixed
      Assignee: J.W. Janssen

Committed a fix + testcase in rev #1409877. 

Please review...
                
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "J.W. Janssen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

J.W. Janssen resolved FELIX-3757.
---------------------------------

    Resolution: Fixed
    
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>             Fix For: metatype-1.0.8
>
>         Attachments: FELIX-3757.patch
>
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-3757:
-------------------------------------

    Fix Version/s: metatype-1.0.8
    
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>             Fix For: metatype-1.0.8
>
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498708#comment-13498708 ] 

Felix Meschberger commented on FELIX-3757:
------------------------------------------

Thanks. test cases and CT now pass.
                
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>             Fix For: metatype-1.0.8
>
>         Attachments: FELIX-3757.patch
>
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-3757:
-------------------------------------

    Attachment: FELIX-3757.patch

Proposed patch.

Please also note that the formatting does not comply with the Felix formatting style: opening brackets are on the new line and we use spaces instead of tabs for indentation. Thanks. (my patch does not fix this for clarity)
                
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>             Fix For: metatype-1.0.8
>
>         Attachments: FELIX-3757.patch
>
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (FELIX-3757) MetaType AD.validate() ignored mandatory fields without min, max or optionValues

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reopened FELIX-3757:
--------------------------------------


Since you committed a single patch for three issues, I don't exactly know which part of the patch applies to which fix. So I just open this one..

After applying this patch, the OSGi CT fails for the following reasons:

(1) ADValidator.validateNumericValue does value.compareTo(Object) for min and max. Both min and max are Integer objects while the value may be any type extends Number. If value happens to not be Integer, this comparison fails with a ClassCastException.

Example failure:
>   java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
>           at java.lang.Long.compareTo(Long.java:50)
>           at org.apache.felix.metatype.ADValidator.validateNumericValue(ADValidator.java:302)

(2) Floating point number validation fails: ADValidator.validateNumericValue assumes the min and max values to be Integer values which is wrong. Instead the min and max values for numeric attributes is expected to be of the same type as the value type. Hence parsing those into an Integer is inherently wrong.

The fix to both issues is to actually parse the min and max values with the same parsing as parsing the value to be checked.
                
> MetaType AD.validate() ignored mandatory fields without min, max or optionValues
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-3757
>                 URL: https://issues.apache.org/jira/browse/FELIX-3757
>             Project: Felix
>          Issue Type: Bug
>          Components: Metatype Service
>    Affects Versions:  metatype-1.0.6
>            Reporter: J.W. Janssen
>            Assignee: J.W. Janssen
>             Fix For: metatype-1.0.8
>
>
> If an attribute is required, but does not define its min, max or optionValues parameters, the validate() regards absent data as valid.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira