From: Roland Haeder Date: Fri, 4 Sep 2015 14:41:02 +0000 (+0200) Subject: More cleanup from TDGP usage and towards EJB X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=075a4bae91899f52d74c5b5d511e7004cac950bd;p=jfinancials-lib.git More cleanup from TDGP usage and towards EJB Signed-off-by:Roland Häder --- diff --git a/lib/jcore.jar b/lib/jcore.jar index 61bf6e6..cadeea9 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jswingcore.jar b/lib/jswingcore.jar index fd42968..960b58d 100644 Binary files a/lib/jswingcore.jar and b/lib/jswingcore.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index cd3475f..f004ceb 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -32,21 +32,21 @@ endorsed.classpath= excludes= file.reference.commons-codec-1.10.jar=lib/commons-codec-1.10.jar file.reference.commons-lang3-3.4.jar=lib/commons-lang3-3.4.jar +file.reference.jcore.jar=lib/jcore.jar file.reference.jswingcore.jar=lib/jswingcore.jar file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar -file.reference.jcore.jar=./lib/jcore.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false jar.index=${jnlp.enabled} javac.classpath=\ - ${file.reference.log4j-api-2.3.jar}:\ - ${file.reference.log4j-core-2.3.jar}:\ ${file.reference.jcore.jar}:\ + ${file.reference.jswingcore.jar}:\ ${file.reference.commons-codec-1.10.jar}:\ ${file.reference.commons-lang3-3.4.jar}:\ - ${file.reference.jswingcore.jar} + ${file.reference.log4j-api-2.3.jar}:\ + ${file.reference.log4j-core-2.3.jar} # Space-separated list of extra javac options javac.compilerargs=-Xlint:deprecation -Xlint:unchecked javac.deprecation=true @@ -102,7 +102,5 @@ run.test.classpath=\ source.encoding=UTF-8 source.reference.jcore.jar=../jcore/src/ source.reference.jswingcore.jar=../jswingcore/src/ -source.reference.log4j-api-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-api-2.3-sources.jar -source.reference.log4j-core-2.3.jar=/home/quix0r/MyProjects/JARs/log4j-core-2.3-sources.jar src.dir=src test.src.dir=test diff --git a/src/org/mxchange/addressbook/application/AddressbookApplication.java b/src/org/mxchange/addressbook/application/AddressbookApplication.java index 9a17d06..21af430 100644 --- a/src/org/mxchange/addressbook/application/AddressbookApplication.java +++ b/src/org/mxchange/addressbook/application/AddressbookApplication.java @@ -150,7 +150,7 @@ public class AddressbookApplication extends BaseAddressbookSystem implements App this.initProperties(); // Is the bundle initialized? - if (!this.isBundledInitialized()) { + if (!isBundledInitialized()) { // Temporary initialize default bundle // TODO The enum Gender uses this this.initBundle(); diff --git a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java index f14cd81..3c5a8f6 100644 --- a/src/org/mxchange/addressbook/client/BaseAddressbookClient.java +++ b/src/org/mxchange/addressbook/client/BaseAddressbookClient.java @@ -24,7 +24,6 @@ import org.mxchange.addressbook.manager.contact.AddressbookContactManager; import org.mxchange.addressbook.menu.Menu; import org.mxchange.jcore.client.BaseClient; import org.mxchange.jcore.client.Client; -import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.jcore.manager.database.ManageableDatabase; /** @@ -106,10 +105,9 @@ public abstract class BaseAddressbookClient extends BaseClient { /** * Initializes contact manager - * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the database backend is not supported * @throws java.sql.SQLException If any SQL error occurs */ - protected void initContactManager () throws UnsupportedDatabaseBackendException, SQLException { + protected void initContactManager () throws SQLException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N diff --git a/src/org/mxchange/addressbook/client/console/ConsoleClient.java b/src/org/mxchange/addressbook/client/console/ConsoleClient.java index dd7eee8..6b08d12 100644 --- a/src/org/mxchange/addressbook/client/console/ConsoleClient.java +++ b/src/org/mxchange/addressbook/client/console/ConsoleClient.java @@ -36,10 +36,7 @@ import org.mxchange.addressbook.menu.item.console.ConsoleMenuItem; import org.mxchange.jcore.application.Application; import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.gender.Gender; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; -import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; /** * A client for the console @@ -396,7 +393,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC // TODO throw own exception throw new UnhandledUserChoiceException(MessageFormat.format("Choice '{0}' not handled yet.", choice)); //NOI18N } - } catch (final IOException | BadTokenException | CorruptedDatabaseFileException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + } catch (final IOException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { // Something bad happened this.abortProgramWithException(ex); } @@ -575,7 +572,7 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC // Init contact manager here try { this.initContactManager(); - } catch (final UnsupportedDatabaseBackendException | SQLException ex) { + } catch (final SQLException ex) { // End here this.abortProgramWithException(ex); } diff --git a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java index 8df0da3..7c85fc4 100644 --- a/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java +++ b/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java @@ -54,8 +54,6 @@ import org.mxchange.addressbook.manager.contact.ManageableAddressbookContact; import org.mxchange.jcore.client.Client; import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.gender.Gender; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException; import org.mxchange.jswingcore.client.gui.ClientFrame; import org.mxchange.jswingcore.model.swing.contact.ContactTableModel; @@ -212,7 +210,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra * @param client Client instance */ @Override - public void setupFrame (final Client client) throws IOException, BadTokenException { + public void setupFrame (final Client client) throws IOException { // Debug line this.getLogger().trace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N @@ -681,7 +679,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra // Already added, log away // TODO maybe output message here? self.logException(ex); - } catch (final IOException | BadTokenException ex) { + } catch (final IOException ex) { // Somethind bad happened here // TODO Output error message here? } @@ -705,7 +703,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra public void actionPerformed (final ActionEvent e) { try { ((ManageableAddressbookContact) self.getClient().getManager()).doChangeOwnData(); - } catch (final IOException | BadTokenException | CorruptedDatabaseFileException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + } catch (final IOException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { self.logException(ex); } } diff --git a/src/org/mxchange/addressbook/client/gui/SwingClient.java b/src/org/mxchange/addressbook/client/gui/SwingClient.java index 09765d1..b66b07c 100644 --- a/src/org/mxchange/addressbook/client/gui/SwingClient.java +++ b/src/org/mxchange/addressbook/client/gui/SwingClient.java @@ -25,10 +25,8 @@ import org.mxchange.addressbook.menu.item.SelectableMenuItem; import org.mxchange.jcore.application.Application; import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.gender.Gender; -import org.mxchange.jcore.exceptions.BadTokenException; import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; -import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.jswingcore.client.gui.ClientFrame; /** @@ -190,7 +188,7 @@ public class SwingClient extends BaseAddressbookClient implements AddressbookCli // Now start the frame this.frame.setupFrame(this); - } catch (final FrameAlreadyInitializedException | UnsupportedDatabaseBackendException | IOException | BadTokenException | SQLException ex) { + } catch (final FrameAlreadyInitializedException | IOException | SQLException ex) { // Abort program this.abortProgramWithException(ex); } diff --git a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java index 23ca2f2..18c8bd4 100644 --- a/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java +++ b/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java @@ -29,12 +29,7 @@ import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException; import org.mxchange.jcore.client.Client; import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.gender.Gender; -import org.mxchange.jcore.database.frontend.DatabaseFrontend; -import org.mxchange.jcore.database.storage.Storable; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jcore.exceptions.UnhandledUserChoiceException; -import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException; import org.mxchange.jcore.manager.BaseManager; /** @@ -60,10 +55,9 @@ public class AddressbookContactManager extends BaseManager implements Manageable * a client instance. * * @param client Client instance to use - * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the configured database backend is not supported * @throws java.sql.SQLException If an SQL error occurs */ - public AddressbookContactManager (final Client client) throws UnsupportedDatabaseBackendException, SQLException { + public AddressbookContactManager (final Client client) throws SQLException { // Trace message this.getLogger().trace(MessageFormat.format("client={1} - CALLED!", client)); //NOI18N @@ -240,7 +234,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable * Allows the user to change his/her own data */ @Override - public void doChangeOwnData () throws IOException , BadTokenException, CorruptedDatabaseFileException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{ + public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException{ // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -291,7 +285,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable * Asks user for own data */ @Override - public void doEnterOwnData () throws ContactAlreadyAddedException, IOException , BadTokenException { + public void doEnterOwnData () throws ContactAlreadyAddedException, IOException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -641,7 +635,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable * @return Whether own contact is already added */ @Override - public boolean isOwnContactAdded () throws IOException, BadTokenException { + public boolean isOwnContactAdded () throws IOException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N @@ -651,7 +645,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable try { // Deligate this call to frontend isAdded = ((AddressbookContactFrontend) this.getFrontend()).isOwnContactFound(); - } catch (final SQLException | IOException | BadTokenException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + } catch (final SQLException | IOException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { // Something bad happened this.abortProgramWithException(ex); } @@ -694,7 +688,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable // Add contact to internal list this.addContact(contact); - } catch (final ContactAlreadyAddedException | BadTokenException | SQLException | IOException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { + } catch (final ContactAlreadyAddedException | SQLException | IOException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { // Abort here this.abortProgramWithException(ex); } @@ -770,13 +764,11 @@ public class AddressbookContactManager extends BaseManager implements Manageable * @return Contact instance or null * @throws java.sql.SQLException If an SQL error occurs * @throws java.io.IOException If an IO error occurs - * @throws org.mxchange.jcore.exceptions.BadTokenException Continued throw - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged * @throws java.lang.NoSuchMethodException If a method cannot be found * @throws java.lang.IllegalAccessException If a method is not accessible * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - private Contact getOwnContact () throws IOException, BadTokenException, CorruptedDatabaseFileException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + private Contact getOwnContact () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace("CALLED!"); //NOI18N diff --git a/src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java b/src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java index 9e12e75..dccb8af 100644 --- a/src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java +++ b/src/org/mxchange/addressbook/manager/contact/ManageableAddressbookContact.java @@ -22,8 +22,6 @@ import java.sql.SQLException; import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException; import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.gender.Gender; -import org.mxchange.jcore.exceptions.BadTokenException; -import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException; import org.mxchange.jcore.manager.database.ManageableDatabase; /** @@ -180,13 +178,11 @@ public interface ManageableAddressbookContact extends ManageableDatabase { * Let the user change own data * @throws java.sql.SQLException If an SQL error occurs * @throws java.io.IOException If an IO error occurs - * @throws org.mxchange.jcore.exceptions.BadTokenException Continued throw - * @throws org.mxchange.jcore.exceptions.CorruptedDatabaseFileException If the database file is damaged * @throws java.lang.NoSuchMethodException If a method cannot be found * @throws java.lang.IllegalAccessException If a method is not accessible * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - public void doChangeOwnData () throws IOException , BadTokenException, CorruptedDatabaseFileException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public void doChangeOwnData () throws IOException , SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Let the user delete other address @@ -197,9 +193,8 @@ public interface ManageableAddressbookContact extends ManageableDatabase { * Asks user for own data * @throws org.mxchange.addressbook.exceptions.ContactAlreadyAddedException If own contact is already added * @throws java.io.IOException If an IO error was found - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found */ - public void doEnterOwnData () throws ContactAlreadyAddedException, IOException , BadTokenException; + public void doEnterOwnData () throws ContactAlreadyAddedException, IOException; /** * Searches address book for a contact @@ -212,7 +207,6 @@ public interface ManageableAddressbookContact extends ManageableDatabase { * * @return Whether own contact is already added * @throws java.io.IOException If an IO error occurs - * @throws org.mxchange.jcore.exceptions.BadTokenException If a bad token was found */ - public boolean isOwnContactAdded () throws IOException, BadTokenException; + public boolean isOwnContactAdded () throws IOException; }