|
1 | 1 | package io.swagger.codegen;
|
2 | 2 |
|
3 | 3 | import com.github.jknack.handlebars.Handlebars;
|
4 |
| -import com.google.common.base.Function; |
5 |
| -import com.google.common.collect.Lists; |
6 | 4 | import com.samskivert.mustache.Mustache.Compiler;
|
7 | 5 | import io.swagger.codegen.languages.helpers.HasHelper;
|
8 | 6 | import io.swagger.codegen.languages.helpers.HasNotHelper;
|
|
41 | 39 | import io.swagger.v3.oas.models.security.OAuthFlows;
|
42 | 40 | import io.swagger.v3.oas.models.security.SecurityScheme;
|
43 | 41 | import io.swagger.v3.parser.util.SchemaTypeUtil;
|
44 |
| -import org.apache.commons.lang3.ArrayUtils; |
45 | 42 | import org.apache.commons.lang3.ObjectUtils;
|
46 | 43 | import org.apache.commons.lang3.StringEscapeUtils;
|
47 | 44 | import org.apache.commons.lang3.StringUtils;
|
48 | 45 | import org.slf4j.Logger;
|
49 | 46 | import org.slf4j.LoggerFactory;
|
50 |
| - |
51 |
| -import javax.annotation.Nullable; |
52 | 47 | import java.io.File;
|
53 | 48 | import java.util.ArrayList;
|
54 | 49 | import java.util.Arrays;
|
|
66 | 61 | import java.util.regex.Pattern;
|
67 | 62 | import java.util.stream.Collectors;
|
68 | 63 |
|
69 |
| -import static io.swagger.codegen.CodegenHelper.getDefaultIncludes; |
70 |
| -import static io.swagger.codegen.CodegenHelper.getImportMappings; |
71 |
| -import static io.swagger.codegen.CodegenHelper.getTypeMappings; |
72 |
| -import static io.swagger.codegen.CodegenHelper.initalizeSpecialCharacterMapping; |
73 | 64 | import static io.swagger.codegen.CodegenConstants.HAS_ONLY_READ_ONLY_EXT_NAME;
|
74 | 65 | import static io.swagger.codegen.CodegenConstants.HAS_OPTIONAL_EXT_NAME;
|
75 | 66 | import static io.swagger.codegen.CodegenConstants.HAS_REQUIRED_EXT_NAME;
|
76 | 67 | import static io.swagger.codegen.CodegenConstants.IS_ARRAY_MODEL_EXT_NAME;
|
77 | 68 | import static io.swagger.codegen.CodegenConstants.IS_ENUM_EXT_NAME;
|
| 69 | +import static io.swagger.codegen.CodegenHelper.getDefaultIncludes; |
| 70 | +import static io.swagger.codegen.CodegenHelper.getImportMappings; |
| 71 | +import static io.swagger.codegen.CodegenHelper.getTypeMappings; |
| 72 | +import static io.swagger.codegen.CodegenHelper.initalizeSpecialCharacterMapping; |
78 | 73 | import static io.swagger.codegen.languages.helpers.ExtensionHelper.getBooleanValue;
|
79 | 74 | import static io.swagger.codegen.utils.ModelUtils.processCodegenModels;
|
80 | 75 | import static io.swagger.codegen.utils.ModelUtils.processModelEnums;
|
@@ -2818,13 +2813,9 @@ public String removeNonNameElementToCamelCase(String name) {
|
2818 | 2813 | * @return camelized string
|
2819 | 2814 | */
|
2820 | 2815 | protected String removeNonNameElementToCamelCase(final String name, final String nonNameElementPattern) {
|
2821 |
| - String result = StringUtils.join(Lists.transform(Lists.newArrayList(name.split(nonNameElementPattern)), new Function<String, String>() { |
2822 |
| - @Nullable |
2823 |
| - @Override |
2824 |
| - public String apply(String input) { |
2825 |
| - return StringUtils.capitalize(input); |
2826 |
| - } |
2827 |
| - }), ""); |
| 2816 | + String result = Arrays.stream(name.split(nonNameElementPattern)) |
| 2817 | + .map(StringUtils::capitalize) |
| 2818 | + .collect(Collectors.joining("")); |
2828 | 2819 | if (result.length() > 0) {
|
2829 | 2820 | result = result.substring(0, 1).toLowerCase() + result.substring(1);
|
2830 | 2821 | }
|
|
0 commit comments