Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion bug (different behavior between java6 and java7) #71

Closed
lviggiano opened this issue Feb 25, 2014 · 0 comments
Closed

Conversion bug (different behavior between java6 and java7) #71

lviggiano opened this issue Feb 25, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@lviggiano
Copy link
Collaborator

    public static interface PrimitiveTypesConfig extends Config {
        @DefaultValue("invalid")
        Integer invalid();
    }

    @Test(expected = UnsupportedOperationException.class)
    public void testInvalid() {
        PrimitiveTypesConfig config = ConfigFactory.create(PrimitiveTypesConfig.class);
        config.invalid();
    }

is raising NumberFormatException on java 7:

java.lang.NumberFormatException: For input string: "invalid"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:492)
        at java.lang.Integer.valueOf(Integer.java:556)
        at java.lang.Integer.decode(Integer.java:984)
        at com.sun.beans.editors.IntegerEditor.setAsText(IntegerEditor.java:39)
        at org.aeonbits.owner.Converters$4.tryConvert(Converters.java)

is raising UnsupportedOperationException on java 6

java.lang.UnsupportedOperationException: Cannot convert 'invalid' to java.lang.Integer
    at org.aeonbits.owner.Util.unsupported(Util.java:119)
    at org.aeonbits.owner.Converters.unsupportedConversion(Converters.java:239)
    at org.aeonbits.owner.Converters.access$200(Converters.java:39)
    at org.aeonbits.owner.Converters$10.tryConvert(Converters.java)
@lviggiano lviggiano added this to the 1.0.6 milestone Feb 25, 2014
@lviggiano lviggiano added the bug label Feb 25, 2014
@lviggiano lviggiano self-assigned this Feb 25, 2014
lviggiano pushed a commit that referenced this issue Feb 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant