Skip to content

Commit 304cf4b

Browse files
committed
Revert "ExtendedDefaultParser should not add empty arguments"
This reverts commit af7be31. Relates #764
1 parent 52eb6b1 commit 304cf4b

File tree

2 files changed

+3
-57
lines changed

2 files changed

+3
-57
lines changed

spring-shell-core/src/main/java/org/springframework/shell/jline/ExtendedDefaultParser.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2023 the original author or authors.
2+
* Copyright 2017-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -126,12 +126,10 @@ else if (!isEscapeChar(line, i)) {
126126
}
127127

128128
if (current.length() > 0 || (line != null && cursor == line.length())) {
129-
if (current.length() > 0) {
130-
words.add(current.toString());
131-
}
129+
words.add(current.toString());
132130
}
133131

134-
if (line != null && cursor == line.length() && words.size() > 0) {
132+
if (line != null && cursor == line.length()) {
135133
wordIndex = words.size() - 1;
136134
wordCursor = words.get(words.size() - 1).length();
137135
}

spring-shell-core/src/test/java/org/springframework/shell/jline/ExtendedDefaultParserTests.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)