You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2009/07/30 20:23:15 UTC

[jira] Resolved: (FELIX-1433) java.lang.NumberFormatException in Bundle-Version (org.osgi.framework.Version) due to trailing whitespace

     [ https://issues.apache.org/jira/browse/FELIX-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall resolved FELIX-1433.
------------------------------------

    Resolution: Fixed

Applied patch. Please close if satisfied. Thanks!

> java.lang.NumberFormatException in Bundle-Version (org.osgi.framework.Version) due to trailing whitespace
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1433
>                 URL: https://issues.apache.org/jira/browse/FELIX-1433
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR)
>    Affects Versions: bundlerepository-1.4.0
>         Environment: Linux
>            Reporter: Dustin Schultz
>            Assignee: Richard S. Hall
>            Priority: Trivial
>             Fix For: bundlerepository-1.6.0
>
>         Attachments: FELIX-1433.patch
>
>
> Adding an extra space after a version causes a NumberFormatException
> i.e. Bundle-Version: 1.0.0<space>
> ERROR: EventDispatcher: Error during dispatch.
> (java.lang.NumberFormatException: For input string: "0 ")
> java.lang.NumberFormatException: For input string: "0 "
>         at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>         at java.lang.Integer.parseInt(Integer.java:458)
>         at java.lang.Integer.parseInt(Integer.java:499)
>         at org.osgi.framework.Version.<init>(Version.java:136)
>         at
> org.apache.felix.bundlerepository.ResourceImpl.put(ResourceImpl.java:204)
>         at
> org.apache.felix.bundlerepository.LocalRepositoryImpl$LocalResourceImpl.convertAttributesToProperties(LocalRepositoryImpl.java:302)
>         at
> org.apache.felix.bundlerepository.LocalRepositoryImpl$LocalResourceImpl.initialize(LocalRepositoryImpl.java:203)
>         at
> org.apache.felix.bundlerepository.LocalRepositoryImpl$LocalResourceImpl.<init>(LocalRepositoryImpl.java:190)
>         at
> org.apache.felix.bundlerepository.LocalRepositoryImpl$LocalResourceImpl.<init>(LocalRepositoryImpl.java:182)
>         at
> org.apache.felix.bundlerepository.LocalRepositoryImpl.addBundle(LocalRepositoryImpl.java:104)
>         at
> org.apache.felix.bundlerepository.LocalRepositoryImpl.bundleChanged(LocalRepositoryImpl.java:65)
>         at
> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:771)
>         at
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:700)
>         at
> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)
>         at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3418)
>         at org.apache.felix.framework.Felix.installBundle(Felix.java:2247)
>         at org.apache.felix.framework.Felix.installBundle(Felix.java:2026)
>         at
> org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:130)
>         at
> org.apache.felix.shell.impl.InstallCommandImpl.install(InstallCommandImpl.java:104)
>         at
> org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:100)
>         at
> org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:291)
>         at
> org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:177)
>         at java.lang.Thread.run(Thread.java:619)
> Bug filed with OSGi here:
> https://www.osgi.org/bugzilla/show_bug.cgi?id=55
> Comments From BJ Hargrave:
> The String constructor for Version does not tolerate whitespace. They should
> use the static parseVersion method which will trim whitespace method before
> parsing.
> From the Version(String) javadoc:
>          * There must be no whitespace in version.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.