Browse Source

Merge pull request #156 from arturobernalg/feature/java_8

Replace Lambda with method reference.
master
Stefan Bodewig GitHub 3 years ago
parent
commit
433819ffb6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions
  1. +3
    -2
      src/main/org/apache/tools/ant/property/LocalPropertyStack.java
  2. +2
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java
  3. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java

+ 3
- 2
src/main/org/apache/tools/ant/property/LocalPropertyStack.java View File

@@ -17,6 +17,7 @@
*/
package org.apache.tools.ant.property;

import java.util.AbstractCollection;
import java.util.Collections;
import java.util.Deque;
import java.util.HashSet;
@@ -159,8 +160,8 @@ public class LocalPropertyStack {
*/
public Set<String> getPropertyNames() {
final Set<String> names = stack.stream().map(Map::keySet)
.collect(Collector.of(() -> new HashSet<String>(),
(ns, ks) -> ns.addAll(ks),
.collect(Collector.of(HashSet::new,
AbstractCollection::addAll,
(ns1, ns2) -> { ns1.addAll(ns2); return ns1; },
Collector.Characteristics.UNORDERED, Collector.Characteristics.IDENTITY_FINISH));
return Collections.unmodifiableSet(names);


+ 2
- 3
src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java View File

@@ -653,9 +653,8 @@ public class LauncherSupport {
@Override
public void executionStarted(final TestIdentifier testIdentifier) {
super.executionStarted(testIdentifier);
AbstractJUnitResultFormatter.isTestClass(testIdentifier).ifPresent(testClass -> {
this.originalSysOut.println("Running " + testClass.getClassName());
});
AbstractJUnitResultFormatter.isTestClass(testIdentifier).ifPresent(testClass ->
this.originalSysOut.println("Running " + testClass.getClassName()));
}




+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/StandaloneLauncher.java View File

@@ -146,11 +146,11 @@ public class StandaloneLauncher {
}
final String includeTags = reader.getAttributeValue(null, LD_XML_ATTR_INCLUDE_TAGS);
if (includeTags != null) {
Stream.of(includeTags.split(",")).forEach(i -> forkedLaunch.addIncludeTag(i));
Stream.of(includeTags.split(",")).forEach(forkedLaunch::addIncludeTag);
}
final String excludeTags = reader.getAttributeValue(null, LD_XML_ATTR_EXCLUDE_TAGS);
if (excludeTags != null) {
Stream.of(excludeTags.split(",")).forEach(e -> forkedLaunch.addExcludeTag(e));
Stream.of(excludeTags.split(",")).forEach(forkedLaunch::addExcludeTag);
}
final String printSummary = reader.getAttributeValue(null, LD_XML_ATTR_PRINT_SUMMARY);
if (printSummary != null) {


Loading…
Cancel
Save