Revision 85f3df99
Added by Katja Luther almost 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
1868 | 1868 |
String defaultBehaviour= getStringValue(PreferencePredicate.EnableComputedDescription.getKey()); |
1869 | 1869 |
EnabledComputedDescription computedDescriptionsEnabled = (EnabledComputedDescription)PreferencePredicate.EnableComputedDescription.getDefaultValue(); |
1870 | 1870 |
if (StringUtils.isNotBlank(defaultBehaviour)){ |
1871 |
computedDescriptionsEnabled = EnabledComputedDescription.byKey(defaultBehaviour); |
|
1871 |
try{ |
|
1872 |
computedDescriptionsEnabled = EnabledComputedDescription.byKey(defaultBehaviour); |
|
1873 |
}catch(IllegalArgumentException e){ |
|
1874 |
//do nothing, keep default value; |
|
1875 |
} |
|
1872 | 1876 |
} |
1873 | 1877 |
return computedDescriptionsEnabled; |
1874 | 1878 |
|
... | ... | |
1876 | 1880 |
|
1877 | 1881 |
public static boolean isComputedDesciptionHandlingDisabled(){ |
1878 | 1882 |
String defaultBehaviour= getStringValue(PreferencePredicate.EnableComputedDescription.getKey()); |
1879 |
EnabledComputedDescription computedDescriptionsEnabled = EnabledComputedDescription.byKey(defaultBehaviour); |
|
1883 |
EnabledComputedDescription computedDescriptionsEnabled = null; |
|
1884 |
try{ |
|
1885 |
computedDescriptionsEnabled = EnabledComputedDescription.byKey(defaultBehaviour); |
|
1886 |
}catch (IllegalArgumentException e){ |
|
1887 |
computedDescriptionsEnabled = (EnabledComputedDescription)PreferencePredicate.EnableComputedDescription.getDefaultValue(); |
|
1888 |
} |
|
1880 | 1889 |
return computedDescriptionsEnabled.equals(EnabledComputedDescription.Disabled); |
1881 | 1890 |
|
1882 | 1891 |
} |
Also available in: Unified diff
ref #9630: avoid IAE continue