You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2020/02/24 14:06:52 UTC
[sling-org-apache-sling-feature-io] branch master updated:
SLING-8676 : Prototype does not allow to remove requirements and
capabilities
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-io.git
The following commit(s) were added to refs/heads/master by this push:
new da153c7 SLING-8676 : Prototype does not allow to remove requirements and capabilities
da153c7 is described below
commit da153c756e1b13f59c972fd45e1637108cf6c3e0
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 24 15:06:37 2020 +0100
SLING-8676 : Prototype does not allow to remove requirements and capabilities
---
src/main/java/org/apache/sling/feature/io/json/JSONReaderBase.java | 2 ++
src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/feature/io/json/JSONReaderBase.java b/src/main/java/org/apache/sling/feature/io/json/JSONReaderBase.java
index c1be04e..679b1f1 100644
--- a/src/main/java/org/apache/sling/feature/io/json/JSONReaderBase.java
+++ b/src/main/java/org/apache/sling/feature/io/json/JSONReaderBase.java
@@ -577,6 +577,8 @@ abstract class JSONReaderBase {
}
}
}
+ readRequirements(removalObj, prototype.getRequirementRemovals());
+ readCapabilities(removalObj, prototype.getCapabilityRemovals());
}
}
diff --git a/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java b/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
index b74a4db..9d17744 100644
--- a/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
+++ b/src/main/java/org/apache/sling/feature/io/json/JSONWriterBase.java
@@ -218,7 +218,9 @@ abstract class JSONWriterBase {
if ( inc.getArtifactExtensionRemovals().isEmpty()
&& inc.getBundleRemovals().isEmpty()
&& inc.getConfigurationRemovals().isEmpty()
- && inc.getFrameworkPropertiesRemovals().isEmpty() ) {
+ && inc.getFrameworkPropertiesRemovals().isEmpty()
+ && inc.getRequirementRemovals().isEmpty()
+ && inc.getCapabilityRemovals().isEmpty() ) {
generator.write(JSONConstants.FEATURE_PROTOTYPE, inc.getId().toMvnId());
} else {
@@ -248,6 +250,9 @@ abstract class JSONWriterBase {
writeList(generator, JSONConstants.FEATURE_BUNDLES, inc.getBundleRemovals());
writeList(generator, JSONConstants.FEATURE_FRAMEWORK_PROPERTIES, inc.getFrameworkPropertiesRemovals());
+ writeRequirements(generator, inc.getRequirementRemovals());
+ writeCapabilities(generator, inc.getCapabilityRemovals());
+
generator.writeEnd().writeEnd();
}
}