mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 23:35:48 +02:00
[252708] using compareStrings() for more robust string compare
This commit is contained in:
parent
e927d71167
commit
763d194c23
1 changed files with 11 additions and 5 deletions
|
@ -101,16 +101,22 @@ public class SystemConnectionPropertyPage extends SystemBasePropertyPage
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasConnectionChanged(IHost conn){
|
private boolean hasConnectionChanged(IHost conn){
|
||||||
|
if (!compareStrings(conn.getName(), form.getConnectionName()) ||
|
||||||
if (!conn.getName().equals(form.getConnectionName()) ||
|
!compareStrings(conn.getHostName(), form.getHostName()) ||
|
||||||
!conn.getHostName().equals(form.getHostName()) ||
|
!compareStrings(conn.getDescription(), form.getConnectionDescription()) ||
|
||||||
!conn.getDescription().equals(form.getConnectionDescription()) ||
|
!compareStrings(conn.getDefaultUserId(), form.getDefaultUserId())){
|
||||||
!conn.getDefaultUserId().equals(form.getDefaultUserId())){
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean compareStrings(String str1, String str2){
|
||||||
|
if (str1 == null || str1.length() == 0)
|
||||||
|
return (str2 == null || str2.length() == 0);
|
||||||
|
else
|
||||||
|
return (str2 == null || str2.length() == 0) ? false: str1.equals(str2);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by parent when user presses OK
|
* Called by parent when user presses OK
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue