Skip to content

Commit ded1c7f

Browse files
append null if no converter found...
1 parent b019a34 commit ded1c7f

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

SerialX-core/src/main/java/org/ugp/serialx/converters/DataConverter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public interface DataConverter extends DataParser
2424
*
2525
* @since 1.3.0
2626
*/
27-
@Deprecated
2827
default CharSequence toString(ParserRegistry myHomeRegistry, Object obj, Object... args)
2928
{
3029
try

SerialX-core/src/main/java/org/ugp/serialx/converters/DataParser.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public DataParser getParserFor(String str, Object... args)
153153
public DataConverter getConverterFor(Object obj, Object... args)
154154
{
155155
for (DataParser parser : this)
156-
if (parser instanceof DataConverter && ((DataConverter)parser).toString(this, obj, args) != CONTINUE)
156+
if (parser instanceof DataConverter && ((DataConverter) parser).toString(this, obj, args) != CONTINUE)
157157
return (DataConverter) parser;
158158
return null;
159159
}
@@ -167,7 +167,6 @@ public DataConverter getConverterFor(Object obj, Object... args)
167167
*
168168
* @since 1.3.5
169169
*/
170-
@Deprecated
171170
public CharSequence toString(Object obj, Object... args)
172171
{
173172
try
@@ -213,7 +212,7 @@ public Appendable toString(Appendable source, Object obj, Object... args) throws
213212
}
214213

215214
LogProvider.instance.logErr("Unable to convert \"" + (obj == null ? "null" : obj.getClass().getName()) + "\" to string because none of registered converters were aplicable for this object!", null);
216-
return null;
215+
return source.append("null");
217216
}
218217

219218
/**

SerialX-json/src/main/java/org/ugp/serialx/json/JsonSerializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.ugp.serialx.json;
22

3-
import static org.ugp.serialx.Utils.indexOfNotInObj;
43
import static org.ugp.serialx.Utils.isOneOf;
54
import static org.ugp.serialx.Utils.multilpy;
65

SerialX-juss/src/main/java/org/ugp/serialx/juss/JussSerializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static org.ugp.serialx.Utils.Clone;
44
import static org.ugp.serialx.Utils.ENDL;
55
import static org.ugp.serialx.Utils.InvokeStaticFunc;
6-
import static org.ugp.serialx.Utils.indexOfNotInObj;
76
import static org.ugp.serialx.Utils.isOneOf;
87
import static org.ugp.serialx.Utils.multilpy;
98
import static org.ugp.serialx.converters.DataParser.VOID;

0 commit comments

Comments
 (0)