Skip to content

Instantly share code, notes, and snippets.

View degree's full-sized avatar
🎧
development

Eugene Dubrovka degree

🎧
development
View GitHub Profile
@degree
degree / LambdaExceptionUtil.java
Created November 22, 2017 13:38 — forked from jomoespe/LambdaExceptionUtil.java
Utility class to handle checked exceptions from
/**
* Utility class to handle checked exceptions in lambdas.
* <p>
* From <a href="http://stackoverflow.com/questions/27644361/how-can-i-throw-checked-exceptions-from-inside-java-8-streams">How can I throw CHECKED exceptions from inside Java 8 streams?</a>.
* This class helps to handle checked exceptions with lambdas. Example, with Class.forName method, which throws checked exceptions:
* </p>
* <pre>
* Stream.of("java.lang.Object", "java.lang.Integer", "java.lang.String")
* .map(rethrowFunction(Class::forName))
* .collect(Collectors.toList());
#!/bin/bash
function filter_ignored_branches() {
local branches=$1
local ignored=$2
local result=""
for branch in $branches; do
if echo $ignored | grep -v $branch > /dev/null ; then
if [ "$INVERT" != "true" ]; then
result="$result $branch"
fi