Skip to content

Commit 12e851c

Browse files
author
Robert Winkler
committed
Refactored Swagger2MarkupConfigBuilder
1 parent 20fa72b commit 12e851c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/main/java/io/github/swagger2markup/Swagger2MarkupProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public Optional<Path> getPath(String key) {
231231
* @throws IllegalStateException if the value cannot be mapped to an array of strings
232232
*/
233233
public List<Path> getPathList(String key) {
234-
List<Path> pathList = new ArrayList<Path>();
234+
List<Path> pathList = new ArrayList<>();
235235

236236
try {
237237
String[] stringList = configuration.getStringArray(key);

src/main/java/io/github/swagger2markup/builder/Swagger2MarkupConfigBuilder.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,9 @@ public Swagger2MarkupConfigBuilder(Configuration configuration) {
113113
config.headerPattern = headerPattern.orElse(null);
114114

115115
config.listDelimiterEnabled = swagger2MarkupProperties.getBoolean(LIST_DELIMITER_ENABLED, false);
116-
OptionalInt delimiter = swagger2MarkupProperties.getString(LIST_DELIMITER, "").chars().findFirst();
117-
if (delimiter.isPresent()) {
118-
config.listDelimiter = Character.valueOf((char)delimiter.getAsInt());
119-
}
116+
config.listDelimiter = swagger2MarkupProperties.getString(LIST_DELIMITER, ",").charAt(0);
120117

121-
if (config.listDelimiterEnabled && config.listDelimiter != null && configuration instanceof AbstractConfiguration) {
118+
if (config.listDelimiterEnabled && configuration instanceof AbstractConfiguration) {
122119
((AbstractConfiguration)configuration).setListDelimiterHandler(new DefaultListDelimiterHandler(config.listDelimiter));
123120
}
124121

0 commit comments

Comments
 (0)