mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 15:45:25 +02:00
Bug 160195 - provide a workaround by capitalizing the name using a locale that preserves the letter identity as specified in RFC1035.
This commit is contained in:
parent
41f5e596c8
commit
aade4c37ca
2 changed files with 14 additions and 6 deletions
|
@ -74,7 +74,7 @@ public abstract class RSEModelObject extends PropertySetContainer implements IRS
|
|||
protected boolean compareStrings(String s1, String s2) {
|
||||
boolean result = false;
|
||||
if (s1 == null) {
|
||||
result = s1 == null;
|
||||
result = (s2 == null);
|
||||
} else {
|
||||
result = s1.equals(s2);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.eclipse.rse.internal.model;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.rse.core.IRSESystemType;
|
||||
|
@ -301,13 +303,19 @@ public class Host extends RSEModelObject implements IHost, IAdaptable
|
|||
}
|
||||
this.setSystemTypeGen(systemType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Intercept of setHostName so we can force it to uppercase
|
||||
* Intercept of setHostName so we can force it to uppercase.
|
||||
* IPv4 host names are case insensitive. Much data is stored using the host
|
||||
* name as part of the key. Therefore, the host name is capitalized here so that
|
||||
* these comparisons work naturally.
|
||||
* However, this must be done using the US locale since IPv4 host names
|
||||
* use can be compared using this locale. See RFC1035.
|
||||
*/
|
||||
public void setHostName(String name)
|
||||
{
|
||||
if (name != null)
|
||||
name = name.toUpperCase();
|
||||
public void setHostName(String name) {
|
||||
if (name != null) {
|
||||
name = name.toUpperCase(Locale.US);
|
||||
}
|
||||
this.setHostNameGen(name);
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue