Patch provided by Matthieu Casanova on dev@sip-communicator.dev.java.net with subject: "[PATCH] Fix for suspicious String comparison" on 19/02/2010.

cusax-fix
Yana Stamcheva 16 years ago
parent b3d407ef71
commit 63f857a922

@ -719,8 +719,8 @@
<sysproperty key="java.net.preferIPv6Addresses"
value="${java.net.preferIPv6Addresses}"/>
<!--sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${user.home}/schome"/-->
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${user.home}/schome"/>
<!-- Setting properties necessary for dependencies on native libs.-->
<sysproperty key="java.library.path"

@ -210,7 +210,7 @@ private void initDates()
*/
public void showHistoryByPeriod(Date startDate, Date endDate)
{
if((searchKeyword == null || searchKeyword == "")
if((searchKeyword == null || searchKeyword.length() == 0)
&& dateHistoryTable.containsKey(startDate))
{
HTMLDocument document = dateHistoryTable.get(startDate);
@ -588,7 +588,7 @@ public void run()
{
HTMLDocument doc = createHistory(msgList);
if(searchKeyword == null || searchKeyword == "")
if(searchKeyword == null || searchKeyword.length() == 0)
{
dateHistoryTable.put(startDate, doc);
}

@ -191,27 +191,27 @@ public ProtocolProviderService installAccount(
}
if (registration.getProxy() != null
&& registration.getProxy() != "")
&& registration.getProxy().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS,
registration.getProxy());
if (registration.getProxyPort() != null
&& registration.getProxyPort() != "")
&& registration.getProxyPort().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_PORT,
registration.getProxyPort());
if (registration.getProxyType() != null
&& registration.getProxyType() != "")
&& registration.getProxyType().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_TYPE,
registration.getProxyType());
if (registration.getProxyUsername() != null
&& registration.getProxyUsername() != "")
&& registration.getProxyUsername().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_USERNAME,
registration.getProxyUsername());
if (registration.getProxyPassword() != null
&& registration.getProxyPassword() != "")
&& registration.getProxyPassword().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_PASSWORD,
registration.getProxyPassword());

@ -186,27 +186,27 @@ public ProtocolProviderService installAccount(
}
if (registration.getProxy() != null
&& registration.getProxy() != "")
&& registration.getProxy().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS,
registration.getProxy());
if (registration.getProxyPort() != null
&& registration.getProxyPort() != "")
&& registration.getProxyPort().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_PORT,
registration.getProxyPort());
if (registration.getProxyType() != null
&& registration.getProxyType() != "")
&& registration.getProxyType().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_TYPE,
registration.getProxyType());
if (registration.getProxyUsername() != null
&& registration.getProxyUsername() != "")
&& registration.getProxyUsername().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_USERNAME,
registration.getProxyUsername());
if (registration.getProxyPassword() != null
&& registration.getProxyPassword() != "")
&& registration.getProxyPassword().length() != 0)
accountProperties.put(ProtocolProviderFactory.PROXY_PASSWORD,
registration.getProxyPassword());

@ -37,24 +37,27 @@ public class InvitationReceivedDialog
private JPanel dataPanel = new TransparentPanel(new BorderLayout(10, 10));
private JPanel buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.RIGHT));
private JPanel buttonsPanel
= new TransparentPanel(new FlowLayout(FlowLayout.RIGHT));
private JButton acceptButton
= new JButton(Resources.getString("service.gui.ACCEPT"));
private JButton rejectButton = new JButton(Resources.getString("service.gui.REJECT"));
private JButton ignoreButton = new JButton(Resources.getString("service.gui.IGNORE"));
private JButton rejectButton
= new JButton(Resources.getString("service.gui.REJECT"));
private JButton ignoreButton
= new JButton(Resources.getString("service.gui.IGNORE"));
private JPanel mainPanel = new TransparentPanel(new BorderLayout(10, 10));
private JPanel northPanel = new TransparentPanel(new BorderLayout(10, 10));
private JLabel iconLabel = new JLabel(Resources.getImage("inviteIcon"));
private String title
= Resources.getString("service.gui.INVITATION_RECEIVED");
/**
* The <tt>ChatRoomInvitation</tt> 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 <tt>ActionEvent</tt> triggered when one user clicks
* on one of the buttons.

Loading…
Cancel
Save