Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/libg/clauses/Clauses.java b/bundleplugin/src/main/java/aQute/libg/clauses/Clauses.java
index 12eba4f..5701bab 100755
--- a/bundleplugin/src/main/java/aQute/libg/clauses/Clauses.java
+++ b/bundleplugin/src/main/java/aQute/libg/clauses/Clauses.java
@@ -5,15 +5,14 @@
import aQute.libg.log.*;
import aQute.libg.qtokens.*;
-public class Clauses extends LinkedHashMap<String,Map<String,String>>{
+public class Clauses extends LinkedHashMap<String,Map<String,String>> {
private static final long serialVersionUID = 1L;
-
+
/**
* Standard OSGi header parser. This parser can handle the format clauses
* ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '='
- * value )
- *
- * This is mapped to a Map { name => Map { attr|directive => value } }
+ * value ) This is mapped to a Map { name => Map { attr|directive => value }
+ * }
*
* @param value
* @return
@@ -36,9 +35,8 @@
String adname = qt.nextToken();
if ((del = qt.getSeparator()) != '=') {
if (hadAttribute)
- throw new IllegalArgumentException(
- "Header contains name field after attribute or directive: "
- + adname + " from " + value);
+ throw new IllegalArgumentException("Header contains name field after attribute or directive: "
+ + adname + " from " + value);
aliases.add(adname);
} else {
String advalue = qt.nextToken();
@@ -51,10 +49,8 @@
String packageName = i.next();
if (result.containsKey(packageName)) {
if (logger != null)
- logger
- .warning("Duplicate package name in header: "
- + packageName
- + ". Multiple package names in one clause not supported in Bnd.");
+ logger.warning("Duplicate package name in header: " + packageName
+ + ". Multiple package names in one clause not supported in Bnd.");
} else
result.put(packageName, clause);
}
diff --git a/bundleplugin/src/main/java/aQute/libg/clauses/Selector.java b/bundleplugin/src/main/java/aQute/libg/clauses/Selector.java
index eaa806c..a2a9699 100755
--- a/bundleplugin/src/main/java/aQute/libg/clauses/Selector.java
+++ b/bundleplugin/src/main/java/aQute/libg/clauses/Selector.java
@@ -65,18 +65,18 @@
StringBuilder sb = new StringBuilder();
for (int c = 0; c < string.length(); c++) {
switch (string.charAt(c)) {
- case '.':
- sb.append("\\.");
- break;
- case '*':
- sb.append(".*");
- break;
- case '?':
- sb.append(".?");
- break;
- default:
- sb.append(string.charAt(c));
- break;
+ case '.' :
+ sb.append("\\.");
+ break;
+ case '*' :
+ sb.append(".*");
+ break;
+ case '?' :
+ sb.append(".?");
+ break;
+ default :
+ sb.append(string.charAt(c));
+ break;
}
}
string = sb.toString();
@@ -101,17 +101,16 @@
public static List<Selector> getInstructions(Clauses clauses) {
List<Selector> result = new ArrayList<Selector>();
- for (Map.Entry<String, Map<String, String>> entry : clauses.entrySet()) {
+ for (Map.Entry<String,Map<String,String>> entry : clauses.entrySet()) {
Selector instruction = getPattern(entry.getKey());
result.add(instruction);
}
return result;
}
-
- public static <T> List<T> select(Collection<T> domain,
- List<Selector> instructions) {
+
+ public static <T> List<T> select(Collection<T> domain, List<Selector> instructions) {
List<T> result = new ArrayList<T>();
- Iterator<T> iterator = domain.iterator();
+ Iterator<T> iterator = domain.iterator();
value: while (iterator.hasNext()) {
T value = iterator.next();
for (Selector instruction : instructions) {
@@ -124,6 +123,5 @@
}
return result;
}
-
}