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/04/18 09:46:43 UTC

[sling-whiteboard] branch master updated: Clean up util package

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 4e87c7e  Clean up util package
4e87c7e is described below

commit 4e87c7e88aee3f98240832e95f35b4523afafae3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Apr 18 11:46:38 2018 +0200

    Clean up util package
---
 .../sling/feature/support/util/ManifestUtil.java   |  5 +-
 .../sling/feature/support/util/SimpleFilter.java   |  4 +-
 .../feature/support/util/StringComparator.java     | 71 ----------------------
 .../sling/feature/support/util/SubstVarUtil.java   |  1 -
 4 files changed, 4 insertions(+), 77 deletions(-)

diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestUtil.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestUtil.java
index c453fa0..2b3772d 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestUtil.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/ManifestUtil.java
@@ -28,7 +28,6 @@ import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.stream.Collectors;
 
-import org.apache.sling.feature.support.util.ManifestParser.ParsedHeaderClause;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 import org.osgi.resource.Capability;
@@ -53,10 +52,10 @@ public class ManifestUtil {
             final boolean checkOptional) {
         final String pckInfo = m.getMainAttributes().getValue(headerName);
         if (pckInfo != null) {
-            final List<ParsedHeaderClause> clauses = ManifestParser.parseStandardHeader(pckInfo);
+            final List<ManifestParser.ParsedHeaderClause> clauses = ManifestParser.parseStandardHeader(pckInfo);
 
             final List<PackageInfo> pcks = new ArrayList<>();
-            for(final ParsedHeaderClause entry : clauses) {
+            for(final ManifestParser.ParsedHeaderClause entry : clauses) {
                 Object versionObj = entry.m_attrs.get("version");
                 final String version;
                 if ( versionObj == null ) {
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SimpleFilter.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SimpleFilter.java
index 3cf3d89..f9dc1cc 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SimpleFilter.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SimpleFilter.java
@@ -23,7 +23,7 @@ import java.util.Map.Entry;
 
 import org.osgi.framework.VersionRange;
 
-public class SimpleFilter
+class SimpleFilter
 {
     public static final int MATCH_ALL = 0;
     public static final int AND = 1;
@@ -40,7 +40,7 @@ public class SimpleFilter
     private final Object m_value;
     private final int m_op;
 
-    public SimpleFilter(String attr, Object value, int op)
+    SimpleFilter(String attr, Object value, int op)
     {
         m_name = attr;
         m_value = value;
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/StringComparator.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/StringComparator.java
deleted file mode 100644
index 866c14c..0000000
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/StringComparator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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 java.util.Comparator;
-
-public class StringComparator implements Comparator<String>
-{
-
-    public static final StringComparator COMPARATOR = new StringComparator();
-
-    public int compare(String s1, String s2)
-    {
-        int n1 = s1.length();
-        int n2 = s2.length();
-        int min = n1 < n2 ? n1 : n2;
-        for ( int i = 0; i < min; i++ )
-        {
-            char c1 = s1.charAt( i );
-            char c2 = s2.charAt( i );
-            if ( c1 != c2 )
-            {
-                // Fast check for simple ascii codes
-                if ( c1 <= 128 && c2 <= 128 )
-                {
-                    c1 = toLowerCaseFast(c1);
-                    c2 = toLowerCaseFast(c2);
-                    if ( c1 != c2 )
-                    {
-                        return c1 - c2;
-                    }
-                }
-                else
-                {
-                    c1 = Character.toUpperCase( c1 );
-                    c2 = Character.toUpperCase( c2 );
-                    if ( c1 != c2 )
-                    {
-                        c1 = Character.toLowerCase( c1 );
-                        c2 = Character.toLowerCase( c2 );
-                        if ( c1 != c2 )
-                        {
-                            // No overflow because of numeric promotion
-                            return c1 - c2;
-                        }
-                    }
-                }
-            }
-        }
-        return n1 - n2;
-    }
-
-    private static char toLowerCaseFast( char ch )
-    {
-        return ( ch >= 'A' && ch <= 'Z' ) ? ( char ) ( ch + 'a' - 'A' ) : ch;
-    }
-}
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SubstVarUtil.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SubstVarUtil.java
index d601624..ec77483 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SubstVarUtil.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/util/SubstVarUtil.java
@@ -18,7 +18,6 @@ package org.apache.sling.feature.support.util;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
 public class SubstVarUtil {
     private static final String DELIM_START = "${";

-- 
To stop receiving notification emails like this one, please contact
cziegeler@apache.org.