Skip to content

Commit

Permalink
Merge 1c88b53 into 94f2c73
Browse files Browse the repository at this point in the history
  • Loading branch information
beta-u committed Dec 10, 2017
2 parents 94f2c73 + 1c88b53 commit 7e28d94
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;

Expand Down Expand Up @@ -127,9 +128,7 @@ public static Set<PosixFilePermission> getPosixPerm(int perm) {
public static Set<AclEntryPermission> getDefaultAclPerm() {

Set<AclEntryPermission> perms = EnumSet.noneOf(AclEntryPermission.class);
for (AclEntryPermission aclPerm : permList) {
perms.add(aclPerm);
}
perms.addAll(Arrays.asList(permList));

return perms;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.servicecomb.config.client;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.google.common.base.Joiner;
Expand Down Expand Up @@ -138,9 +139,7 @@ public String getServiceName() {
public List<String> getServerUri() {
String[] result = finalConfig.getStringArray(SERVER_URL_KEY);
List<String> configCenterUris = new ArrayList<>(result.length);
for (int i = 0; i < result.length; i++) {
configCenterUris.add(result[i]);
}
configCenterUris.addAll(Arrays.asList(result));
return configCenterUris;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.servicecomb.springboot.starter.configuration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -68,9 +69,7 @@ public Iterator<String> getKeys() {
PropertySource<?> source = entry.getValue();
if (source instanceof EnumerablePropertySource) {
EnumerablePropertySource<?> enumerable = (EnumerablePropertySource<?>) source;
for (String name : enumerable.getPropertyNames()) {
result.add(name);
}
result.addAll(Arrays.asList(enumerable.getPropertyNames()));
}
}
return result.iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.servicecomb.swagger.generator.core.unittest;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

Expand Down Expand Up @@ -60,9 +61,7 @@ public void replaceMethods(String... methodNames) {
methodNameSet = new HashSet<>();
}

for (String methodName : methodNames) {
methodNameSet.add(methodName);
}
methodNameSet.addAll(Arrays.asList(methodNames));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ protected void replaceBodyBasedParameter(OperationGenerator operationGenerator,
protected void mergeBodyBasedParameters(OperationGenerator operationGenerator,
List<BodyParameter> bodyParameters) {
List<Parameter> swaggerParameters = operationGenerator.getSwaggerParameters();
for (Parameter parameter : bodyParameters) {
swaggerParameters.remove(parameter);
}
swaggerParameters.removeAll(bodyParameters);

// 将这些body包装为一个class,整体做为一个body参数
String bodyParamName = ParamUtils.generateBodyParameterName(operationGenerator.getProviderMethod());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.servicecomb.swagger.invocation.converter.impl;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

Expand All @@ -38,9 +39,7 @@ public Object convert(Object value) {

Object[] array = (Object[]) value;
Set<Object> set = new HashSet<>();
for (Object e : array) {
set.add(e);
}
set.addAll(Arrays.asList(array));
return set;
}
}

0 comments on commit 7e28d94

Please sign in to comment.