File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
src/main/java/com/fasterxml/jackson/databind/module Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,7 @@ public class SimpleModule
102102 * use actual name and version number information.
103103 */
104104 public SimpleModule () {
105- // can't chain when making reference to 'this'
106- // note: generate different name for direct instantiation, sub-classing
107- _name = (getClass () == SimpleModule .class ) ?
108- "SimpleModule-" +System .identityHashCode (this )
109- : getClass ().getName ();
110- _version = Version .unknownVersion ();
111- _id = _createId ();
105+ this ((String ) null );
112106 }
113107
114108 /**
@@ -137,11 +131,20 @@ public SimpleModule(Version version) {
137131 * @param version Version of the module
138132 */
139133 public SimpleModule (String name , Version version ) {
134+ this (name , version , null );
135+ }
136+
137+ public SimpleModule (String name , Version version , Object registrationId ) {
138+ if (name == null ) {
139+ name = (getClass () == SimpleModule .class ) ?
140+ "SimpleModule-" +System .identityHashCode (this )
141+ : getClass ().getName ();
142+ }
140143 _name = name ;
141144 _version = version ;
142- _id = _createId ();
145+ _id = ( registrationId == null ) ? _createId () : registrationId ;
143146 }
144-
147+
145148 // 27-Feb-2018, tatu: Need to create Registration Id that never matches any
146149 // other id, but is serializable
147150 protected Object _createId () {
You can’t perform that action at this time.
0 commit comments