tjwatson commented on code in PR #75:
URL: https://github.com/apache/felix-atomos/pull/75#discussion_r1364532935
##########
atomos/src/main/java/org/apache/felix/atomos/impl/modules/AtomosModules.java:
##########
@@ -527,14 +527,28 @@ private void generateHeaders(Map<String, String> headers,
Module m)
// only do exports for non bundle modules
// real OSGi bundles already have good export capabilities
StringBuilder exportPackageHeader = new StringBuilder();
- desc.exports().stream().sorted().forEach((exports) -> {
- if (exportPackageHeader.length() > 0)
- {
- exportPackageHeader.append(", ");
- }
- exportPackageHeader.append(exports.source());
- // TODO map targets to x-friends directive?
- });
+
+ // ModuleDescriptor.exports() is empty for an automatic
module, which is different from
+ // JPMS at runtime where all packages in the automatic module
are exported
+ if (desc.isAutomatic()) {
+ desc.packages().stream().sorted().forEach((packages) -> {
+ if (exportPackageHeader.length() > 0)
+ {
+ exportPackageHeader.append(", ");
+ }
+ exportPackageHeader.append(packages);
+ });
+ }
+ else {
+ desc.exports().stream().sorted().forEach((exports) -> {
Review Comment:
The original variable name was poor (even though I wrote it). I think we
should take the opportunity to change it to something like `exported`.
Similarly I suggest we change the variable name `packages` to `packageName`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]