Skip to content

Commit 70222bc

Browse files
authored
Merge pull request #73 from eric-vlaanderen/java_upgrade
Upgrade gradle configuration to support java 17+
2 parents 86856be + acc2de9 commit 70222bc

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

RCaller/build.gradle

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,29 @@ group = 'com.github.jbytecode'
1111
version = '4.0.2'
1212
description = 'RCaller is a software library which simplifies performing data analysis and statistical calculations in Java using R. The details are hidden from users including transferring data between platforms, function calls, and retrieving results.'
1313

14+
java.sourceCompatibility = JavaVersion.VERSION_11
15+
1416
dependencies {
15-
implementation 'org.apache.commons:commons-lang3:3.12.0'
16-
compileOnly 'org.apache.arrow:arrow-vector:[5.0.0,)'
17+
implementation 'org.apache.commons:commons-lang3:3.20.0'
18+
19+
compileOnly 'org.apache.arrow:arrow-vector:[19.0.0,20.0.0)'
1720

1821
testImplementation 'junit:junit:4.13.2'
19-
testImplementation 'org.apache.arrow:arrow-vector:[5.0.0,)'
20-
testImplementation 'org.apache.arrow:arrow-memory-netty:[5.0.0,)'
22+
23+
testImplementation 'org.apache.arrow:arrow-vector:[19.0.0,)'
24+
testImplementation 'org.apache.arrow:arrow-memory-netty:[19.0.0,)'
25+
testImplementation 'org.apache.arrow:arrow-memory-unsafe:[19.0.0,)'
2126
}
2227

23-
java.sourceCompatibility = JavaVersion.VERSION_11
28+
test {
29+
jvmArgs '-Dio.netty.tryReflectionSetAccessible=true',
30+
'-Dio.netty.noUnsafe=true',
31+
// Force Apache Arrow to use standard Java APIs instead of Netty
32+
'-Darrow.memory.allocation.manager.factory=org.apache.arrow.memory.unsafe.UnsafeAllocationManagerFactory',
33+
// Correct the module open target syntax for standard classpaths
34+
'--add-opens=java.base/java.nio=ALL-UNNAMED',
35+
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED'
36+
}
2437

2538
java {
2639
withSourcesJar()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

RCaller/src/main/java/com/github/rcaller/rstuff/ROutputParser.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.github.rcaller.io.ArrowBridge;
66
import com.github.rcaller.io.ROutputParserArrow;
77
import com.github.rcaller.io.ROutputParserXML;
8+
import org.apache.commons.lang3.NotImplementedException;
89
import org.w3c.dom.Document;
910
import org.w3c.dom.NodeList;
1011
import java.io.*;
@@ -46,15 +47,15 @@ static ROutputParser create(RCallerOptions rCallerOptions) {
4647
* Returns parsed XML document.
4748
* @deprecated Do not use if you are not using XML consciously
4849
* @return parsed XML document
49-
* @throw NotImplementedException if Arrow implementation is used
50+
* @throws NotImplementedException if Arrow implementation is used
5051
*/
5152
@Deprecated
5253
Document getDocument();
5354

5455
/**
5556
* Inits parsed XML document.
5657
* @deprecated Do not use if you are not using XML consciously
57-
* @throw NotImplementedException if Arrow implementation is used
58+
* @throws NotImplementedException if Arrow implementation is used
5859
*/
5960
@Deprecated
6061
void setDocument(Document document);
@@ -63,7 +64,7 @@ static ROutputParser create(RCallerOptions rCallerOptions) {
6364
* Returns XML file.
6465
* @deprecated Do not use if you are not using XML consciously. Can be replaced with {@link #getIPCResource}
6566
* @return XML file
66-
* @throw NotImplementedException if Arrow implementation is used
67+
* @throws NotImplementedException if Arrow implementation is used
6768
*/
6869
@Deprecated
6970
File getXMLFile();
@@ -74,15 +75,15 @@ static ROutputParser create(RCallerOptions rCallerOptions) {
7475
* Returns raw XML document.
7576
* @deprecated Do not use if you are not using XML consciously
7677
* @return raw XML document
77-
* @throw NotImplementedException if Arrow implementation is used
78+
* @throws NotImplementedException if Arrow implementation is used
7879
*/
7980
@Deprecated
8081
String getXMLFileAsString() throws IOException;
8182

8283
/**
8384
* Inits XML file.
8485
* @deprecated Do not use if you are not using XML consciously. Can be replaced with {@link #setIPCResource}
85-
* @throw NotImplementedException if Arrow implementation is used
86+
* @throws NotImplementedException if Arrow implementation is used
8687
*/
8788
@Deprecated
8889
void setXMLFile(File xmlFile);
@@ -101,7 +102,7 @@ static ROutputParser create(RCallerOptions rCallerOptions) {
101102
* Returns nodes from parsed XML document.
102103
* @deprecated Do not use if you are not using XML consciously
103104
* @return nodes from parsed XML document
104-
* @throw NotImplementedException if Arrow implementation is used
105+
* @throws NotImplementedException if Arrow implementation is used
105106
*/
106107
@Deprecated
107108
NodeList getValueNodes(String name);

0 commit comments

Comments
 (0)