summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/src/Ice/PropertiesI.cpp19
-rw-r--r--cs/src/Ice/PropertiesI.cs23
-rw-r--r--java/src/Ice/PropertiesI.java21
3 files changed, 59 insertions, 4 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index fb2ca88bdb5..9bde5157184 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -171,9 +171,11 @@ Ice::PropertiesI::setProperty(const string& key, const string& value)
// dot is an error.
//
assert(dotPos != string::npos);
-
+
+ bool mismatchCase = false;
+ string otherKey;
string propPrefix = pattern.substr(0, dotPos);
- if(propPrefix != prefix)
+ if(IceUtilInternal::toUpper(propPrefix) != IceUtilInternal::toUpper(prefix))
{
continue;
}
@@ -193,11 +195,24 @@ Ice::PropertiesI::setProperty(const string& key, const string& value)
currentKey = prop.deprecatedBy;
}
}
+
+ if(!found && IceUtilInternal::match(IceUtilInternal::toUpper(currentKey),
+ IceUtilInternal::toUpper(prop.pattern)))
+ {
+ found = true;
+ mismatchCase = true;
+ otherKey = prop.pattern;
+ break;
+ }
}
if(!found)
{
logger->warning("unknown property: `" + currentKey + "'");
}
+ else if(mismatchCase)
+ {
+ logger->warning("unknown property: `" + currentKey + "'; did you mean `" + otherKey + "'");
+ }
}
}
diff --git a/cs/src/Ice/PropertiesI.cs b/cs/src/Ice/PropertiesI.cs
index 1106d620bea..ee29a7d66b9 100644
--- a/cs/src/Ice/PropertiesI.cs
+++ b/cs/src/Ice/PropertiesI.cs
@@ -179,7 +179,9 @@ namespace Ice
dotPos = pattern.IndexOf('.');
Debug.Assert(dotPos != -1);
string propPrefix = pattern.Substring(1, dotPos - 2);
- if(!propPrefix.Equals(prefix))
+ bool mismatchCase = false;
+ string otherKey = "";
+ if(!propPrefix.ToUpper().Equals(prefix.ToUpper()))
{
continue;
}
@@ -198,11 +200,30 @@ namespace Ice
key = IceInternal.PropertyNames.validProps[i][j].deprecatedBy();
}
}
+
+ if(!found)
+ {
+ r = new Regex(IceInternal.PropertyNames.validProps[i][j].pattern().ToUpper());
+ m = r.Match(key.ToUpper());
+ if(m.Success)
+ {
+ found = true;
+ mismatchCase = true;
+ otherKey = IceInternal.PropertyNames.validProps[i][j].pattern().Replace("\\", "").
+ Replace("^", "").
+ Replace("$", "");
+ break;
+ }
+ }
}
if(!found)
{
logger.warning("unknown property: " + key);
}
+ else if(mismatchCase)
+ {
+ logger.warning("unknown property: `" + key + "'; did you mean `" + otherKey + "'");
+ }
}
}
diff --git a/java/src/Ice/PropertiesI.java b/java/src/Ice/PropertiesI.java
index ff76acfb62e..9af0d68033a 100644
--- a/java/src/Ice/PropertiesI.java
+++ b/java/src/Ice/PropertiesI.java
@@ -176,7 +176,9 @@ public final class PropertiesI implements Properties
//
assert(dotPos != -1);
String propPrefix = pattern.substring(0, dotPos - 1);
- if(!propPrefix.equals(prefix))
+ boolean mismatchCase = false;
+ String otherKey = "";
+ if(!propPrefix.toUpperCase().equals(prefix.toUpperCase()))
{
continue;
}
@@ -197,11 +199,28 @@ public final class PropertiesI implements Properties
key = IceInternal.PropertyNames.validProps[i][j].deprecatedBy();
}
}
+
+ if(!found)
+ {
+ pComp = java.util.regex.Pattern.compile(pattern.toUpperCase());
+ m = pComp.matcher(key.toUpperCase());
+ if(m.matches())
+ {
+ found = true;
+ mismatchCase = true;
+ otherKey = pattern.replaceAll("\\\\", "");
+ break;
+ }
+ }
}
if(!found)
{
logger.warning("unknown property: " + key);
}
+ else if(mismatchCase)
+ {
+ logger.warning("unknown property: `" + key + "'; did you mean `" + otherKey + "'");
+ }
}
}