Skip to content

Commit

Permalink
revert adding list
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Oct 31, 2023
1 parent a89c3f9 commit b789f20
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions core/src/main/java/lucee/runtime/osgi/BundleInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public class BundleInfo implements Serializable {
private Map<String, Object> headers;

private Map<String, PackageDefinition> exportPackageAsMap;
private List<PackageDefinition> exportPackageAsList;
private static Map<String, BundleInfo> bundles = new HashMap<String, BundleInfo>();

public static BundleInfo getInstance(String id, InputStream is, boolean closeStream) throws IOException, BundleException {
Expand Down Expand Up @@ -163,12 +162,10 @@ public Collection<PackageDefinition> getExportPackageAsCollection() {
synchronized (this) {
if (exportPackageAsMap == null) {
if (StringUtil.isEmpty(exportPackage, true)) {
exportPackageAsList = new ArrayList<>();
return (exportPackageAsMap = new HashMap<>()).values();
}

exportPackageAsMap = new HashMap<>();
exportPackageAsList = new ArrayList<>();
int len = exportPackage.length();
char c;
boolean inline = false;
Expand All @@ -182,20 +179,18 @@ public Collection<PackageDefinition> getExportPackageAsCollection() {
}
else if (!inline && c == ',') {
pd = toPackageDefinition(sb.toString());
exportPackageAsList.add(pd);
exportPackageAsMap.put(pd.getName(), pd);

sb = new StringBuilder();
}
else sb.append(c);
}
pd = toPackageDefinition(sb.toString());
exportPackageAsList.add(pd);
exportPackageAsMap.put(pd.getName(), pd);
}
}
}
return exportPackageAsList; // exportPackageAsMap.values();
return exportPackageAsMap.values();
}

public boolean hasMatchingExportPackage(PackageQuery pq) {
Expand Down

0 comments on commit b789f20

Please sign in to comment.