Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2704

@Property(cardinality=Integer.MAX_Int, ...) causes java.lang.NumberFormatException

    Details

      Description

      @Property(cardinality= seems to take the value as String and try to parse it.

      I have:

      @Property(cardinality=Integer.MAX_INT, label="hosts", description="a list of hosts", value={})
      private static final String PROP_HOSTS = "com.mycompany.hosts";

      and, mvn clean package gives me:

      java.lang.NumberFormatException: For input string: "Integer.MIN_VALUE"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:449)
      at java.lang.Integer.valueOf(Integer.java:554)
      at org.apache.felix.scrplugin.tags.annotation.defaulttag.Util.getIntValue(Util.java:59)
      at org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag$1.cardinality(PropertyTag.java:47)
      at org.apache.felix.scrplugin.tags.annotation.defaulttag.PropertyTag.createNamedParameterMap(PropertyTag.java:237)
      at org.apache.felix.scrplugin.tags.annotation.defaulttag.AbstractTag.getNamedParameterMap(AbstractTag.java:122)
      at org.apache.felix.scrplugin.tags.annotation.defaulttag.AbstractTag.getNamedParameter(AbstractTag.java:54)
      at org.apache.felix.scrplugin.helper.PropertyHandler.getPropertyName(PropertyHandler.java:210)
      at org.apache.felix.scrplugin.helper.PropertyHandler.testProperty(PropertyHandler.java:314)
      at org.apache.felix.scrplugin.helper.PropertyHandler.handleField(PropertyHandler.java:335)
      at org.apache.felix.scrplugin.SCRDescriptorGenerator.createComponent(SCRDescriptorGenerator.java:522)
      at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:274)
      at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:166)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

        Activity

        Hide
        cziegeler Carsten Ziegeler added a comment -

        Fixed in revision 1073041 - Integer.MAX_VALUE and Integer.MIN_VALUE are now both supported

        Show
        cziegeler Carsten Ziegeler added a comment - Fixed in revision 1073041 - Integer.MAX_VALUE and Integer.MIN_VALUE are now both supported

          People

          • Assignee:
            cziegeler Carsten Ziegeler
            Reporter:
            saml Sam Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development