Skip to content
Snippets Groups Projects
Commit 3220f456 authored by uhensler's avatar uhensler
Browse files

OO-3170: Default values of new license handlers were not always set

parent ec6a47ea
No related merge requests found
......@@ -56,6 +56,7 @@ public class LicenseModule extends AbstractSpringModule {
private Map<String, String> defaultLicenseTypeKeys = new HashMap<>();
private Map<String, String> licensorCreatorTypes = new HashMap<>();
private Map<String, String> licensorConstantValues = new HashMap<>();
private boolean handlerInitialized = false;
public LicenseModule(CoordinatorManager coordinatorManager) {
......@@ -92,17 +93,26 @@ public class LicenseModule extends AbstractSpringModule {
licensorConstantValues.put(handlerType, licensorCreatorConstant);
}
}
if (handlerInitialized) {
savePropertiesAndFireChangedEvent();
}
handlers.sort((LicenseHandler h1, LicenseHandler h2) -> h1.getType().compareTo(h2.getType()));
}
private void initLicenseHandler(LicenseHandler handler) {
setEnabled(handler.getType(), defaultModuleValues.isEnabled());
String handlerType = handler.getType();
enabledHandlers.put(handlerType, defaultModuleValues.isEnabled());
setStringProperty(ENABLED_HANDLERS + handlerType, String.valueOf(defaultModuleValues.isEnabled()), false);
defaultModuleValues.activateLicenseTypes(handler);
LicenseType licenseType = defaultModuleValues.getLicenseType();
setDefaultLicenseTypeKey(handler, String.valueOf(licenseType.getKey()));
String licenseTypeKey = String.valueOf(defaultModuleValues.getLicenseType().getKey());
defaultLicenseTypeKeys.put(handlerType, licenseTypeKey);
setStringProperty(DEFAULT_LICENSE_TYPE + handlerType, licenseTypeKey, false);
handlerInitialized = true;
}
@Override
......
......@@ -68,8 +68,8 @@ public class DefaultModuleValues {
}
}
public boolean isEnabled() {
return true;
public Boolean isEnabled() {
return Boolean.TRUE;
}
public void activateLicenseTypes(LicenseHandler handler) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment