Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache local Maven repository
uses: actions/cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- name: Cancel previous Action
uses: styfle/cancel-workflow-action@0.10.0
uses: styfle/cancel-workflow-action@0.11.0
if: github.ref == 'refs/heads/main'
- uses: getong/elasticsearch-action@v1.2
with:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
uses: codecov/codecov-action@v3
continue-on-error: true
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.0.0
uses: EnricoMi/publish-unit-test-result-action@v2.1.0
if: always()
with:
check_name: Tests results java ${{ matrix.java }}, os ${{ matrix.os }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ jobs:
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- name: Cancel previous Action
uses: styfle/cancel-workflow-action@0.11.0
- uses: getong/elasticsearch-action@v1.2
with:
elasticsearch version: '7.6.1'
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Build with Maven
run: mvn -fae -DskipITs=false -Dinteg.cluster.name=docker-elasticsearch -B package
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.1.0
if: always()
with:
junit_files: "**/target/surefire-reports/*.xml"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: echo
run: echo {{ $github.ref }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ private int readFromFile(byte[] b, int offset, int length) throws IOException {
future.completeExceptionally(e);
close();
Thread.currentThread().interrupt();

throw new InterruptedIOException(e.getMessage());
}
result = tempFileInputStream.read(b, offset, length);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nl.vpro.util;

import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

Expand All @@ -14,17 +13,6 @@
public class LeaveDefaultsProxyHandler implements InvocationHandler {

private final Object delegate;
final static Constructor<MethodHandles.Lookup> CONSTRUCTOR;
static {
try {
CONSTRUCTOR = MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, int.class);
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
if (!CONSTRUCTOR.isAccessible()) {
CONSTRUCTOR.setAccessible(true);
}
}

public LeaveDefaultsProxyHandler(Object delegate) {
this.delegate = delegate;
Expand All @@ -34,10 +22,11 @@ public LeaveDefaultsProxyHandler(Object delegate) {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.isDefault()) {
final Class<?> declaringClass = method.getDeclaringClass();
return CONSTRUCTOR.newInstance(declaringClass, MethodHandles.Lookup.PRIVATE)
return MethodHandles.lookup().in(declaringClass)
.unreflectSpecial(method, declaringClass)
.bindTo(proxy)
.invokeWithArguments(args);

} else {
return method.invoke(delegate, args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void readFileGetsInterrupted(InputStream input, Long expectedCount) throw
boolean isInterrupted = false;
try{
try (
FileCachingInputStream inputStream = FileCachingInputStream.builder()
FileCachingInputStream inputStream = FileCachingInputStream.builder()
.outputBuffer(2)
.batchSize(3)
.batchConsumer((f) -> {
Expand Down Expand Up @@ -279,12 +279,10 @@ public void readFileGetsInterrupted(InputStream input, Long expectedCount) throw
}
log.info("EOF !, {}", r);
throw new AssertionFailedError("should not reach this, it should have been interrupted!");

}
} catch (ClosedByInterruptException | InterruptedIOException ie) {
isInterrupted = true;
log.info("Caught {}", ie.getClass() + " " + ie.getMessage());

log.info("Caught {}", ie.getClass() + " " + ie.getMessage(), ie);
} finally {
isInterrupted |= thisThread.isInterrupted();
closed.getAndIncrement();
Expand Down
3 changes: 3 additions & 0 deletions vpro-shared-util/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
</Console>
</Appenders>
<Loggers>
<Logger level="DEBUG" name="nl.vpro.util.FileCachingInputStreamTest" />
<Root level="INFO">
<Appender-Ref ref="stdout" />
</Root>



</Loggers>
</Configuration>