From a1624f461c02a038a378a03522f1be665dd2db21 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 5 Oct 2015 13:09:43 +0200 Subject: [PATCH] =?utf8?q?cleanup=20from=20previous=20TDGP=20Signed-off-by?= =?utf8?q?:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../contact/AddressbookContactFacade.java | 37 +++---------------- .../facade/contact/ContactFacade.java | 17 ++------- 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java b/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java index 67eaacc..592d5b7 100644 --- a/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java +++ b/src/org/mxchange/addressbook/facade/contact/AddressbookContactFacade.java @@ -17,7 +17,6 @@ package org.mxchange.addressbook.facade.contact; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.text.MessageFormat; import java.util.ArrayList; @@ -220,7 +219,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } @Override - public void doChangeOwnData () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public void doChangeOwnData () { // Trace message this.getLogger().logTrace("CALLED!"); //NOI18N @@ -265,7 +264,7 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } @Override - public void doEnterOwnData () throws ContactAlreadyAddedException, IOException { + public void doEnterOwnData () throws ContactAlreadyAddedException { // Trace message this.getLogger().logTrace("CALLED!"); //NOI18N @@ -480,36 +479,18 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } @Override - public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { + public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) { // Trace message this.getLogger().logTrace(MessageFormat.format("rowIndex={0},columnIndex={1} CALLED!", rowIndex, columnIndex)); //NOI18N - // Then get specific row from database which is a Contact instance - Storable storable = this.getFrontend().getStorableAtRow(rowIndex); - - // Debug message - this.getLogger().logDebug(MessageFormat.format("storable={0}", storable)); //NOI18N - - // It may return null - if (null == storable) { - // Nothing found - this.getLogger().logWarning("contact is null - returning null ..."); //NOI18N - return null; - } - // Convert column index -> name String columnName = this.getColumnName(columnIndex); // Debug message this.getLogger().logDebug(MessageFormat.format("columnName={0}", columnName)); //NOI18N - // Now get that column + // Init value Object value = null; - try { - value = storable.getValueFromColumn(columnName); - } catch (final IllegalArgumentException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { - this.abortProgramWithException(ex); - } // Trace message this.getLogger().logTrace(MessageFormat.format("value={0} - EXIT!", value)); //NOI18N @@ -519,21 +500,13 @@ public class AddressbookContactFacade extends BaseFacade implements ContactFacad } @Override - public boolean isOwnContactAdded () throws IOException { + public boolean isOwnContactAdded () { // Trace message this.getLogger().logTrace("CALLED!"); //NOI18N // Init variable boolean isAdded = false; - try { - // Deligate this call to frontend - isAdded = ((AddressbookContactFrontend) this.getFrontend()).isOwnContactFound(); - } catch (final SQLException | IOException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { - // Something bad happened - this.abortProgramWithException(ex); - } - // Trace message this.getLogger().logTrace(MessageFormat.format("isAdded={0} : EXIT!", isAdded)); //NOI18N diff --git a/src/org/mxchange/addressbook/facade/contact/ContactFacade.java b/src/org/mxchange/addressbook/facade/contact/ContactFacade.java index 7b206e8..aac08dd 100644 --- a/src/org/mxchange/addressbook/facade/contact/ContactFacade.java +++ b/src/org/mxchange/addressbook/facade/contact/ContactFacade.java @@ -17,8 +17,6 @@ package org.mxchange.addressbook.facade.contact; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.sql.SQLException; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; @@ -75,13 +73,8 @@ public interface ContactFacade extends Facade { /** * 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 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, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public void doChangeOwnData (); /** * Let the user delete other address @@ -94,7 +87,7 @@ public interface ContactFacade extends Facade { * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException If own contact is already added * @throws java.io.IOException If an IO error was found */ - public void doEnterOwnData () throws ContactAlreadyAddedException, IOException; + public void doEnterOwnData () throws ContactAlreadyAddedException; /** * List all contacts @@ -227,12 +220,8 @@ public interface ContactFacade extends Facade { * @param rowIndex Row index * @param columnIndex Column index * @return Value from given row/column - * @throws java.lang.NoSuchMethodException If the method was not found - * @throws java.lang.IllegalAccessException If the accessed method was not public - * @throws java.lang.reflect.InvocationTargetException Something else - * happened? TODO: This is needed for TableModel in Swing */ - public Object getValueFromRowColumn (final int rowIndex, final int columnIndex) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException; + public Object getValueFromRowColumn (final int rowIndex, final int columnIndex); /** * Checks whether own contact is already added by checking all entries for -- 2.39.2