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 2018/02/26 10:38:28 UTC
[sling-whiteboard] branch master updated: Correct header,
use newer constants
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-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 2b8d86e Correct header, use newer constants
2b8d86e is described below
commit 2b8d86e8fc2f05669f8b2c517d293a3164555091
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 26 11:38:23 2018 +0100
Correct header, use newer constants
---
.../feature/support/util/CapabilityMatcher.java | 46 +++++++++++-----------
.../sling/feature/support/util/ManifestParser.java | 8 ++--
2 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/CapabilityMatcher.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/CapabilityMatcher.java
index cca0bdd..8888331 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/CapabilityMatcher.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/CapabilityMatcher.java
@@ -1,9 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.sling.feature.support.util;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-import org.osgi.resource.Capability;
-import org.osgi.resource.Requirement;
+import static org.osgi.framework.Constants.RESOLUTION_DIRECTIVE;
+import static org.osgi.framework.Constants.RESOLUTION_OPTIONAL;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
@@ -19,25 +33,11 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import static org.osgi.framework.Constants.RESOLUTION_DIRECTIVE;
-import static org.osgi.framework.Constants.RESOLUTION_OPTIONAL;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+import org.osgi.resource.Capability;
+import org.osgi.resource.Requirement;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
public class CapabilityMatcher
{
public static Set<Capability> match(Set<Capability> caps, final SimpleFilter sf)
@@ -541,7 +541,7 @@ public class CapabilityMatcher
value = "";
}
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
int CHAR = 1;
int DELIMITER = 2;
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestParser.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestParser.java
index 522eaf5..9246004 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestParser.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestParser.java
@@ -37,9 +37,7 @@ import org.osgi.framework.wiring.BundleRevision;
import org.osgi.resource.Capability;
import org.osgi.resource.Requirement;
-public class ManifestParser
-{
- private static final String BUNDLE_LICENSE_HEADER = "Bundle-License"; // No constant defined by OSGi...
+public class ManifestParser {
private final Manifest m_headerMap;
private volatile String m_bundleSymbolicName;
@@ -470,10 +468,10 @@ public class ManifestParser
attrs.put(IdentityNamespace.CAPABILITY_DOCUMENTATION_ATTRIBUTE,
headerMap.getMainAttributes().getValue(Constants.BUNDLE_DOCURL));
}
- if (headerMap.getMainAttributes().getValue(BUNDLE_LICENSE_HEADER) != null)
+ if (headerMap.getMainAttributes().getValue(Constants.BUNDLE_LICENSE) != null)
{
attrs.put(IdentityNamespace.CAPABILITY_LICENSE_ATTRIBUTE,
- headerMap.getMainAttributes().getValue(BUNDLE_LICENSE_HEADER));
+ headerMap.getMainAttributes().getValue(Constants.BUNDLE_LICENSE));
}
Map<String, String> dirs;
--
To stop receiving notification emails like this one, please contact
cziegeler@apache.org.