From e6d450bcd803a6ca9633b6dc83a43735c9042493 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Tue, 22 May 2018 19:11:57 -0600 Subject: [PATCH] runelite-client: Require assertions when developer mode is on Because we now have several thread checks that use assertions, but not many people have assertions on, so we keep getting code with threading problems that no one notices. If for some reason you need developer mode with assertions disabled you can add `-ea:net.runelite.client.RuneLite` to your JVM params --- .../src/main/java/net/runelite/client/RuneLite.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index 5b7ec9e5ba..a0ee9f7db4 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -146,6 +146,16 @@ public class RuneLite System.exit(0); } + if (RuneLite.getOptions().has("developer-mode")) + { + boolean assertions = false; + assert assertions = true; + if (!assertions) + { + throw new RuntimeException("Developers should enable assertions; Add `-ea` to your JVM arguments`"); + } + } + PROFILES_DIR.mkdirs(); // Setup logger