Skip to content

Commit a05defc

Browse files
committed
Address feedback.
1 parent 6c5e383 commit a05defc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Java.Interop/Java.Interop/JniRuntime.JniMarshalMemberBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ partial void SetMarshalMemberBuilder (CreationOptions options)
4848
var t = jie.GetType ("Java.Interop.MarshalMemberBuilder");
4949
if (t == null)
5050
throw new InvalidOperationException ("Could not find Java.Interop.MarshalMemberBuilder from Java.Interop.Export.dll!");
51-
var b = (JniMarshalMemberBuilder?) Activator.CreateInstance (t);
52-
marshalMemberBuilder = SetRuntime (b!);
51+
var b = (JniMarshalMemberBuilder) Activator.CreateInstance (t)!;
52+
marshalMemberBuilder = SetRuntime (b);
5353
}
5454

5555
public abstract class JniMarshalMemberBuilder : IDisposable, ISetRuntime
@@ -87,7 +87,7 @@ public Delegate CreateMarshalToM
8787
{
8888
if (value == null)
8989
throw new ArgumentNullException (nameof (value));
90-
return CreateMarshalToManagedExpression (value.GetMethodInfo ()!).Compile ();
90+
return CreateMarshalToManagedExpression (value.GetMethodInfo ()).Compile ();
9191
}
9292

9393
public abstract LambdaExpression CreateMarshalToManagedExpression (MethodInfo method);

src/Java.Interop/Java.Interop/JniRuntime.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ static unsafe JavaVMInterface CreateInvoker (IntPtr handle)
290290
public virtual void FailFast (string? message)
291291
{
292292
var m = typeof (Environment).GetMethod ("FailFast");
293-
m?.Invoke (null, new object?[]{ message });
293+
294+
if (m is null)
295+
Environment.Exit (1);
296+
297+
m.Invoke (null, new object?[]{ message });
294298
}
295299

296300
public override string ToString ()

0 commit comments

Comments
 (0)