replace deprecated apache commons utils
This commit is contained in:
parent
23693ed4fd
commit
860fe08ea1
@ -8,6 +8,7 @@
|
||||
- Support for all 2023.3 builds (233.*)
|
||||
|
||||
### Changed
|
||||
- Replace deprecated apache commons utils
|
||||
- Update dependencies
|
||||
|
||||
## [4.4.2] - 2023-09-02
|
||||
|
@ -1,8 +1,7 @@
|
||||
package de.marhali.easyi18n.io.parser;
|
||||
|
||||
import de.marhali.easyi18n.util.StringUtil;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Iterator;
|
||||
|
@ -7,9 +7,8 @@ import com.google.gson.JsonPrimitive;
|
||||
import de.marhali.easyi18n.model.TranslationNode;
|
||||
import de.marhali.easyi18n.model.TranslationValue;
|
||||
import de.marhali.easyi18n.util.StringUtil;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -61,7 +60,7 @@ public class JsonMapper {
|
||||
if(content != null) {
|
||||
if(JsonArrayMapper.isArray(content)) {
|
||||
json.add(key, JsonArrayMapper.write(content));
|
||||
} else if(NumberUtils.isNumber(content)) {
|
||||
} else if(NumberUtils.isCreatable(content)) {
|
||||
json.add(key, new JsonPrimitive(NumberUtils.createNumber(content)));
|
||||
} else {
|
||||
json.add(key, new JsonPrimitive(StringEscapeUtils.unescapeJava(content)));
|
||||
|
@ -5,8 +5,7 @@ import de.marhali.easyi18n.util.StringUtil;
|
||||
import de.marhali.json5.Json5;
|
||||
import de.marhali.json5.Json5Array;
|
||||
import de.marhali.json5.Json5Primitive;
|
||||
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -40,7 +39,7 @@ public class Json5ArrayMapper extends ArrayMapper {
|
||||
} else {
|
||||
if(StringUtil.isHexString(element)) {
|
||||
array.add(Json5Primitive.of(element, true));
|
||||
} else if(NumberUtils.isNumber(element)) {
|
||||
} else if(NumberUtils.isCreatable(element)) {
|
||||
array.add(Json5Primitive.of(NumberUtils.createNumber(element)));
|
||||
} else {
|
||||
array.add(Json5Primitive.of(element));
|
||||
|
@ -6,9 +6,8 @@ import de.marhali.easyi18n.util.StringUtil;
|
||||
import de.marhali.json5.Json5Element;
|
||||
import de.marhali.json5.Json5Object;
|
||||
import de.marhali.json5.Json5Primitive;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -61,7 +60,7 @@ public class Json5Mapper {
|
||||
json.add(key, Json5ArrayMapper.write(content));
|
||||
} else if(StringUtil.isHexString(content)) {
|
||||
json.add(key, Json5Primitive.of(content, true));
|
||||
} else if(NumberUtils.isNumber(content)) {
|
||||
} else if(NumberUtils.isCreatable(content)) {
|
||||
json.add(key, Json5Primitive.of(NumberUtils.createNumber(content)));
|
||||
} else {
|
||||
json.add(key, Json5Primitive.of(StringEscapeUtils.unescapeJava(content)));
|
||||
|
@ -5,9 +5,8 @@ import de.marhali.easyi18n.model.KeyPath;
|
||||
import de.marhali.easyi18n.model.TranslationValue;
|
||||
import de.marhali.easyi18n.util.KeyPathConverter;
|
||||
import de.marhali.easyi18n.util.StringUtil;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -51,7 +50,7 @@ public class PropertiesMapper {
|
||||
|
||||
if(PropertiesArrayMapper.isArray(content)) {
|
||||
properties.put(simpleKey, PropertiesArrayMapper.write(content));
|
||||
} else if(NumberUtils.isNumber(content)) {
|
||||
} else if(NumberUtils.isCreatable(content)) {
|
||||
properties.put(simpleKey, NumberUtils.createNumber(content));
|
||||
} else {
|
||||
properties.put(simpleKey, StringEscapeUtils.unescapeJava(content));
|
||||
|
@ -3,9 +3,8 @@ package de.marhali.easyi18n.io.parser.yaml;
|
||||
import de.marhali.easyi18n.model.TranslationNode;
|
||||
import de.marhali.easyi18n.model.TranslationValue;
|
||||
import de.marhali.easyi18n.util.StringUtil;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -53,7 +52,7 @@ public class YamlMapper {
|
||||
if(content != null) {
|
||||
if(YamlArrayMapper.isArray(content)) {
|
||||
section.put(key, YamlArrayMapper.write(content));
|
||||
} else if(NumberUtils.isNumber(content)) {
|
||||
} else if(NumberUtils.isCreatable(content)) {
|
||||
section.put(key, NumberUtils.createNumber(content));
|
||||
} else {
|
||||
section.put(key, StringEscapeUtils.unescapeJava(content));
|
||||
|
Loading…
x
Reference in New Issue
Block a user