Skip to content
This repository
Browse code

buglabs-osgi: remove redundant Arrays.asList().

  • Loading branch information...
commit 9706e7541ab4dd2422518b0d98693d19c414b10a 1 parent 5d507c3
Ken Gilmer kgilmer authored
6 com.buglabs.common/com/buglabs/util/osgi/FilterUtil.java
@@ -64,7 +64,7 @@ public static String generateServiceFilter(String clazz) {
64 64 * @return A LDAP filter string that can be used to construct a Filter. If null passed in, null is returned to caller.
65 65 */
66 66 public static String generateServiceFilter(String ... services) {
67   - return generateServiceFilter(Arrays.asList(services));
  67 + return generateServiceFilter(services);
68 68 }
69 69
70 70 /**
@@ -98,9 +98,7 @@ public static String generateServiceFilter(List<String> services) {
98 98 * @throws InvalidSyntaxException thrown if a syntax error is found in the generated Filter.
99 99 */
100 100 public static Filter generateServiceFilter(BundleContext context, String[] services) throws InvalidSyntaxException {
101   - String filterString = generateServiceFilter(Arrays.asList(services));
102   -
103   - return context.createFilter(filterString);
  101 + return context.createFilter(generateServiceFilter(services));
104 102 }
105 103
106 104 /**
2  com.buglabs.common/com/buglabs/util/osgi/ServiceTrackerUtil.java
@@ -159,7 +159,7 @@ public void run() {
159 159 Dictionary<String, Object> dict = new Hashtable<String, Object>();
160 160
161 161 if (arg0.getPropertyKeys() != null) {
162   - for (String key : Arrays.asList(arg0.getPropertyKeys())) {
  162 + for (String key : arg0.getPropertyKeys()) {
163 163 dict.put(key, arg0.getProperty(key));
164 164 }
165 165 }
2  com.buglabs.osgi.sewing/com/buglabs/osgi/sewing/pub/SewingController.java
@@ -187,7 +187,7 @@ protected final void redirectTo(String url) {
187 187 * @return true if all keys are present, false otherwise
188 188 */
189 189 protected final String getMissingParameter(RequestParameters params, String ... requiredKeys) {
190   - for (String key: Arrays.asList(requiredKeys))
  190 + for (String key: requiredKeys)
191 191 if (params.get(key) == null)
192 192 return key;
193 193
4 com.buglabs.osgi.tester/com/buglabs/osgi/tester/BundleTestRunnerThread.java
@@ -55,7 +55,7 @@ public void run() {
55 55
56 56 if (srefs != null && srefs.length > 0) {
57 57
58   - for (ServiceReference sr : Arrays.asList(srefs)) {
  58 + for (ServiceReference sr : srefs) {
59 59 TestSuite ts = (TestSuite) context.getService(sr);
60 60
61 61 if (ts != null)
@@ -80,7 +80,7 @@ public void run() {
80 80 }
81 81
82 82 //Shutdown all the bundles
83   - for (Bundle bundle : Arrays.asList(context.getBundles())) {
  83 + for (Bundle bundle : context.getBundles()) {
84 84 if (bundle.getBundleId() != 0) {
85 85 try {
86 86 bundle.stop();

1 comment on commit 9706e75

John E Connolly

@kgilmer I had to revert this locally. Davis discovered that the result of this code is the following: https://gist.github.com/b2112bf64775b940f9b5

I reverted it and everything worked as expected.

Please sign in to comment.
Something went wrong with that request. Please try again.