Skip to content

Commit

Permalink
Merge pull request #5670 from pkriens/master
Browse files Browse the repository at this point in the history
Remove space from version before cleanup
  • Loading branch information
pkriens authored May 23, 2023
2 parents 63bd14f + dd21e71 commit 107802a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions biz.aQute.bndlib.tests/test/test/BuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,31 @@
@SuppressWarnings("resource")
public class BuilderTest {

/**
* Test version with space
*
* @throws Exception
*/

@Test
public void testVersionWithSpace() throws Exception {
try (Builder outer = new Builder()) {
try (Builder inner = new Builder()) {
inner.addClasspath(IO.getFile("jar/osgi.core-4.3.0.jar"));
inner.setProperty("Export-Package", "org.osgi.framework;version=\"1.6.0 \"");
inner.setProperty("-includepackage", "org.osgi.framework");
Jar jar = inner.build();
assertThat(inner.check()).isTrue();

outer.addClasspath(jar);
outer.addClasspath(IO.getFile("jar/osgi.core-4.3.0.jar"));
outer.setProperty("-includepackage", "org.osgi.service.packageadmin");
outer.build();
assertThat(outer.check()).isTrue();
}
}
}

/**
* [builder] Access to information generated during doExpand() #5130
*
Expand Down
1 change: 1 addition & 0 deletions biz.aQute.bndlib/src/aQute/bnd/osgi/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2750,6 +2750,7 @@ static public String cleanupVersion(String version) {
if (version == null)
return "0";

version = Strings.trim(version);
Matcher m = Verifier.VERSIONRANGE.matcher(version);

if (m.matches()) {
Expand Down

0 comments on commit 107802a

Please sign in to comment.