Skip to content

Commit 842bebb

Browse files
committed
Make metafacture-core build on Java 8 (fix #182)
Switches to antlr 3.5.2 and fixes test case which fails due to changes in the garbage collection in the Java 8 jvm. This commit is cherry-picked from commit * 9656209 in https://github.com/hbz/metafacture-core/
1 parent 6759c63 commit 842bebb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<properties>
6262
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6363
<targetJdk>1.6</targetJdk>
64-
<antlr.version>3.5.1</antlr.version>
64+
<antlr.version>3.5.2</antlr.version>
6565
</properties>
6666

6767
<scm>

src/test/java/org/culturegraph/mf/stream/pipe/sort/AbstractTripleSortTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ public void shouldNotFailIfFlushingBeforeFirstRecord() {
5858
* This test case may throw fail unexpectedly as it relies on the
5959
* garbage collector to run when calling {@code System.gc()}. This
6060
* is not guaranteed by the JVM.
61+
*
62+
* @throws InterruptedException
6163
*/
6264
@Test
63-
public void issue192ShouldUnregisterFromTheJVMToNotCauseMemoryLeak() {
65+
public void issue192ShouldUnregisterFromTheJVMToNotCauseMemoryLeak() throws InterruptedException {
6466

6567
// Get weak reference for checking whether the object was actually freed later:
6668
final ReferenceQueue<AbstractTripleSort> refQueue = new ReferenceQueue<AbstractTripleSort>();
@@ -71,6 +73,9 @@ public void issue192ShouldUnregisterFromTheJVMToNotCauseMemoryLeak() {
7173

7274
System.gc();
7375

76+
// Wait a tiny bit since GC Thread is not immediately done in Java 8
77+
Thread.sleep(1);
78+
7479
assertTrue(weakRef.isEnqueued());
7580
}
7681

0 commit comments

Comments
 (0)