From 63f857a92206bd3fcefd75cc6034d6a205134709 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Mon, 22 Feb 2010 14:21:06 +0000 Subject: [PATCH] Patch provided by Matthieu Casanova on dev@sip-communicator.dev.java.net with subject: "[PATCH] Fix for suspicious String comparison" on 19/02/2010. --- build.xml | 4 +- .../gui/main/chat/history/HistoryWindow.java | 4 +- .../AimAccountRegistrationWizard.java | 10 ++-- .../IcqAccountRegistrationWizard.java | 10 ++-- .../gui/InvitationReceivedDialog.java | 54 ++++++++++--------- 5 files changed, 44 insertions(+), 38 deletions(-) diff --git a/build.xml b/build.xml index 33f0efd98..213d64be6 100644 --- a/build.xml +++ b/build.xml @@ -719,8 +719,8 @@ - + ChatRoomInvitation for which this dialog is. */ @@ -103,7 +106,8 @@ public InvitationReceivedDialog (WhiteboardSessionManager whiteboardManager, invitation.getTargetWhiteboard() .getWhiteboardID()})); - if(invitation.getReason() != null && invitation.getReason() != "") + if(invitation.getReason() != null + && invitation.getReason().length() != 0) { invitationReasonTextArea.setText(invitation.getReason()); invitationReasonTextArea.setBorder( @@ -112,45 +116,47 @@ public InvitationReceivedDialog (WhiteboardSessionManager whiteboardManager, this.dataPanel.add(invitationReasonTextArea, BorderLayout.CENTER); } - + this.infoTextArea.setFont( infoTextArea.getFont().deriveFont(Font.BOLD, 12f)); this.infoTextArea.setLineWrap(true); this.infoTextArea.setOpaque(false); this.infoTextArea.setWrapStyleWord(true); this.infoTextArea.setEditable(false); - + this.northPanel.add(iconLabel, BorderLayout.WEST); this.northPanel.add(infoTextArea, BorderLayout.CENTER); - + this.reasonPanel.add(reasonLabel, BorderLayout.WEST); this.reasonPanel.add(reasonField, BorderLayout.CENTER); - + this.dataPanel.add(reasonPanel, BorderLayout.SOUTH); - + this.acceptButton.addActionListener(this); this.rejectButton.addActionListener(this); this.ignoreButton.addActionListener(this); - + this.buttonsPanel.add(acceptButton); this.buttonsPanel.add(rejectButton); this.buttonsPanel.add(ignoreButton); - + this.getRootPane().setDefaultButton(acceptButton); this.acceptButton.setMnemonic(Resources.getMnemonic("accept")); - this.rejectButton.setMnemonic(Resources.getMnemonic("service.gui.REJECT")); - this.ignoreButton.setMnemonic(Resources.getMnemonic("service.gui.IGNORE")); - + this.rejectButton.setMnemonic( + Resources.getMnemonic("service.gui.REJECT")); + this.ignoreButton.setMnemonic( + Resources.getMnemonic("service.gui.IGNORE")); + this.mainPanel.setBorder( BorderFactory.createEmptyBorder(15, 15, 15, 15)); - + this.mainPanel.add(northPanel, BorderLayout.NORTH); this.mainPanel.add(dataPanel, BorderLayout.CENTER); this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH); - + this.getContentPane().add(mainPanel); } - + /** * Handles the ActionEvent triggered when one user clicks * on one of the buttons.