karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [1/2] karaf git commit: Revert "[KARAF-4314] karaf-maven-plugin issue when parsing feature xmls with <repository> entries that contain a newline and/or whitespaces"
Date Fri, 10 Feb 2017 19:57:57 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 49f095cb3 -> 929a21c7c


Revert "[KARAF-4314] karaf-maven-plugin issue when parsing feature xmls with <repository>
entries that contain a newline and/or whitespaces"

This reverts commit 1950f8fa0f7effa22e67ed3250935dd74447fee6.


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/69bbc0fd
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/69bbc0fd
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/69bbc0fd

Branch: refs/heads/master
Commit: 69bbc0fda78990219026c1128839389e9c282d85
Parents: 49f095c
Author: Guillaume Nodet <gnodet@apache.org>
Authored: Fri Feb 10 15:06:02 2017 +0100
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Fri Feb 10 15:06:02 2017 +0100

----------------------------------------------------------------------
 .../karaf/features/internal/model/Features.java     | 11 -----------
 .../features/internal/service/RepositoryImpl.java   | 16 ++++++++++++++--
 2 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/69bbc0fd/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
b/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
index 0bda125..af343e3 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/model/Features.java
@@ -18,7 +18,6 @@ package org.apache.karaf.features.internal.model;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Collectors;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -177,16 +176,6 @@ public class Features {
                 f.postUnmarshall();
             }
         }
-        if (repository != null) {
-            repository = trim(repository);
-        }
-        if (resourceRepository != null) {
-            resourceRepository = trim(resourceRepository);
-        }
-    }
-
-    private static List<String> trim(List<String> list) {
-        return list.stream().map(String::trim).collect(Collectors.toList());
     }
 
     public void setNamespace(String namespace) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/69bbc0fd/features/core/src/main/java/org/apache/karaf/features/internal/service/RepositoryImpl.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/RepositoryImpl.java
b/features/core/src/main/java/org/apache/karaf/features/internal/service/RepositoryImpl.java
index ad294b4..45c9fd0 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/RepositoryImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/RepositoryImpl.java
@@ -55,12 +55,24 @@ public class RepositoryImpl implements Repository {
 
     public URI[] getRepositories() throws IOException {
         load();
-        return features.getRepository().stream().map(URI::create).toArray(URI[]::new);
+        URI[] result = new URI[features.getRepository().size()];
+        for (int i = 0; i < features.getRepository().size(); i++) {
+            String uri = features.getRepository().get(i);
+            uri = uri.trim();
+            result[i] = URI.create(uri);
+        }
+        return result;
     }
 
     public URI[] getResourceRepositories() throws IOException {
         load();
-        return features.getResourceRepository().stream().map(URI::create).toArray(URI[]::new);
+        URI[] result = new URI[features.getResourceRepository().size()];
+        for (int i = 0; i < features.getResourceRepository().size(); i++) {
+            String uri = features.getResourceRepository().get(i);
+            uri = uri.trim();
+            result[i] = URI.create(uri);
+        }
+        return result;
     }
 
     public org.apache.karaf.features.Feature[] getFeatures() throws IOException {


Mime
View raw message