Skip to content

Commit 8c69a60

Browse files
committed
Updated j4rs
1 parent fab02b0 commit 8c69a60

File tree

5 files changed

+58
-34
lines changed

5 files changed

+58
-34
lines changed

Cargo.lock

Lines changed: 48 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/plugins/java/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tmc-langs-util.workspace = true
1212

1313
dirs = "5.0.1"
1414
flate2 = "1.0.22"
15-
j4rs = "=0.17.2" # specific version to match the jar
15+
j4rs = "=0.20.0" # specific version to match the jar
1616
log = "0.4.14"
1717
once_cell = "1.9.0"
1818
serde = { version = "1.0.136", features = ["derive"] }

crates/plugins/java/src/java_plugin.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
179179
log::info!("source files: {:?}", source_files);
180180

181181
let scan_results = self.jvm().with(|jvm| {
182-
let test_scanner =
183-
jvm.create_instance("fi.helsinki.cs.tmc.testscanner.TestScanner", &[])?;
182+
let test_scanner = jvm.create_instance(
183+
"fi.helsinki.cs.tmc.testscanner.TestScanner",
184+
InvocationArg::empty(),
185+
)?;
184186

185187
jvm.invoke(
186188
&test_scanner,
@@ -195,8 +197,8 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
195197
)?;
196198
jvm.invoke(&test_scanner, "addSource", &[InvocationArg::from(file)])?;
197199
}
198-
let scan_results = jvm.invoke(&test_scanner, "findTests", &[])?;
199-
jvm.invoke(&test_scanner, "clearSources", &[])?;
200+
let scan_results = jvm.invoke(&test_scanner, "findTests", InvocationArg::empty())?;
201+
jvm.invoke(&test_scanner, "clearSources", InvocationArg::empty())?;
200202

201203
let scan_results: Vec<TestMethod> = jvm.to_rust(scan_results)?;
202204
Ok(scan_results)
@@ -251,7 +253,7 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
251253
"fi.helsinki.cs.tmc.stylerunner.CheckstyleRunner",
252254
&[InvocationArg::from(file), InvocationArg::from(locale)],
253255
)?;
254-
let result = jvm.invoke(&checkstyle_runner, "run", &[])?;
256+
let result = jvm.invoke(&checkstyle_runner, "run", InvocationArg::empty())?;
255257
let result: StyleValidationResult = jvm.to_rust(result)?;
256258
Ok(result)
257259
})?;

crates/plugins/java/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const SEPARATOR: &str = ":";
2929
const TMC_JUNIT_RUNNER_BYTES: &[u8] = include_bytes!("../deps/tmc-junit-runner-0.2.8.jar");
3030
const TMC_CHECKSTYLE_RUNNER_BYTES: &[u8] =
3131
include_bytes!("../deps/tmc-checkstyle-runner-3.0.3-20200520.064542-3.jar");
32-
const J4RS_BYTES: &[u8] = include_bytes!("../deps/j4rs-0.17.2-jar-with-dependencies.jar");
32+
const J4RS_BYTES: &[u8] = include_bytes!("../deps/j4rs-0.20.0-jar-with-dependencies.jar");
3333

3434
struct JvmWrapper {
3535
jvm: Jvm,
@@ -210,7 +210,7 @@ fn create_print_stream(jvm: &Jvm, path: &str) -> Result<Instance, JavaError> {
210210
&[InvocationArg::try_from(path).map_err(JavaError::j4rs)?],
211211
)
212212
.map_err(JavaError::j4rs)?;
213-
jvm.invoke(&file, "createNewFile", &[])
213+
jvm.invoke(&file, "createNewFile", InvocationArg::empty())
214214
.map_err(JavaError::j4rs)?;
215215
let file_output_stream = jvm
216216
.create_instance("java.io.FileOutputStream", &[InvocationArg::from(file)])

0 commit comments

Comments
 (0)