Skip to content

Commit

Permalink
🎨 修复代码,避免 String 与 Integer 强转报错
Browse files Browse the repository at this point in the history
ChinaTjcm authored and Binary Wang committed Apr 19, 2023
1 parent e0e03d8 commit b5a760d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -24,6 +24,11 @@ public String toString(Object obj) {

@Override
public Object fromString(String str) {

if (str == null || str.length() == 0) {
return null;
}

final Iterable<String> iterable = Splitter.on(",").split(str);
final String[] strings = Iterables.toArray(iterable, String.class);
Integer[] result = new Integer[strings.length];

0 comments on commit b5a760d

Please sign in to comment.