Skip to content

Commit ab2920f

Browse files
committed
[WIP] Add some comments
1 parent 4ec5158 commit ab2920f

File tree

2 files changed

+27
-5
lines changed
  • src/Mono.Android/Android.Runtime
  • tests/MSBuildDeviceIntegration/Scratch.Try/java/testing

2 files changed

+27
-5
lines changed

src/Mono.Android/Android.Runtime/JNIEnv.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static void ManualJavaObjectDispose (Java.Lang.Object obj)
244244
static Action<Exception> mono_unhandled_exception = null!;
245245
#if !NETCOREAPP
246246
static Action<AppDomain, UnhandledExceptionEventArgs> AppDomain_DoUnhandledException = null!;
247-
#endif
247+
#endif // ndef NETCOREAPP
248248

249249
static void Initialize ()
250250
{
@@ -268,13 +268,13 @@ static void Initialize ()
268268
typeof (Action<AppDomain, UnhandledExceptionEventArgs>), ad_due);
269269
}
270270
}
271-
#endif
271+
#endif // ndef NETCOREAPP
272272
}
273273

274274
#if NETCOREAPP
275275
[MethodImplAttribute(MethodImplOptions.InternalCall)]
276276
extern static void monodroid_unhandled_exception (Exception javaException);
277-
#endif
277+
#endif // def NETCOREAPP
278278

279279
internal static void PropagateUncaughtException (IntPtr env, IntPtr javaThreadPtr, IntPtr javaExceptionPtr)
280280
{
@@ -305,9 +305,9 @@ internal static void PropagateUncaughtException (IntPtr env, IntPtr javaThreadPt
305305
// Disabled until Linker error surfaced in https://github.com/xamarin/xamarin-android/pull/4302#issuecomment-596400025 is resolved
306306
//AppDomain.CurrentDomain.DoUnhandledException (args);
307307
AppDomain_DoUnhandledException?.Invoke (AppDomain.CurrentDomain, args);
308-
#else
308+
#else // ndef NETCOREAPP
309309
monodroid_unhandled_exception (innerException ?? javaException);
310-
#endif
310+
#endif // def NETCOREAPP
311311
} catch (Exception e) {
312312
Logger.Log (LogLevel.Error, "monodroid", "Exception thrown while raising AppDomain.UnhandledException event: " + e.ToString ());
313313
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package testing;
2+
3+
public final class Run {
4+
private Run() {
5+
}
6+
7+
public static interface CatchThrowableHandler {
8+
void onCatch(Throwable t);
9+
}
10+
11+
public static final void tryCatchFinally (Runnable r, CatchThrowableHandler c, Runnable f) {
12+
try {
13+
r.run();
14+
}
15+
catch (Throwable t) {
16+
c.onCatch(t);
17+
}
18+
finally {
19+
f.run();
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)