]> git.mxchange.org Git - addressbook-swing.git/commitdiff
removed old lost stuff
authorRoland Haeder <roland@mxchange.org>
Mon, 5 Oct 2015 11:12:10 +0000 (13:12 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 5 Oct 2015 11:12:10 +0000 (13:12 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/addressbook/client/console/ConsoleClient.java
src/org/mxchange/addressbook/client/gui/AddressbookFrame.java

index d5a2fbcf15b3c915eaeae204d4c8ccd68c5c1da6..f8cad4b2fce430d437638ec4b273d0bebd2d943b 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.addressbook.client.console;
 
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import java.text.MessageFormat;
 import java.util.Arrays;
@@ -325,60 +324,54 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                // Get manager and cast it
                ContactFacade manager = (ContactFacade) this.getFacade();
 
-               // Try it!
-               try {
-                       // TODO Rewrite this ugly switch() block
-                       switch (choice) {
-                               case '1':
-                                       try {
-                                               // Enter/add own data
-                                               manager.doEnterOwnData();
-                                       } catch (final ContactAlreadyAddedException ex) {
-                                               // Already added
-                                               this.outputMessage("Sie haben bereits Ihre eigenen Daten eingegeben.");
-                                       }
-                                       break;
-
-                               case '2': // Change own data
-                                       manager.doChangeOwnData();
-                                       break;
-
-                               case '3': // Add new addess
-                                       manager.doAddOtherAddress();
-                                       break;
-
-                               case '4': // List contacts
-                                       manager.doListContacts();
-                                       break;
-
-                               case '5': // Search addresses
-                                       manager.doSearchContacts();
-                                       break;
-
-                               case '6': // Change other addess
-                                       manager.doChangeOtherAddress();
-                                       break;
-
-                               case '7': // Delete other address
-                                       manager.doDeleteOtherAddress();
-                                       break;
-
-                               case '0':
-                                       try {
-                                               // Program exit
-                                               this.getApplication().doShutdown();
-                                       } catch (final SQLException | IOException ex) {
-                                               this.abortProgramWithException(ex);
-                                       }
-                                       break;
-
-                               default:
-                                       // TODO throw own exception
-                                       throw new UnhandledUserChoiceException(MessageFormat.format("Choice '{0}' not handled yet.", choice)); //NOI18N
-                       }
-               } catch (final IOException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
-                       // Something bad happened
-                       this.abortProgramWithException(ex);
+               // TODO Rewrite this ugly switch() block
+               switch (choice) {
+                       case '1':
+                               try {
+                                       // Enter/add own data
+                                       manager.doEnterOwnData();
+                               } catch (final ContactAlreadyAddedException ex) {
+                                       // Already added
+                                       this.outputMessage("Sie haben bereits Ihre eigenen Daten eingegeben.");
+                               }
+                               break;
+
+                       case '2': // Change own data
+                               manager.doChangeOwnData();
+                               break;
+
+                       case '3': // Add new addess
+                               manager.doAddOtherAddress();
+                               break;
+
+                       case '4': // List contacts
+                               manager.doListContacts();
+                               break;
+
+                       case '5': // Search addresses
+                               manager.doSearchContacts();
+                               break;
+
+                       case '6': // Change other addess
+                               manager.doChangeOtherAddress();
+                               break;
+
+                       case '7': // Delete other address
+                               manager.doDeleteOtherAddress();
+                               break;
+
+                       case '0':
+                               try {
+                                       // Program exit
+                                       this.getApplication().doShutdown();
+                               } catch (final SQLException | IOException ex) {
+                                       this.abortProgramWithException(ex);
+                               }
+                               break;
+
+                       default:
+                               // TODO throw own exception
+                               throw new UnhandledUserChoiceException(MessageFormat.format("Choice '{0}' not handled yet.", choice)); //NOI18N
                }
 
                // Trace message
index 68f80cd6216f7038f8bfd8029e838bb611d10fec..3f1f05a6a7b35b436eafe5502bb44cdc2d808246 100644 (file)
@@ -25,7 +25,6 @@ import java.awt.event.MouseEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import java.text.MessageFormat;
 import javax.swing.BorderFactory;
@@ -708,9 +707,6 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                                        // Already added, log away
                                        // TODO maybe output message here?
                                        self.logException(ex);
-                               } catch (final IOException ex) {
-                                       // Somethind bad happened here
-                                       // TODO Output error message here?
                                }
                        }
                });
@@ -730,11 +726,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                         */
                        @Override
                        public void actionPerformed (final ActionEvent e) {
-                               try {
-                                       ((ContactFacade) self.getClient().getFacade()).doChangeOwnData();
-                               } catch (final IOException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
-                                       self.logException(ex);
-                               }
+                               ((ContactFacade) self.getClient().getFacade()).doChangeOwnData();
                        }
                });