Comparing Adobe-Consulting-Services/acs-aem-commons 62c6aa9..153dce4

View on GitHub
5 changed files with 11 additions and 6 deletions.
+2, -3bundle/src/main/java/com/adobe/acs/commons/functions/CheckedBiConsumer.java
@@ -20,7 +20,6 @@
package com.adobe.acs.commons.functions;
import aQute.bnd.annotation.ConsumerType;
import java.util.Map;
import java.util.function.BiConsumer;
/**
@@ -40,8 +39,8 @@ import java.util.function.BiConsumer;
@SuppressWarnings("squid:S00112")
public interface CheckedBiConsumer<T, U> {
public static <T,U> CheckedBiConsumer<T,U> from(BiConsumer<T,U> handler) {
return (t, u) -> handler.accept(t, u);
static <T,U> CheckedBiConsumer<T,U> from(BiConsumer<T,U> handler) {
return handler == null ? null : (t, u) -> handler.accept(t, u);
}
/**
+3bundle/src/main/java/com/adobe/acs/commons/functions/CheckedBiFunction.java
@@ -36,6 +36,9 @@ import aQute.bnd.annotation.ConsumerType;
@FunctionalInterface
@SuppressWarnings("squid:S00112")
public interface CheckedBiFunction<T, U, R> {
static <T,U,R> CheckedBiFunction<T, U, R> from(java.util.function.BiFunction<T,U,R> function) {
return function == null ? null : (t, u) -> function.apply(t, u);
}
/**
* Applies this function to the given arguments.
+3bundle/src/main/java/com/adobe/acs/commons/functions/CheckedConsumer.java
@@ -33,6 +33,9 @@ import aQute.bnd.annotation.ConsumerType;
@FunctionalInterface
@SuppressWarnings("squid:S00112")
public interface CheckedConsumer<T> {
static <T> CheckedConsumer<T> from(java.util.function.Consumer<T> consumer) {
return consumer == null ? null : t -> consumer.accept(t);
}
void accept(T t) throws Exception;
+1, -1bundle/src/main/java/com/adobe/acs/commons/functions/CheckedFunction.java
@@ -35,7 +35,7 @@ import java.util.function.Function;
public interface CheckedFunction<T, R> {
public static <T,R> CheckedFunction<T,R> from(Function<T,R> function) {
return t -> function.apply(t);
return function == null ? null : t -> function.apply(t);
}
/**
+2, -2bundle/src/main/java/com/adobe/acs/commons/mcp/impl/processes/BrokenLinksReport.java
@@ -132,8 +132,8 @@ public class BrokenLinksReport extends ProcessDefinition implements Serializable
public void buildReport(ActionManager manager) {
TreeFilteringResourceVisitor visitor = new TreeFilteringResourceVisitor();
visitor.setBreadthFirstMode();
visitor.setTraversalFilter(null);
visitor.setResourceVisitor((resource, depth) -> {
visitor.setTraversalFilterChecked(null);
visitor.setResourceVisitorChecked((resource, depth) -> {
manager.deferredWithResolver(rr -> {
Map<String, List<String>> brokenRefs = collectBrokenReferences(resource, regex, excludeList, deepCheckList);
for(Map.Entry<String, List<String>> ref : brokenRefs.entrySet()){