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; return false;
} }
if (other == null) { if (other == null || getClass() != other.getClass()) {
return false;
}
if (getClass() != other.getClass()) {
return true; return true;
} }

View File

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