You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by tj...@apache.org on 2020/09/16 14:55:05 UTC
[felix-atomos] branch master updated: Sort the bundles installed by
default and exports from modules
This is an automated email from the ASF dual-hosted git repository.
tjwatson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-atomos.git
The following commit(s) were added to refs/heads/master by this push:
new 4e8ec17 Sort the bundles installed by default and exports from modules
new 1115f28 Merge pull request #34 from tjwatson/sorting
4e8ec17 is described below
commit 4e8ec1731ca5c6ca0f0ae96e460c008b904c9fcd
Author: Thomas Watson <tj...@us.ibm.com>
AuthorDate: Wed Sep 16 09:26:02 2020 -0500
Sort the bundles installed by default and exports from modules
To make it easier to observe the list of bundles installed by default
and the packages exported by modules this changes the order of both to
be sorted by name.
---
.../org/apache/felix/atomos/impl/runtime/base/AtomosRuntimeBase.java | 5 +++--
.../felix/atomos/impl/runtime/modules/ConnectContentModule.java | 5 ++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/base/AtomosRuntimeBase.java b/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/base/AtomosRuntimeBase.java
index df79a5e..9e8cf77 100644
--- a/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/base/AtomosRuntimeBase.java
+++ b/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/base/AtomosRuntimeBase.java
@@ -1593,7 +1593,7 @@ public abstract class AtomosRuntimeBase implements AtomosRuntime, SynchronousBun
{
debug("Installing Atomos content.");
List<Bundle> bundles = new ArrayList<>();
- for (AtomosContent atomosContent : atomosLayer.getAtomosContents())
+ atomosLayer.getAtomosContents().stream().sorted().forEach((atomosContent) -> //
{
if (getBundle(atomosContent) == null)
{
@@ -1612,7 +1612,8 @@ public abstract class AtomosRuntimeBase implements AtomosRuntime, SynchronousBun
e.getMessage());
}
}
- }
+ });
+
if (startBundles)
{
for (Bundle b : bundles)
diff --git a/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/modules/ConnectContentModule.java b/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/modules/ConnectContentModule.java
index 02ca86f..d9bd842 100644
--- a/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/modules/ConnectContentModule.java
+++ b/atomos.runtime/src/main/java/org/apache/felix/atomos/impl/runtime/modules/ConnectContentModule.java
@@ -17,7 +17,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ModuleDescriptor.Provides;
import java.lang.module.ModuleDescriptor.Requires;
import java.lang.module.ModuleReader;
@@ -181,7 +180,7 @@ public class ConnectContentModule implements ConnectContent
// only do exports for non bundle modules
// real OSGi bundles already have good export capabilities
StringBuilder exportPackageHeader = new StringBuilder();
- for (Exports exports : desc.exports())
+ desc.exports().stream().sorted().forEach((exports) ->
{
if (exportPackageHeader.length() > 0)
{
@@ -189,7 +188,7 @@ public class ConnectContentModule implements ConnectContent
}
exportPackageHeader.append(exports.source());
// TODO map targets to x-friends directive?
- }
+ });
if (exportPackageHeader.length() > 0)
{
result.put(Constants.EXPORT_PACKAGE, exportPackageHeader.toString());