Skip to content

Commit 270b23c

Browse files
committed
[JniEnvironment] Revert change that changed an NSE to an ODE.
1 parent 453d3bf commit 270b23c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Java.Interop/Java.Interop/JniEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ sealed class JniEnvironmentInfo : IDisposable {
192192
public int LocalReferenceCount {get; internal set;}
193193
public bool WithinNewObjectScope {get; set;}
194194
public JniRuntime Runtime {
195-
get => runtime ?? throw new ObjectDisposedException (nameof (JniEnvironmentInfo));
195+
get => runtime ?? throw new NotSupportedException ();
196196
private set => runtime = value;
197197
}
198198

tests/Java.Interop-Tests/Java.Interop/JniRuntimeTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void Dispose_ClearsJniEnvironment ()
5858
JniRuntime.SetCurrent (r);
5959
Assert.AreEqual (r, JniEnvironment.Runtime);
6060
r.Dispose ();
61-
Assert.Throws<ObjectDisposedException>(() => {
61+
Assert.Throws<NotSupportedException>(() => {
6262
var env = JniEnvironment.Runtime;
6363
});
6464
});

0 commit comments

Comments
 (0)