From a7077acd05bfa3623d242838b8f12ae192e31e87 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Wed, 23 Sep 2009 17:15:27 +0000 Subject: [PATCH] - Removes a SuppressWarnings because its warning can be resolved gracefully. - Fixes a few javadocs. --- .../gui/main/call/TransferCallButton.java | 62 +++++++------------ 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java index e944c0b77..1d1c62761 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java @@ -103,12 +103,8 @@ private void actionPerformed(ActionListener listener, ActionEvent evt) { /* - * (non-Javadoc) - * - * @see net.java.sip.communicator.service.protocol.event. - * CallChangeAdapter - * #callStateChanged(net.java.sip.communicator - * .service.protocol.event.CallChangeEvent) + * Implements + * CallChangeAdapter#callStateChanged(CallChangeEvent). */ public void callStateChanged(CallChangeEvent evt) { @@ -137,18 +133,12 @@ public void callStateChanged(CallChangeEvent evt) { try { - CallPeer targetPeer = - findCallPeer(target); + CallPeer targetPeer = findCallPeer(target); if (targetPeer == null) - { telephony.transfer(callPeer, target); - } else - { - telephony.transfer(callPeer, - targetPeer); - } + telephony.transfer(callPeer, targetPeer); } catch (OperationFailedException ex) { @@ -161,36 +151,31 @@ public void callStateChanged(CallChangeEvent evt) } /** - * Returns the first CallPeer known to a specific - * OperationSetBasicTelephony to have a specific address. + * Returns the first CallPeer known to a specific + * OperationSetBasicTelephony to have a specific address. * - * @param telephony the OperationSetBasicTelephony to have its - * CallPeers examined in search for one which - * has a specific address - * @param address the address to locate the associated - * CallPeer of + * @param telephony the OperationSetBasicTelephony to have its + * CallPeers examined in search for one which has a specific + * address + * @param address the address to locate the associated CallPeer of + * @return the first CallPeer known to the specified + * OperationSetBasicTelephony to have the specified address */ - @SuppressWarnings("unchecked") //pfff ... well we can't make OpSetTelephony - //return a non-raw type iterator as it would break descendants that are using - //it with Call extensions. Someone would have to explain to me one day - //why java complains in such cases. private CallPeer findCallPeer( OperationSetBasicTelephony telephony, String address) { - for (Iterator callIter = telephony.getActiveCalls(); - callIter.hasNext();) + for (Iterator callIter = telephony.getActiveCalls(); + callIter.hasNext();) { Call call = callIter.next(); - for (Iterator peerIter = - call.getCallPeers(); peerIter.hasNext();) + for (Iterator peerIter = call.getCallPeers(); + peerIter.hasNext();) { CallPeer peer = peerIter.next(); if (address.equals(peer.getAddress())) - { return peer; - } } } return null; @@ -239,9 +224,7 @@ private CallPeer findCallPeer(String address) { peer = findCallPeer(telephony, address); if (peer != null) - { break; - } } } return peer; @@ -254,12 +237,12 @@ private CallPeer findCallPeer(String address) * The located Frame (if any) is often used as the owner of * Dialogs opened by the specified Component in * order to provide natural Frame ownership. - *

- * + * + * @param component the Component which is to have its + * Component hierarchy examined for Frame * @return the first Frame in the ancestor - * Component hierarchy of the specified - * Component; null, if no such - * Frame was located + * Component hierarchy of the specified Component; + * null, if no such Frame was located */ public static Frame getFrame(Component component) { @@ -268,9 +251,8 @@ public static Frame getFrame(Component component) Container container = component.getParent(); if (container instanceof Frame) - { return (Frame) container; - } + component = container; } return null;