From dc9500c513173a0f527e5edc7a8e9c26f1acd99a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 3 Apr 2022 19:15:16 +0100 Subject: fix java deprecation notices --- sources/core/VSAbstractProcess.java | 76 +++++------- sources/core/VSInternalProcess.java | 45 ++----- sources/core/VSMessage.java | 30 +---- sources/core/VSMessageStub.java | 31 ----- sources/core/VSTask.java | 68 ++++------- sources/core/VSTaskManager.java | 51 +++----- sources/core/time/VSLamportTime.java | 26 ---- sources/core/time/VSTime.java | 23 ---- sources/core/time/VSVectorTime.java | 25 +--- sources/events/VSAbstractEvent.java | 45 ++----- sources/events/VSCopyableEvent.java | 24 ---- sources/events/VSRegisteredEvents.java | 81 ++----------- .../implementations/VSProcessCrashEvent.java | 32 +---- .../implementations/VSProcessRecoverEvent.java | 32 +---- .../events/internal/VSAbstractInternalEvent.java | 38 +----- sources/events/internal/VSMessageReceiveEvent.java | 30 +---- sources/events/internal/VSProtocolEvent.java | 44 ++----- .../events/internal/VSProtocolScheduleEvent.java | 39 ++---- .../exceptions/VSEventNotCopyableException.java | 23 ---- sources/exceptions/VSNegativeNumberException.java | 23 ---- .../exceptions/VSParseIntegerVectorException.java | 23 ---- sources/prefs/VSDefaultPrefs.java | 26 ---- sources/prefs/VSDefaultPrefsDE.java | 28 +---- sources/prefs/VSPrefs.java | 72 ++++------- sources/prefs/VSPrefsRestriction.java | 32 +---- sources/prefs/VSSerializablePrefs.java | 33 +---- sources/prefs/editors/VSAbstractBetterEditor.java | 39 ++---- sources/prefs/editors/VSAbstractEditor.java | 83 ++++++------- sources/prefs/editors/VSColorChooser.java | 35 ++---- sources/prefs/editors/VSEditorFrame.java | 37 ++---- sources/prefs/editors/VSEditorTable.java | 54 +++------ sources/prefs/editors/VSProcessEditor.java | 40 ++----- sources/prefs/editors/VSSimulatorEditor.java | 37 ++---- sources/protocols/VSAbstractProtocol.java | 53 +++----- .../implementations/VSBasicMulticastProtocol.java | 28 +---- .../implementations/VSBerkelyTimeProtocol.java | 37 +----- .../implementations/VSBroadcastProtocol.java | 26 ---- .../protocols/implementations/VSDummyProtocol.java | 30 +---- .../VSExternalTimeSyncProtocol.java | 26 ---- .../VSInternalTimeSyncProtocol.java | 26 ---- .../implementations/VSOnePhaseCommitProtocol.java | 28 +---- .../implementations/VSPingPongProtocol.java | 28 +---- .../VSReliableMulticastProtocol.java | 28 +---- .../implementations/VSTwoPhaseCommitProtocol.java | 28 +---- sources/serialize/VSNotSerializable.java | 23 ---- sources/serialize/VSSerializable.java | 27 +---- sources/serialize/VSSerialize.java | 45 +++---- sources/simulator/VSCreateTask.java | 35 +----- sources/simulator/VSLogging.java | 36 +----- sources/simulator/VSMain.java | 37 +----- sources/simulator/VSMenuItemStates.java | 26 ---- sources/simulator/VSSimulator.java | 133 ++++++++++----------- sources/simulator/VSSimulatorFrame.java | 64 +++++----- sources/simulator/VSSimulatorVisualization.java | 86 +++++++------ sources/utils/VS3Tupel.java | 26 ---- sources/utils/VSAboutFrame.java | 41 ++----- sources/utils/VSClassLoader.java | 28 +---- sources/utils/VSFrame.java | 33 ++--- sources/utils/VSInfoArea.java | 34 ++---- sources/utils/VSPriorityQueue.java | 23 ---- sources/utils/VSRandom.java | 26 ---- sources/utils/VSTools.java | 27 ----- 62 files changed, 483 insertions(+), 1930 deletions(-) diff --git a/sources/core/VSAbstractProcess.java b/sources/core/VSAbstractProcess.java index 5f8987a..83ff99d 100644 --- a/sources/core/VSAbstractProcess.java +++ b/sources/core/VSAbstractProcess.java @@ -1,40 +1,23 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core; -import java.awt.*; -import java.io.*; -import java.util.*; - -import core.time.*; -//import events.*; -//import events.implementations.*; -import prefs.*; -import protocols.*; -import serialize.*; -import simulator.*; -import utils.*; +import java.awt.Color; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; + +import core.time.VSLamportTime; +import core.time.VSTime; +import core.time.VSVectorTime; +import prefs.VSPrefs; +import prefs.VSSerializablePrefs; +import protocols.VSAbstractProtocol; +import serialize.VSSerialize; +import simulator.VSLogging; +import simulator.VSSimulatorVisualization; +import utils.VSPriorityQueue; +import utils.VSRandom; +import utils.VSTools; /** * The class VSAbstractProcess, an object of this class represents a process @@ -42,8 +25,7 @@ import utils.*; * * @author Paul C. Buetow */ -public abstract class VSAbstractProcess extends VSSerializablePrefs - implements VSSerializable { +public abstract class VSAbstractProcess extends VSSerializablePrefs { /** The data serialization id. */ protected static final long serialVersionUID = 1L; @@ -261,7 +243,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs final int numProcesses = simulatorVisualization.getNumProcesses(); for (int i = 0; i < numProcesses; ++i) - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); } /** @@ -277,7 +259,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs final int numProcesses = simulatorVisualization.getNumProcesses(); for (int i = numProcesses; i > 0; --i) - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); } /** @@ -368,7 +350,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs */ public synchronized void isCrashed(boolean isCrashed) { this.isCrashed = isCrashed; - crashHistory.add(new Long(globalTime)); + crashHistory.add(Long.valueOf(globalTime)); if (!hasCrashed) hasCrashed = true; } @@ -514,7 +496,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs */ public synchronized void increaseVectorTime() { vectorTime.set(processNum, - new Long(vectorTime.get(processNum).longValue()+1)); + Long.valueOf(vectorTime.get(processNum).longValue()+1)); vectorTime.setGlobalTime(globalTime); vectorTimeHistory.add(vectorTime.getCopy()); } @@ -530,7 +512,7 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs for (int i = 0; i < size; ++i) { if (i == processNum) - vectorTime.set(i, new Long(vectorTime.get(i).longValue()+1)); + vectorTime.set(i, Long.valueOf(vectorTime.get(i).longValue()+1)); else if (vectorTimeUpdate.get(i) > vectorTime.get(i)) vectorTime.set(i, vectorTimeUpdate.get(i)); } @@ -673,24 +655,23 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs + "; id: " + processID + ")"); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(processID)); - objectOutputStream.writeObject(new Integer(protocolsToReset.size())); + objectOutputStream.writeObject(Integer.valueOf(processID)); + objectOutputStream.writeObject(Integer.valueOf(protocolsToReset.size())); for (VSAbstractProtocol protocol : protocolsToReset) { objectOutputStream.writeObject(protocol.getClassname()); protocol.serialize(serialize, objectOutputStream); } /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { @@ -699,7 +680,6 @@ public abstract class VSAbstractProcess extends VSSerializablePrefs /* Bugfix, being compatible with old versions */ super.deleteLong("process.localTime"); - updateFromPrefs_(); if (VSSerialize.DEBUG) diff --git a/sources/core/VSInternalProcess.java b/sources/core/VSInternalProcess.java index 6bb9c66..c2166b9 100644 --- a/sources/core/VSInternalProcess.java +++ b/sources/core/VSInternalProcess.java @@ -1,37 +1,16 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core; -import java.awt.*; +import java.awt.Color; -import core.time.*; -import events.*; -import events.implementations.*; -import prefs.*; -import protocols.*; -import simulator.*; -import utils.*; +import core.time.VSVectorTime; +import events.VSAbstractEvent; +import events.VSRegisteredEvents; +import events.implementations.VSProcessCrashEvent; +import prefs.VSPrefs; +import protocols.VSAbstractProtocol; +import simulator.VSLogging; +import simulator.VSSimulatorVisualization; +import utils.VSPriorityQueue; /** * The class VSInternalProcess, an object of this class represents a process @@ -372,9 +351,9 @@ public class VSInternalProcess extends VSAbstractProcess { * simulator. */ public synchronized void addedAProcess() { - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); for (VSVectorTime vectorTime : vectorTimeHistory) - vectorTime.add(new Long(0)); + vectorTime.add(Long.valueOf(0)); } /** diff --git a/sources/core/VSMessage.java b/sources/core/VSMessage.java index b53060d..28e1b84 100644 --- a/sources/core/VSMessage.java +++ b/sources/core/VSMessage.java @@ -1,30 +1,7 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core; -import core.time.*; -import events.*; +import core.time.VSVectorTime; +import events.VSRegisteredEvents; import prefs.VSPrefs; /** @@ -34,9 +11,6 @@ import prefs.VSPrefs; * @author Paul C. Buetow */ public class VSMessage extends VSPrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The constant IS_SERVER_MESSAGE. */ public static final boolean IS_SERVER_MESSAGE = true; diff --git a/sources/core/VSMessageStub.java b/sources/core/VSMessageStub.java index f635335..95a515b 100644 --- a/sources/core/VSMessageStub.java +++ b/sources/core/VSMessageStub.java @@ -1,32 +1,5 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core; -//import core.time.*; -//import events.*; -//import prefs.VSPrefs; - /** * An object of this class represents a message stub. A message stub allows * to run the init method on a VSMessage object. The init method should be @@ -35,9 +8,6 @@ package core; * @author Paul C. Buetow */ public class VSMessageStub { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The message */ private VSMessage message; @@ -58,4 +28,3 @@ public class VSMessageStub { message.init(process, protocolClassname, isServerMessage); } } - diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 2d44139..3e06a7f 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -1,39 +1,23 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 -2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core; -import java.io.*; - -import events.*; -import events.implementations.*; -import events.internal.*; -import exceptions.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import events.VSAbstractEvent; +import events.VSRegisteredEvents; +import events.implementations.VSProcessCrashEvent; +import events.implementations.VSProcessRecoverEvent; +import events.internal.VSAbstractInternalEvent; +import events.internal.VSMessageReceiveEvent; +import events.internal.VSProtocolEvent; +import exceptions.VSEventNotCopyableException; import prefs.VSPrefs; import protocols.VSAbstractProtocol; -import serialize.*; //import utils.*; +import serialize.VSNotSerializable; +import serialize.VSSerializable; +import serialize.VSSerialize; /** * The class VSTask, an object of this class represents a task to do or done. @@ -44,10 +28,7 @@ import serialize.*; * * @author Paul C. Buetow */ -public class VSTask implements Comparable, VSSerializable { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - +public class VSTask implements Comparable, VSSerializable { /** The Constant LOCAL. Used for the constructor if it's a local timed * task. */ @@ -450,9 +431,9 @@ public class VSTask implements Comparable, VSSerializable { ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(process.getProcessNum())); + objectOutputStream.writeObject(Integer.valueOf(process.getProcessNum())); if (event.getClassname() == null) event.init(process); @@ -461,22 +442,21 @@ public class VSTask implements Comparable, VSSerializable { System.out.println("Serializing: " + event.getClassname()); objectOutputStream.writeObject(event.getClassname()); - objectOutputStream.writeObject(new Integer(event.getID())); + objectOutputStream.writeObject(Integer.valueOf(event.getID())); event.serialize(serialize, objectOutputStream); - objectOutputStream.writeObject(new Integer(taskNum)); - objectOutputStream.writeObject(new Long(taskTime)); - objectOutputStream.writeObject(new Boolean(isGlobalTimed)); - objectOutputStream.writeObject(new Boolean(isProgrammed)); + objectOutputStream.writeObject(Integer.valueOf(taskNum)); + objectOutputStream.writeObject(Long.valueOf(taskTime)); + objectOutputStream.writeObject(Boolean.valueOf(isGlobalTimed)); + objectOutputStream.writeObject(Boolean.valueOf(isProgrammed)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 643462a..f2ad734 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -1,36 +1,17 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 -2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core; -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.PriorityQueue; -import prefs.*; -import serialize.*; -import simulator.*; -import utils.*; +import prefs.VSPrefs; +import serialize.VSSerializable; +import serialize.VSSerialize; +import simulator.VSSimulatorVisualization; +import utils.VSPriorityQueue; /** * The class VSTaskManager, it is responsible that all tasks will get @@ -40,9 +21,6 @@ import utils.*; * @author Paul C. Buetow */ public class VSTaskManager implements VSSerializable { - /** The seriao version uid */ - private static final long serialVersionUID = 1L; - /** The simulator canvas. */ private VSSimulatorVisualization simulatorVisualization; @@ -510,7 +488,7 @@ public class VSTaskManager implements VSSerializable { ObjectOutputStream objectOutputStream) throws IOException { /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); ArrayList serializeThoseTasks = new ArrayList(); @@ -538,19 +516,18 @@ public class VSTaskManager implements VSSerializable { } objectOutputStream.writeObject( - new Integer(serializeThoseTasks.size())); + Integer.valueOf(serializeThoseTasks.size())); for (VSTask task : serializeThoseTasks) task.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/core/time/VSLamportTime.java b/sources/core/time/VSLamportTime.java index 5716f2b..be1226b 100644 --- a/sources/core/time/VSLamportTime.java +++ b/sources/core/time/VSLamportTime.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core.time; /** @@ -29,9 +6,6 @@ package core.time; * @author Paul C. Buetow */ public class VSLamportTime implements VSTime { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** Specified the global time of the lamport timestamp. It's used for * correct painting position in the simulator canvas paint area. */ diff --git a/sources/core/time/VSTime.java b/sources/core/time/VSTime.java index b689f34..d46e0e4 100644 --- a/sources/core/time/VSTime.java +++ b/sources/core/time/VSTime.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core.time; /** diff --git a/sources/core/time/VSVectorTime.java b/sources/core/time/VSVectorTime.java index de9deeb..4e63b3c 100644 --- a/sources/core/time/VSVectorTime.java +++ b/sources/core/time/VSVectorTime.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package core.time; import java.util.ArrayList; @@ -112,7 +89,7 @@ public class VSVectorTime extends ArrayList implements VSTime { */ public Long get(int index) { if (index >= super.size()) - return new Long(0); + return Long.valueOf(0); return super.get(index); } diff --git a/sources/events/VSAbstractEvent.java b/sources/events/VSAbstractEvent.java index 934fbcf..f61f76f 100644 --- a/sources/events/VSAbstractEvent.java +++ b/sources/events/VSAbstractEvent.java @@ -1,36 +1,15 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import core.VSAbstractProcess; import core.VSInternalProcess; -import exceptions.*; -import prefs.*; -import serialize.*; +import exceptions.VSEventNotCopyableException; +import prefs.VSPrefs; +import prefs.VSSerializablePrefs; +import serialize.VSSerialize; /** * The class VSAbstractEvent. This abstract class defines the basic framework @@ -40,9 +19,6 @@ import serialize.*; * @author Paul C. Buetow */ abstract public class VSAbstractEvent extends VSSerializablePrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The prefs. */ public VSPrefs prefs; @@ -224,21 +200,20 @@ abstract public class VSAbstractEvent extends VSSerializablePrefs { System.out.println("Serializing: VSAbstractEvent; id="+getID()); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); - objectOutputStream.writeObject(new Integer(super.getID())); + objectOutputStream.writeObject(Integer.valueOf(super.getID())); objectOutputStream.writeObject(eventShortname); objectOutputStream.writeObject(eventClassname); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/events/VSCopyableEvent.java b/sources/events/VSCopyableEvent.java index 5862c6d..23125ce 100644 --- a/sources/events/VSCopyableEvent.java +++ b/sources/events/VSCopyableEvent.java @@ -1,29 +1,5 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events; - /** * The interface VSCopyableEvent, all events which implement this class * are copyable. diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java index 0c53e98..57c28c7 100644 --- a/sources/events/VSRegisteredEvents.java +++ b/sources/events/VSRegisteredEvents.java @@ -1,33 +1,14 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Set; +import java.util.Vector; -import prefs.*; -import core.*; -import utils.*; +import core.VSInternalProcess; +import prefs.VSPrefs; +import utils.VSClassLoader; /** * The class VSRegisteredEvents. This class is responsible to manage all @@ -38,9 +19,6 @@ import utils.*; * @author Paul C. Buetow */ public final class VSRegisteredEvents { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The event classnames by eventnames. */ private static HashMap eventClassnamesByNames = new HashMap(); @@ -80,37 +58,6 @@ public final class VSRegisteredEvents { */ public static void init(VSPrefs prefs_) { prefs = prefs_; - - /* - registerEvent("events.implementations.VSProcessCrashEvent", - "Prozessabsturz"); - registerEvent("events.implementations.VSProcessRecoverEvent", - "Prozesswiederbelebung"); - registerEvent("protocols.implementations.VSBasicMulticastProtocol", - "Basic Multicast", "Basic Multicast"); - registerEvent("protocols.implementations.VSBerkelyTimeProtocol", - "Berkeley Algorithmus zur internen Sync.", "Berkeley"); - registerEvent("protocols.implementations.VSBroadcastProtocol", - "Broadcast"); - registerEvent("protocols.implementations.VSDummyProtocol", - "Beispiel/Dummy"); - registerEvent("protocols.implementations.VSExternalTimeSyncProtocol", - "Christians Methode zur externen Sync.", "Christians"); - registerEvent("protocols.implementations.VSInternalTimeSyncProtocol", - "Interne Synchronisation", "Interne Sync."); - registerEvent("protocols.implementations.VSOnePhaseCommitProtocol", - "Ein-Phasen Commit", "1-Phasen Commit"); - registerEvent("protocols.implementations.VSPingPongProtocol", - "Ping Pong"); - registerEvent("protocols.implementations.VSReliableMulticastProtocol", - "Reliable Multicast", "Reliable Multicast"); - registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol", - "Zwei-Phasen Commit", "2-Phasen Commit"); - */ - - /* Using the NEW way. The old way above (specifying protocol names - in this file still works as well */ - registerEvent("events.implementations.VSProcessCrashEvent"); registerEvent("events.implementations.VSProcessRecoverEvent"); registerEvent("protocols.implementations.VSBasicMulticastProtocol"); @@ -161,7 +108,7 @@ public final class VSRegisteredEvents { if (serverProtocol.hasOnServerStart()) isOnServerStartProtocol.put(protocolClassname, - new Boolean(true)); + Boolean.valueOf(true)); } } } @@ -379,16 +326,6 @@ public final class VSRegisteredEvents { registerEvent(eventClassname, eventName, eventShortname); } - /** - * Registers an event. - * - * @param eventClassname the event classname - * @param eventName the event name - */ - private static void registerEvent(String eventClassname, String eventName) { - registerEvent(eventClassname, eventName, null); - } - /** * Registers an event. * diff --git a/sources/events/implementations/VSProcessCrashEvent.java b/sources/events/implementations/VSProcessCrashEvent.java index 84c4b36..d9d4df1 100644 --- a/sources/events/implementations/VSProcessCrashEvent.java +++ b/sources/events/implementations/VSProcessCrashEvent.java @@ -1,31 +1,8 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events.implementations; -import events.*; -import simulator.*; +import events.VSAbstractEvent; +import events.VSCopyableEvent; +import simulator.VSMain; /** * The class VSProcessCrashEvent. This event makes a process to crash. @@ -34,9 +11,6 @@ import simulator.*; */ public class VSProcessCrashEvent extends VSAbstractEvent implements VSCopyableEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* (non-Javadoc) * @see events.VSCopyableEvent#initCopy(events.VSAbstractEvent) */ diff --git a/sources/events/implementations/VSProcessRecoverEvent.java b/sources/events/implementations/VSProcessRecoverEvent.java index 9aba31d..fc47bbd 100644 --- a/sources/events/implementations/VSProcessRecoverEvent.java +++ b/sources/events/implementations/VSProcessRecoverEvent.java @@ -1,31 +1,8 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events.implementations; -import events.*; -import simulator.*; +import events.VSAbstractEvent; +import events.VSCopyableEvent; +import simulator.VSMain; /** * The class VSProcessRecoverEvent. This event makes a process to recover if @@ -35,9 +12,6 @@ import simulator.*; */ public class VSProcessRecoverEvent extends VSAbstractEvent implements VSCopyableEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* (non-Javadoc) * @see events.VSCopyableEvent#initCopy(events.VSAbstractEvent) */ diff --git a/sources/events/internal/VSAbstractInternalEvent.java b/sources/events/internal/VSAbstractInternalEvent.java index 3d2d6b3..e8e2d13 100644 --- a/sources/events/internal/VSAbstractInternalEvent.java +++ b/sources/events/internal/VSAbstractInternalEvent.java @@ -1,30 +1,8 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events.internal; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import events.VSAbstractEvent; import serialize.VSSerialize; @@ -36,14 +14,11 @@ import serialize.VSSerialize; * @author Paul C. Buetow */ abstract public class VSAbstractInternalEvent extends VSAbstractEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /* (non-Javadoc) * @see events.VSAbstractEvent#createShortname()() */ protected String createShortname(String savedShortname) { - return savedShortname; + return savedShortname; } /* (non-Javadoc) @@ -56,17 +31,16 @@ abstract public class VSAbstractInternalEvent extends VSAbstractEvent { super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java index c7f9113..323a6d8 100644 --- a/sources/events/internal/VSMessageReceiveEvent.java +++ b/sources/events/internal/VSMessageReceiveEvent.java @@ -1,30 +1,5 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events.internal; -//import java.io.*; - import core.VSMessage; import protocols.VSAbstractProtocol; import serialize.VSNotSerializable; @@ -37,8 +12,6 @@ import serialize.VSNotSerializable; */ public class VSMessageReceiveEvent extends VSAbstractInternalEvent implements VSNotSerializable { - /** The serioal version uid */ - private static final long serialVersionUID = 1L; /** The message. */ private VSMessage message; @@ -63,8 +36,7 @@ public class VSMessageReceiveEvent extends VSAbstractInternalEvent * @see events.VSAbstractEvent#onStart() */ public void onStart() { - boolean onlyRelevantMessages = process.getPrefs().getBoolean( - "sim.messages.relevant"); + boolean onlyRelevantMessages = process.getPrefs().getBoolean("sim.messages.relevant"); //String eventName = message.getName(); String protocolClassname = message.getProtocolClassname(); diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java index f9a531c..c39b639 100644 --- a/sources/events/internal/VSProtocolEvent.java +++ b/sources/events/internal/VSProtocolEvent.java @@ -1,33 +1,13 @@ -/* - * VS-Simulator (http://buetow.org) - * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events.internal; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import core.VSInternalProcess; -import events.*; +import events.VSAbstractEvent; +import events.VSCopyableEvent; +import events.VSRegisteredEvents; import protocols.VSAbstractProtocol; import serialize.VSSerialize; @@ -42,9 +22,6 @@ import serialize.VSSerialize; */ public class VSProtocolEvent extends VSAbstractInternalEvent implements VSCopyableEvent { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The protocol classname. */ private String protocolClassname; @@ -160,21 +137,20 @@ public class VSProtocolEvent extends VSAbstractInternalEvent super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); objectOutputStream.writeObject(protocolClassname); - objectOutputStream.writeObject(new Boolean(isClientProtocol)); - objectOutputStream.writeObject(new Boolean(isProtocolActivation)); + objectOutputStream.writeObject(Boolean.valueOf(isClientProtocol)); + objectOutputStream.writeObject(Boolean.valueOf(isProtocolActivation)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/events/internal/VSProtocolScheduleEvent.java b/sources/events/internal/VSProtocolScheduleEvent.java index 6a0eed5..9c708ad 100644 --- a/sources/events/internal/VSProtocolScheduleEvent.java +++ b/sources/events/internal/VSProtocolScheduleEvent.java @@ -1,33 +1,12 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package events.internal; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; -//import events.*; import protocols.VSAbstractProtocol; -import serialize.*; +import serialize.VSNotSerializable; +import serialize.VSSerialize; /** * The class VSProtocolScheduleEvent, this event is used if a protocol (which @@ -38,9 +17,6 @@ import serialize.*; */ public class VSProtocolScheduleEvent extends VSAbstractInternalEvent implements VSNotSerializable { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** The event is a server protocol schedule. */ private boolean isServerSchedule; /* true = server, false = client */ @@ -125,17 +101,16 @@ public class VSProtocolScheduleEvent extends VSAbstractInternalEvent super.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); /** For later backwards compatibility, to add more stuff */ - objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(Boolean.valueOf(false)); } /* (non-Javadoc) * @see serialize.VSSerializable#deserialize(serialize.VSSerialize, * java.io.ObjectInputStream) */ - @SuppressWarnings("unchecked") public synchronized void deserialize(VSSerialize serialize, ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { diff --git a/sources/exceptions/VSEventNotCopyableException.java b/sources/exceptions/VSEventNotCopyableException.java index 3eb89e6..f542db8 100644 --- a/sources/exceptions/VSEventNotCopyableException.java +++ b/sources/exceptions/VSEventNotCopyableException.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package exceptions; /** diff --git a/sources/exceptions/VSNegativeNumberException.java b/sources/exceptions/VSNegativeNumberException.java index 890ca71..edf2049 100644 --- a/sources/exceptions/VSNegativeNumberException.java +++ b/sources/exceptions/VSNegativeNumberException.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package exceptions; /** diff --git a/sources/exceptions/VSParseIntegerVectorException.java b/sources/exceptions/VSParseIntegerVectorException.java index 0fa61c1..19c2b82 100644 --- a/sources/exceptions/VSParseIntegerVectorException.java +++ b/sources/exceptions/VSParseIntegerVectorException.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package exceptions; /** diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java index dfb2d2c..cfa579c 100644 --- a/sources/prefs/VSDefaultPrefs.java +++ b/sources/prefs/VSDefaultPrefs.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package prefs; import java.awt.Color; @@ -33,9 +10,6 @@ import java.awt.event.KeyEvent; * @author Paul C. Buetow */ public class VSDefaultPrefs extends VSSerializablePrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Inits a prefs object with default values. * diff --git a/sources/prefs/VSDefaultPrefsDE.java b/sources/prefs/VSDefaultPrefsDE.java index cffa009..fb2eacb 100644 --- a/sources/prefs/VSDefaultPrefsDE.java +++ b/sources/prefs/VSDefaultPrefsDE.java @@ -1,26 +1,3 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package prefs; import java.awt.Color; @@ -33,9 +10,6 @@ import java.awt.event.KeyEvent; * @author Paul C. Buetow */ public class VSDefaultPrefsDE extends VSSerializablePrefs { - /** The serial version uid */ - private static final long serialVersionUID = 1L; - /** * Inits a prefs object with default values. * @@ -72,7 +46,7 @@ public class VSDefaultPrefsDE extends VSSerializablePrefs { */ public void fillDefaultStrings() { initString("lang.de.about", "About"); - initString("lang.de.about.info", "Dieses Programm wurde von Paul Bütow im Rahmen der Diplomarbeit \"Objektorientierte Entwicklung eines GUI-basierten Tools für die ereignisbasierte Simulator verteilter Systeme\" bei Prof. Dr.-Ing. Oßmann als 1. Prüfer sowie Betreuer und Prof. Dr. rer. nat. Fassbender als 2. Prüfer erstellt. Bei Fehlern bitte eine kurze Mail mit Fehlerbeschreibung an vs@paul.buetow.org schicken!"); + initString("lang.de.about.info", "Dieses Programm wurde von Paul Bütow im Rahmen der Diplomarbeit \"Objektorientierte Entwicklung eines GUI-basierten Tools für die ereignisbasierte Simulator verteilter Systeme\" bei Prof. Dr.-Ing. Oßmann als 1. Prüfer sowie Betreuer und Prof. Dr. rer. nat. Fassbender als 2. Prüfer erstellt. Bei Fehlern bitte eine kurze Mail mit Fehlerbeschreibung an paul at buetow punkt org schicken!"); initString("lang.de.activate", "aktivieren"); initString("lang.de.activated", "aktiviert"); initString("lang.de.actualize", "Aktualisieren"); diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java index 9f3be24..ea128df 100644 --- a/sources/prefs/VSPrefs.java +++ b/sources/prefs/VSPrefs.java @@ -1,33 +1,16 @@ -/* - * Copyright (c) 2008 Paul C. Buetow, vs-sim@dev.buetow.org - * - * 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. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * - * The icon's homepage is http://code.google.com/p/ultimate-gnome/ - */ - package prefs; import java.awt.Color; -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Set; +import java.util.Vector; -import serialize.*; +import serialize.VSSerialize; /** * The class VSPrefs, this class is for dynamic data storage. It can hold @@ -36,9 +19,6 @@ import serialize.*; * @author Paul C. Buetow */ public class VSPrefs { - /** Check if we want to overwrite description strings */ - //private boolean useDefaultStrings = false; - /** The Constant BOOLEAN_PREFIX. */ public static final String BOOLEAN_PREFIX = "Boolean: "; @@ -93,9 +73,6 @@ public class VSPrefs { /** The units. */ private HashMap units; - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 4L; - /** The id counter. */ private static int idCounter; @@ -293,7 +270,7 @@ public class VSPrefs { Boolean val = booleanPrefs.get(key); if (val == null) - return new Boolean(false); + return Boolean.valueOf(false); return val; } @@ -316,7 +293,7 @@ public class VSPrefs { * @param val the val */ public void initBoolean(String key, boolean val) { - initBoolean(key, new Boolean(val)); + initBoolean(key, Boolean.valueOf(val)); } /** @@ -348,7 +325,7 @@ public class VSPrefs { * @param val the val */ public void setBoolean(String key, boolean val) { - setBoolean(key, new Boolean(val)); + setBoolean(key, Boolean.valueOf(val)); } /* Color methods */ @@ -473,7 +450,7 @@ public class VSPrefs { * @param val the val */ public void initFloat(String key, float val) { - initFloat(key, new Float(val)); + initFloat(key, Float.valueOf(val));