Skip to content

Commit

Permalink
partially invert "improve osgi file handling"
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jul 22, 2024
1 parent 036dcc0 commit 75305bf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions core/src/main/java/lucee/runtime/osgi/OSGiUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,39 @@ private static BundleFile _getBundleFile(CFMLEngineFactory factory, BundleRange
if (mbf != null) {
return improveFileName(bd, mbf);
}

List<Resource> children = listFiles(dir, addional, JAR_EXT_FILTER);

// now we check all jar files
{

// now we check by Manifest comparsion, name not necessary reflect the correct bundle info
BundleFile bf;
for (boolean checkBundleRange: checkBundleRanges) {
mbf = null;
for (Resource child: children) {
if (checkBundleRange && !new Filter(bundleRange).accept(child.getName())) continue;
match = child;
bf = BundleFile.getInstance(child);
if (bf.isBundle()) {
if (bf.getSymbolicName().equals(bundleRange.getName())) {
if (bundleRange.matches(bf)) {
if (mbf == null || OSGiUtil.isNewerThan(bf.getVersion(), mbf.getVersion())) mbf = bf;
}
else {
if (versionsFound != null) {
if (versionsFound.length() > 0) versionsFound.append(", ");
versionsFound.append(bf.getVersionAsString());
}
}
}
}
}
if (mbf != null) {
return improveFileName(factory.getBundleDirectory(), mbf);
}
}
}
/*
* List<Resource> children = listFiles(dir, addional, JAR_EXT_FILTER);
*
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.1.1.51-BETA"/>
<property name="version" value="6.1.1.51-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.1.1.51-BETA</version>
<version>6.1.1.51-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 75305bf

Please sign in to comment.