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 4b84314 Remove unuse method
4b84314 is described below
commit 4b84314e3701442b51da6e59142e9bb909b29b79
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Mon Oct 1 12:03:06 2018 +0200
Remove unuse method
---
.../sling/feature/io/json/FeatureJSONReader.java | 40 ++++------------------
1 file changed, 6 insertions(+), 34 deletions(-)
diff --git
a/src/main/java/org/apache/sling/feature/io/json/FeatureJSONReader.java
b/src/main/java/org/apache/sling/feature/io/json/FeatureJSONReader.java
index 27d4e29..fde7534 100644
--- a/src/main/java/org/apache/sling/feature/io/json/FeatureJSONReader.java
+++ b/src/main/java/org/apache/sling/feature/io/json/FeatureJSONReader.java
@@ -52,25 +52,8 @@ public class FeatureJSONReader extends JSONReaderBase {
*/
public static Feature read(final Reader reader, final String location)
throws IOException {
- return read(reader, null, location);
- }
-
- /**
- * Read a new feature from the reader
- * The reader is not closed. It is up to the caller to close the reader.
- *
- * @param reader The reader for the feature
- * @param providedId Optional artifact id
- * @param location Optional location
- * @return The read feature
- * @throws IOException If an IO errors occurs or the JSON is invalid.
- */
- public static Feature read(final Reader reader,
- final ArtifactId providedId,
- final String location)
- throws IOException {
try {
- final FeatureJSONReader mr = new FeatureJSONReader(providedId,
location);
+ final FeatureJSONReader mr = new FeatureJSONReader(location);
return mr.readFeature(reader);
} catch (final IllegalStateException | IllegalArgumentException e) {
throw new IOException(e);
@@ -80,17 +63,12 @@ public class FeatureJSONReader extends JSONReaderBase {
/** The read feature. */
private Feature feature;
- /** The provided id. */
- private final ArtifactId providedId;
-
/**
* Private constructor
- * @param pId Optional id
* @param location Optional location
*/
- FeatureJSONReader(final ArtifactId pId, final String location) {
+ FeatureJSONReader(final String location) {
super(location);
- this.providedId = pId;
}
/**
@@ -106,18 +84,12 @@ public class FeatureJSONReader extends JSONReaderBase {
checkModelVersion(map);
- final ArtifactId fId;
if ( !map.containsKey(JSONConstants.FEATURE_ID) ) {
- if ( this.providedId == null ) {
- throw new IOException(this.exceptionPrefix + "Feature id is
missing");
- }
- fId = this.providedId;
- } else {
- final Object idObj = map.get(JSONConstants.FEATURE_ID);
- checkType(JSONConstants.FEATURE_ID, idObj, String.class);
- fId = ArtifactId.parse(idObj.toString());
+ throw new IOException(this.exceptionPrefix + "Feature id is
missing");
}
- this.feature = new Feature(fId);
+ final Object idObj = map.get(JSONConstants.FEATURE_ID);
+ checkType(JSONConstants.FEATURE_ID, idObj, String.class);
+ this.feature = new Feature(ArtifactId.parse(idObj.toString()));
this.feature.setLocation(this.location);
// title, description, vendor and license