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

@Property annotation raises exceptions on longValue=0L use

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • maven-scr-plugin-1.7.2, maven-scr-plugin-1.7.4, scr annotations 1.6.0
    • SCR Tooling
    • None

    Description

      When putting longValue =0L I get an exception on build, note it MUST be '0L'. Exceptions does not hapen when using '0' ( without the long modifier ) or 1234567 or 1234567L

      It seems problem occurs only with the '0L' value, as '00L' and '00000L' work fine ( I have tested the values '0', '0L', '00L','00000L', '1234567' and '1234567L' , and, after that, '0l', 00l' ( one and two zeroes, lowercase L ) and the only ones which do not work are '0L' and '0l', all the other ones build flawlessly ).

      The contens of metatype.xml for the property are correct: ( with 00l ):

      <AD id="reload.period" type="Long" default="0" name="Auto reload period" description="Sleep interval between reloading scans."/>

      Included below are captures for 0L and 0, results for the other ones are the same.

      If needed I can try to strip the build to a minimum and send it.

      ----- with L modifier, raises exceptions: ------------

      @Property(label = "Auto reload period",
      description = "Sleep interval between reloading scans.",longValue=0L)
      public final static String RELOAD_PERIOD = "reload.period";

      leads to:

      $ mvn clean install
      [INFO] Scanning for projects...
      [WARNING] POM for 'biz.aQute:bndlib:pom:1.43.0:runtime' is invalid.

      Its dependencies (if any) will NOT be available to the current build.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building numclass-cmtport
      [INFO] task-segment: [clean, install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [clean:clean

      {execution: default-clean}

      ]
      [INFO] Deleting file set: /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target (included: [**], excluded: [])
      [INFO] [resources:resources

      {execution: default-resources}

      ]
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO] [compiler:compile

      {execution: default-compile}

      ]
      [INFO] Compiling 6 source files to /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/classes
      [INFO] [scr:scr

      {execution: generate-scr-scrdescriptor}

      ]
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] For input string: ""
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NumberFormatException: For input string: ""
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Long.parseLong(Long.java:431)
      at com.thoughtworks.qdox.parser.impl.Parser.toLong(Parser.java:1180)
      at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1784)
      at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:999)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:353)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:381)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:377)
      at org.apache.felix.scrplugin.JavaClassDescriptorManager.getSources(JavaClassDescriptorManager.java:115)
      at org.apache.felix.scrplugin.JavaClassDescriptorManager.getJavaClassesFromSources(JavaClassDescriptorManager.java:459)
      at org.apache.felix.scrplugin.JavaClassDescriptorManager.getSourceDescriptions(JavaClassDescriptorManager.java:361)
      at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:234)
      at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:184)
      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)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 2 seconds
      [INFO] Finished at: Fri Nov 18 13:00:44 CET 2011
      [INFO] Final Memory: 23M/296M
      [INFO] ------------------------------------------------------------------------

      ---------
      --------- without the L modifer ( no problems )--------------

      @Property(label = "Auto reload period",
      description = "Sleep interval between reloading scans.",longValue=0)
      public final static String RELOAD_PERIOD = "reload.period";

      leads to:

      $ mvn clean install
      [INFO] Scanning for projects...
      [WARNING] POM for 'biz.aQute:bndlib:pom:1.43.0:runtime' is invalid.

      Its dependencies (if any) will NOT be available to the current build.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building numclass-cmtport
      [INFO] task-segment: [clean, install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [clean:clean

      {execution: default-clean}

      ]
      [INFO] Deleting file set: /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target (included: [**], excluded: [])
      [INFO] [resources:resources

      {execution: default-resources}

      ]
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO] [compiler:compile

      {execution: default-compile}

      ]
      [INFO] Compiling 6 source files to /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/classes
      [INFO] [scr:scr

      {execution: generate-scr-scrdescriptor}

      ]
      [INFO] Generating 2 MetaType Descriptors to /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/scr-plugin-generated/OSGI-INF/metatype/metatype.xml
      [INFO] Writing abstract service descriptor /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/scr-plugin-generated/OSGI-INF/scr-plugin/scrinfo.xml with 1 entries.
      [INFO] Generating 1 Service Component Descriptors to /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/scr-plugin-generated/OSGI-INF/serviceComponents.xml
      [INFO] [resources:testResources

      {execution: default-testResources}

      ]
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 3 resources
      [INFO] [compiler:testCompile

      {execution: default-testCompile}

      ]
      [INFO] Compiling 6 source files to /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/test-classes
      [INFO] [surefire:test

      {execution: default-test}

      ]
      [INFO] Surefire report directory: /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/surefire-reports

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running TestSuite
      Nov 18, 2011 1:02:22 PM com.peoplecall.numclass.cmtport.CmtPortClassifier loadCmtData
      WARNING: Error loading cmt data from ESTO NO EXISTE NI PATRAS previous contents kept.
      Nov 18, 2011 1:02:22 PM com.peoplecall.numclass.cmtport.CmtPortClassifier loadPortData
      WARNING: Error loading porting data from ESTO NO EXISTE NI PATRAS previous contents kept.
      Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.558 sec

      Results :

      Tests run: 27, Failures: 0, Errors: 0, Skipped: 0

      [INFO] [bundle:bundle

      {execution: default-bundle}

      ]
      [INFO] [install:install

      {execution: default-install}

      ]
      [INFO] Installing /home/folarte/NetBeansProjects/numclass/numclass-cmtport/target/numclass-cmtport-1.0-SNAPSHOT.jar to /home/folarte/.m2/repository/com/peoplecall/numclass-cmtport/1.0-SNAPSHOT/numclass-cmtport-1.0-SNAPSHOT.jar
      [INFO] [bundle:install

      {execution: default-install}

      ]
      [INFO] Installing com/peoplecall/numclass-cmtport/1.0-SNAPSHOT/numclass-cmtport-1.0-SNAPSHOT.jar
      [INFO] Writing OBR metadata
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4 seconds
      [INFO] Finished at: Fri Nov 18 13:02:23 CET 2011
      [INFO] Final Memory: 28M/247M
      [INFO] ------------------------------------------------------------------------

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            folarte Francisco Olarte
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: