Commit e5008af8 authored by Simon Barner's avatar Simon Barner
Browse files

registerConstraintUI(): Fix check for duplicate UI registrations

* Check for duplicates was based on "cstrClass" (of type Class), whereas
  the registration is based on the class name
* Note: This change does not affect the actual registration, hence no
  change in behavior is expected.
* Revealed by warning on unlikely argument of (type Class) for

Issue-Ref: 3539

Signed-off-by: Simon Barner's avatarSimon Barner <>
parent 7995b049 e29126b5947c9fd2f1d82bb87001b9d0ead50c3b GREEN 81bd227736013f1157ba9d0f79a9f3deefe10064 GREEN ac138bfc97ea3b2f8fde0497ade915e4cd942af1 GREEN 308dc3df69cbd18a91a051038a77b6e1184937cc GREEN 433e35bb1c9bbc628c6ee070ff45632400becf4a YELLOW ca3c899293f25b70ce8e5f0d86ca2f9683329d81 GREEN e9180c0020f1769d9e24ef3c08f9ca5599dbc5c3 GREEN b01b7706034691683df7bbc2e7828c42574b3147 GREEN
......@@ -100,12 +100,12 @@ public final class ConstraintUIService
public void registerConstraintUI(Class<? extends IConstraintUI> cstrUIClass,
Class<? extends IConstraint> cstrClass) {
if(string2cstrMap.get(cstrClass) != null) {
String name = cstrClass.getName();
String name = cstrClass.getName();
if(string2cstrMap.get(name) != null) {
"Encountered more than one registered constraint UI associated with " + name);
string2cstrMap.put(cstrClass.getName(), cstrClass);
string2cstrMap.put(name, cstrClass);
cstr2cstrUIMap.put(cstrClass, cstrUIClass);
try {
instanceMap.put(cstrUIClass, cstrUIClass.getConstructor().newInstance());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment