langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ArgTokenizer.java
equal
deleted
inserted
replaced
28 import java.util.ArrayList; |
28 import java.util.ArrayList; |
29 import java.util.Arrays; |
29 import java.util.Arrays; |
30 import java.util.HashMap; |
30 import java.util.HashMap; |
31 import java.util.List; |
31 import java.util.List; |
32 import java.util.Map; |
32 import java.util.Map; |
|
33 import java.util.Map.Entry; |
|
34 |
33 import static java.util.stream.Collectors.toList; |
35 import static java.util.stream.Collectors.toList; |
34 |
36 |
35 /** |
37 /** |
36 * Parse command arguments, derived from StreamTokenizer by |
38 * Parse command arguments, derived from StreamTokenizer by |
37 * @author James Gosling |
39 * @author James Gosling |
137 * |
139 * |
138 * @return the option count |
140 * @return the option count |
139 */ |
141 */ |
140 int optionCount() { |
142 int optionCount() { |
141 return (int) options.entrySet().stream() |
143 return (int) options.entrySet().stream() |
142 .filter(e -> e.getValue()) |
144 .filter(Entry::getValue) |
143 .count(); |
145 .count(); |
144 } |
146 } |
145 |
147 |
146 /** |
148 /** |
147 * Return the bad options encountered. Bad options are those that were not |
149 * Return the bad options encountered. Bad options are those that were not |