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/qtokens/QuotedTokenizer.java b/bundleplugin/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java
index 58ea539..c8dcb41 100755
--- a/bundleplugin/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java
+++ b/bundleplugin/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java
@@ -13,40 +13,41 @@
String peek;
char separator;
- public QuotedTokenizer(String string, String separators, boolean returnTokens ) {
- if ( string == null )
+ public QuotedTokenizer(String string, String separators, boolean returnTokens) {
+ if (string == null)
throw new IllegalArgumentException("string argument must be not null");
this.string = string;
this.separators = separators;
this.returnTokens = returnTokens;
}
+
public QuotedTokenizer(String string, String separators) {
- this(string,separators,false);
+ this(string, separators, false);
}
public String nextToken(String separators) {
separator = 0;
- if ( peek != null ) {
+ if (peek != null) {
String tmp = peek;
peek = null;
return tmp;
}
-
- if ( index == string.length())
+
+ if (index == string.length())
return null;
-
+
StringBuilder sb = new StringBuilder();
while (index < string.length()) {
char c = string.charAt(index++);
- if ( Character.isWhitespace(c)) {
- if ( index == string.length())
+ if (Character.isWhitespace(c)) {
+ if (index == string.length())
break;
sb.append(c);
continue;
}
-
+
if (separators.indexOf(c) >= 0) {
if (returnTokens)
peek = Character.toString(c);
@@ -66,7 +67,7 @@
}
}
String result = sb.toString().trim();
- if ( result.length()==0 && index==string.length())
+ if (result.length() == 0 && index == string.length())
return null;
return result;
}
@@ -81,8 +82,7 @@
c = string.charAt(index++);
if (c == quote)
break;
- if (c == '\\' && index < string.length()
- && string.charAt(index + 1) == quote)
+ if (c == '\\' && index < string.length() && string.charAt(index + 1) == quote)
c = string.charAt(index++);
sb.append(c);
}
@@ -92,22 +92,24 @@
return getTokens(0);
}
- private String [] getTokens(int cnt){
+ private String[] getTokens(int cnt) {
String token = nextToken();
- if ( token == null )
+ if (token == null)
return new String[cnt];
-
- String result[] = getTokens(cnt+1);
- result[cnt]=token;
+
+ String result[] = getTokens(cnt + 1);
+ result[cnt] = token;
return result;
}
- public char getSeparator() { return separator; }
-
+ public char getSeparator() {
+ return separator;
+ }
+
public List<String> getTokenSet() {
List<String> list = Create.list();
String token = nextToken();
- while ( token != null ) {
+ while (token != null) {
list.add(token);
token = nextToken();
}