Handle older enum raw value

This commit is contained in:
Laurent Clouet
2015-04-07 20:37:47 +01:00
parent 34957be7a8
commit 53d4d005fe

View File

@@ -181,8 +181,14 @@ public class SettingsLoader {
config.setPassword(password); config.setPassword(password);
} }
if ((config.getComputeMethod() == null && computeMethod != null) || (computeMethod != null && config.getComputeMethod() != ComputeType.valueOf(computeMethod))) { try {
config.setComputeMethod(ComputeType.valueOf(computeMethod)); if ((config.getComputeMethod() == null && computeMethod != null) || (computeMethod != null && config.getComputeMethod() != ComputeType.valueOf(computeMethod))) {
config.setComputeMethod(ComputeType.valueOf(computeMethod));
}
}
catch (IllegalArgumentException e) {
System.err.println("SettingsLoader::merge failed to handle compute method (raw value: '" + computeMethod + "')");
computeMethod = null;
} }
if (config.getGPUDevice() == null && gpu != null) { if (config.getGPUDevice() == null && gpu != null) {
GPUDevice device = GPU.getGPUDevice(gpu); GPUDevice device = GPU.getGPUDevice(gpu);