Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
ctron/package-drone#144 catch the case of an illegal OSGi version
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Mar 17, 2016
1 parent 4c18918 commit 44c8cd4
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ else if ( this.file != null )

result.setId ( id.getValue () );
result.setSingleton ( Boolean.parseBoolean ( id.getAttributes ().get ( "singleton" ) ) );
result.setVersion ( new Version ( version.getValue () ) );

try
{
result.setVersion ( new Version ( version.getValue () ) );
}
catch ( final Exception e )
{
throw new IllegalArgumentException ( String.format ( "Illegal OSGi version: %s", version.getValue () ) );
}

result.setName ( ma.getValue ( Constants.BUNDLE_NAME ) );
result.setVendor ( ma.getValue ( Constants.BUNDLE_VENDOR ) );
Expand Down

0 comments on commit 44c8cd4

Please sign in to comment.