@@ -113,16 +113,19 @@ public final class ManagedProcess {
|
||||
*/
|
||||
public List<String> getLines(Predicate<String> lineFilter) {
|
||||
lock.lock();
|
||||
try {
|
||||
if (lineFilter == null)
|
||||
return List.copyOf(lines);
|
||||
|
||||
if (lineFilter == null)
|
||||
return List.copyOf(lines);
|
||||
|
||||
ArrayList<String> res = new ArrayList<>();
|
||||
for (String line : this.lines) {
|
||||
if (lineFilter.test(line))
|
||||
res.add(line);
|
||||
ArrayList<String> res = new ArrayList<>();
|
||||
for (String line : this.lines) {
|
||||
if (lineFilter.test(line))
|
||||
res.add(line);
|
||||
}
|
||||
return Collections.unmodifiableList(res);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return Collections.unmodifiableList(res);
|
||||
}
|
||||
|
||||
public void addLine(String line) {
|
||||
|
||||
Reference in New Issue
Block a user