File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
main/java/com/fasterxml/jackson/databind
test/java/com/fasterxml/jackson/databind/module Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -858,10 +858,14 @@ Cyril Martin (mcoolive@github.com)
858858 does not provide " Type(Type(null))"
859859 (2.9.9 )
860860
861- Daniil Barvitsky (dbarvitsky@github(
861+ Daniil Barvitsky (dbarvitsky@github)
862862 * Reported #2324 : `StringCollectionDeserializer` fails with custom collection
863863 (2.9.9 )
864864
865+ Edgar Asatryan (nstdio@github)
866+ * Reported #2374 : `ObjectMapper. getRegisteredModuleIds()` throws NPE if no modules registered
867+ (2.9.10 )
868+
865869Christoph Breitkopf (bokesan@github)
866870 * Reported #2217 : Suboptimal memory allocation in `TextNode.getBinaryValue()`
867871 (2.10.0 )
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ Project: jackson-databind
5757
5858#2326 : Block one more gadget type (CVE-2019 -12384 )
5959#2341 : Block one more gadget type (CVE-2019 -12814 )
60+ #2374 : `ObjectMapper. getRegisteredModuleIds()` throws NPE if no modules registered
61+ (reported by Edgar A)
6062
61632.9.9 (16 -May-2019 )
6264
Original file line number Diff line number Diff line change @@ -988,10 +988,10 @@ public ObjectMapper registerModules(Iterable<? extends Module> modules)
988988 *
989989 * @since 2.9.6
990990 */
991- public Set <Object > getRegisteredModuleIds () {
992- return _registeredModuleTypes == null ?
993- Collections . emptySet () :
994- Collections .unmodifiableSet (_registeredModuleTypes );
991+ public Set <Object > getRegisteredModuleIds ()
992+ {
993+ return ( _registeredModuleTypes == null ) ?
994+ Collections .emptySet () : Collections . unmodifiableSet (_registeredModuleTypes );
995995 }
996996
997997 /**
Original file line number Diff line number Diff line change @@ -319,13 +319,18 @@ public void testGetRegisteredModules()
319319 AnotherSimpleModule mod2 = new AnotherSimpleModule ("test2" , Version .unknownVersion ());
320320
321321 ObjectMapper mapper = new ObjectMapper ();
322+
322323 mapper .registerModule (mod1 );
323324 mapper .registerModule (mod2 );
324325
325326 Set <Object > registeredModuleIds = mapper .getRegisteredModuleIds ();
326327 assertEquals (2 , registeredModuleIds .size ());
327328 assertTrue (registeredModuleIds .contains (mod1 .getTypeId ()));
328329 assertTrue (registeredModuleIds .contains (mod2 .getTypeId ()));
330+
331+ // 01-Jul-2019, [databind#2374]: verify empty list is fine
332+ mapper = new ObjectMapper ();
333+ assertEquals (0 , mapper .getRegisteredModuleIds ().size ());
329334 }
330335
331336 /*
You can’t perform that action at this time.
0 commit comments