Skip to content

Commit e47c903

Browse files
committed
Added release notes wrt #2432, minor changes
1 parent 76fb342 commit e47c903

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,10 @@ Vladimir Tsanev (tsachev@github)
926926
to `handleUnknownVanilla()` to fix earlier #822
927927
(2.10.0)
928928

929+
Marcos Passos (marcospassos@github(
930+
* Contributed #2432: Add support for module bundles
931+
(2.10.0)
932+
929933
David Becker (dsbecker@github)
930934
* Suggested #2433: Improve `NullNode.equals()`
931935
(2.10.0)

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Project: jackson-databind
1010
(suggested by Craig P)
1111
#2309: READ_ENUMS_USING_TO_STRING doesn't support null values
1212
(reported, fix suggested by Ben A)
13+
#2432: Add support for module bundles
14+
(contributed by Marcos P)
1315
#2442: `ArrayNode.addAll()` adds raw `null` values which cause NPE on `deepCopy()`
1416
and `toString()`
1517
(reported, fix contributed by Hesham M)

src/main/java/com/fasterxml/jackson/databind/Module.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ public Object getTypeId() {
7676
public abstract void setupModule(SetupContext context);
7777

7878
/**
79-
* Returns the list of dependent modules.
80-
*
79+
* Returns the list of dependent modules this module has, if any.
8180
* It is called to let modules register other modules as dependencies.
81+
* Modules returned will be registered before this module is registered,
82+
* in iteration order.
8283
*
8384
* @since 2.10
8485
*/
8586
public Iterable<? extends Module> getDependencies() {
8687
return Collections.emptyList();
8788
}
88-
89+
8990
/*
9091
/**********************************************************
9192
/* Helper types

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,10 @@ public ObjectMapper registerModule(Module module)
796796
throw new IllegalArgumentException("Module without defined version");
797797
}
798798

799-
registerModules(module.getDependencies());
799+
// [databind#2432]: Modules may depend on other modules; if so, register those first
800+
for (Module dep : module.getDependencies()) {
801+
registerModule(dep);
802+
}
800803

801804
// And then call registration
802805
module.setupModule(new Module.SetupContext()

0 commit comments

Comments
 (0)