Skip to content

Commit

Permalink
fix bug with explicitly-specified Java codecs
Browse files Browse the repository at this point in the history
Fixes #10520
  • Loading branch information
danhermann committed Mar 8, 2019
1 parent 7db4fab commit 0910353
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public <T> T get(final PluginConfigSpec<T> configSpec) {
Object o = rawSettings.get(configSpec.name());
if (configSpec.type().isAssignableFrom(o.getClass())) {
return (T) o;
} else if (configSpec.type() == Codec.class && o instanceof String && pluginFactory != null) {
Codec codec = pluginFactory.buildDefaultCodec((String)o);
return configSpec.type().cast(codec);
} else {
throw new IllegalStateException(
String.format("Setting value for '%s' of type '%s' incompatible with defined type of '%s'",
Expand Down

0 comments on commit 0910353

Please sign in to comment.