Skip to content

Commit cd20135

Browse files
committed
[JavaVirtualMachine] Change the default for ignoreUnrecognized parameter
The `ignoreUnrecognized` parameter to `JavaVirtualMachine.shared()` tells the JVM not to complain about options it doesn't recognize, which tends to mask usage errors. Change the default from `true` to `false`.
1 parent e453505 commit cd20135

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/JavaKitVM/JavaVirtualMachine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class JavaVirtualMachine: @unchecked Sendable {
4545
private init(
4646
classPath: [String] = [],
4747
vmOptions: [String] = [],
48-
ignoreUnrecognized: Bool = true
48+
ignoreUnrecognized: Bool = false
4949
) throws {
5050
var jvm: JavaVMPointer? = nil
5151
var environment: UnsafeMutableRawPointer? = nil
@@ -176,7 +176,7 @@ extension JavaVirtualMachine {
176176
public static func shared(
177177
classPath: [String] = [],
178178
vmOptions: [String] = [],
179-
ignoreUnrecognized: Bool = true
179+
ignoreUnrecognized: Bool = false
180180
) throws -> JavaVirtualMachine {
181181
try sharedJVM.withLock { (sharedJVMPointer: inout JavaVirtualMachine?) in
182182
// If we already have a JavaVirtualMachine instance, return it.

0 commit comments

Comments
 (0)