From 4fe5033dd9ebca9bc536c69f03bd35dfe94a9c3f Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Tue, 6 Mar 2018 22:33:43 +0300 Subject: [PATCH] longjmpException -> IllegalStateException --- src/lwjake2/qcommon/Com.java | 12 +++++----- src/lwjake2/qcommon/Qcommon.java | 4 ++-- src/lwjake2/qcommon/longjmpException.java | 27 ----------------------- 3 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 src/lwjake2/qcommon/longjmpException.java diff --git a/src/lwjake2/qcommon/Com.java b/src/lwjake2/qcommon/Com.java index bf9035b..f64ec52 100644 --- a/src/lwjake2/qcommon/Com.java +++ b/src/lwjake2/qcommon/Com.java @@ -243,18 +243,18 @@ public final class Com public static Runnable Error_f= new Runnable() { - public void run() throws longjmpException + public void run() throws IllegalStateException { Error(Defines.ERR_FATAL, Cmd.Argv(1)); } }; - public static void Error(int code, String fmt) throws longjmpException + public static void Error(int code, String fmt) throws IllegalStateException { Error(code, fmt, null); } - public static void Error(int code, String fmt, Vargs vargs) throws longjmpException + public static void Error(int code, String fmt, Vargs vargs) throws IllegalStateException { // va_list argptr; // static char msg[MAXPRINTMSG]; @@ -271,7 +271,7 @@ public final class Com { CL.Drop(); recursive= false; - throw new longjmpException(); + throw new IllegalStateException(); } else if (code == Defines.ERR_DROP) { @@ -279,7 +279,7 @@ public final class Com SV_MAIN.SV_Shutdown("Server crashed: " + msg + "\n", false); CL.Drop(); recursive= false; - throw new longjmpException(); + throw new IllegalStateException(); } else { @@ -294,7 +294,7 @@ public final class Com * Com_InitArgv checks the number of command line arguments * and copies all arguments with valid length into com_argv. */ - static void InitArgv(String[] args) throws longjmpException + static void InitArgv(String[] args) throws IllegalStateException { if (args.length > Defines.MAX_NUM_ARGVS) diff --git a/src/lwjake2/qcommon/Qcommon.java b/src/lwjake2/qcommon/Qcommon.java index a6dd27a..a359ffd 100644 --- a/src/lwjake2/qcommon/Qcommon.java +++ b/src/lwjake2/qcommon/Qcommon.java @@ -127,7 +127,7 @@ public final class Qcommon extends Globals { // save config when configuration is completed CL.WriteConfiguration(); - } catch (longjmpException e) { + } catch (IllegalStateException e) { Sys.Error("Error during initialization"); } } @@ -227,7 +227,7 @@ public final class Qcommon extends Globals { new Vargs(5).add(all).add(sv).add(gm).add(cl).add(rf)); } - } catch (longjmpException e) { + } catch (IllegalStateException e) { Com.DPrintf("lonjmp exception:" + e); } } diff --git a/src/lwjake2/qcommon/longjmpException.java b/src/lwjake2/qcommon/longjmpException.java deleted file mode 100644 index ac69426..0000000 --- a/src/lwjake2/qcommon/longjmpException.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 1997-2001 Id Software, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -package lwjake2.qcommon; - -/** - * longjmpException is used to replace the setjmp/longjmp code. - */ -@SuppressWarnings("serial") -public final class longjmpException extends IllegalStateException { - -} \ No newline at end of file