1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 18:15:23 +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:
David Dykstal 2006-10-10 02:00:29 +00:00
parent 41f5e596c8
commit aade4c37ca
2 changed files with 14 additions and 6 deletions

View file

@ -74,7 +74,7 @@ public abstract class RSEModelObject extends PropertySetContainer implements IRS
protected boolean compareStrings(String s1, String s2) { protected boolean compareStrings(String s1, String s2) {
boolean result = false; boolean result = false;
if (s1 == null) { if (s1 == null) {
result = s1 == null; result = (s2 == null);
} else { } else {
result = s1.equals(s2); result = s1.equals(s2);
} }

View file

@ -16,6 +16,8 @@
package org.eclipse.rse.internal.model; package org.eclipse.rse.internal.model;
import java.util.Locale;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
@ -301,13 +303,19 @@ public class Host extends RSEModelObject implements IHost, IAdaptable
} }
this.setSystemTypeGen(systemType); 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) public void setHostName(String name) {
{ if (name != null) {
if (name != null) name = name.toUpperCase(Locale.US);
name = name.toUpperCase(); }
this.setHostNameGen(name); this.setHostNameGen(name);
} }
/** /**