]> git.mxchange.org Git - jaddressbook-share-lib.git/commitdiff
No need for a local variable
authorRoland Haeder <roland@mxchange.org>
Mon, 24 Aug 2015 12:22:26 +0000 (14:22 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 24 Aug 2015 12:22:26 +0000 (14:22 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

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

index 73dc71a1148e0bc85f2d1c7ca518975e0594d936..7a03338f8db9cfda7064ebfb0e8b048fe2a5c383 100644 (file)
@@ -216,11 +216,8 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                // Debug line
                this.getLogger().trace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
 
-               // Get and cast manager instance
-               ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getClient().getManager();
-
                // Has the user entered own data?
-               if (manager.isOwnContactAdded()) {
+               if (((ManageableAddressbookContact) self.getClient().getManager()).isOwnContactAdded()) {
                        // Debug message
                        this.getLogger().debug("Disabling menus: isOwnContactAdded()=false"); //NOI18N
 
@@ -679,8 +676,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                        @Override
                        public void actionPerformed (final ActionEvent e) {
                                try {
-                                       ManageableAddressbookContact manager = (ManageableAddressbookContact) self.getClient().getManager();
-                                       manager.doEnterOwnData();
+                                       ((ManageableAddressbookContact) self.getClient().getManager()).doEnterOwnData();
                                } catch (final ContactAlreadyAddedException ex) {
                                        // Already added, log away
                                        // @TODO maybe output message here?
@@ -707,9 +703,8 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                         */
                        @Override
                        public void actionPerformed (final ActionEvent e) {
-                               ManageableAddressbookContact manager = (ManageableAddressbookContact) self.getClient().getManager();
                                try {
-                                       manager.doChangeOwnData();
+                                       ((ManageableAddressbookContact) self.getClient().getManager()).doChangeOwnData();
                                } catch (final IOException | BadTokenException | CorruptedDatabaseFileException | SQLException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
                                        self.logException(ex);
                                }
@@ -729,8 +724,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                         */
                        @Override
                        public void actionPerformed (final ActionEvent e) {
-                               ManageableAddressbookContact manager = (ManageableAddressbookContact) self.getClient().getManager();
-                               manager.doAddOtherAddress();
+                               ((ManageableAddressbookContact) self.getClient().getManager()).doAddOtherAddress();
                        }
                });