-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Add BinaryHandler for DecimalFormat class in java.text package.
Generic Handler does not load the whole class correctly.
loaded:
DigitList ist null.
In some basis scenario is an Exception raised:
java.lang.NullPointerException: Cannot enter synchronized block because "this.digitList" is null
at java.base/java.text.DecimalFormat.doubleSubformat(DecimalFormat.java:750)
at java.base/java.text.DecimalFormat.format(DecimalFormat.java:682)
at java.base/java.text.DecimalFormat.format(DecimalFormat.java:635)
at java.base/java.text.NumberFormat.format(NumberFormat.java:368)
at test.microstream.various.text.DecimalFormatTest.decimalFormatAsFieldInDataClass(DecimalFormatTest.java:33)
at java.base/java.lang.reflect.Method.invoke(Method.java:565) @Test
void decimalFormatAsFieldInDataClass()
{
DecimalFormat df = new DecimalFormat("0.###");
double sample = 3.14159;
DecimalData root = new DecimalData(df);
try (EmbeddedStorageManager storageManager = EmbeddedStorage.start(root, tempDir)) {
storageManager.storeRoot();
}
DecimalData loaded = new DecimalData();
try (EmbeddedStorageManager storageManager = EmbeddedStorage.start(loaded, tempDir)) {
assertEquals(df.format(sample), loaded.getFormat().format(sample));
}
}
private static class DecimalData
{
private DecimalFormat format;
public DecimalData(DecimalFormat format)
{
this.format = format;
}
public DecimalData()
{
}
public DecimalFormat getFormat()
{
return format;
}
public void setFormat(DecimalFormat format)
{
this.format = format;
}
}
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
