Makes kafka lookup extraction factory's replace() behavior consistent with other lookup extraction factories (#3326)

This commit is contained in:
Gleb Smirnov 2016-08-04 20:24:19 +03:00 committed by Charles Allen
parent 9437a7a313
commit 33dbe0800c
2 changed files with 4 additions and 5 deletions

View File

@ -321,11 +321,7 @@ public class KafkaLookupExtractorFactory implements LookupExtractorFactory
return false;
}
if (other == null) {
return false;
}
if (getClass() != other.getClass()) {
if (other == null || getClass() != other.getClass()) {
return true;
}

View File

@ -195,6 +195,9 @@ public class KafkaLookupExtractorFactoryTest
TOPIC,
DEFAULT_PROPERTIES
);
Assert.assertTrue(factory.replaces(null));
Assert.assertTrue(factory.replaces(new MapLookupExtractorFactory(ImmutableMap.<String, String>of(), false)));
Assert.assertFalse(factory.replaces(factory));
Assert.assertFalse(factory.replaces(new KafkaLookupExtractorFactory(