| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -340,7 +340,10 @@ private static boolean isResolvableObjectRec( | |||
| 340 | 340 | ||
| 341 | 341 | public static boolean isPrimitive(Object val) { | |
| 342 | 342 | return ( | |
| 343 | - val == null || Primitives.isWrapperType(val.getClass()) || val instanceof String | ||
| 343 | + val == null || | ||
| 344 | + Primitives.isWrapperType(val.getClass()) || | ||
| 345 | + val instanceof String || | ||
| 346 | + val instanceof Number | ||
| 344 | 347 | ); | |
| 345 | 348 | } | |
| 346 | 349 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ | |||
| 25 | 25 | import com.hubspot.jinjava.tree.parse.TokenScannerSymbols; | |
| 26 | 26 | import com.hubspot.jinjava.util.EagerExpressionResolver.EagerExpressionResult; | |
| 27 | 27 | import java.io.IOException; | |
| 28 | + import java.math.BigDecimal; | ||
| 28 | 29 | import java.time.Instant; | |
| 29 | 30 | import java.time.ZoneId; | |
| 30 | 31 | import java.time.ZonedDateTime; | |
@@ -914,4 +915,10 @@ public <T extends Appendable & CharSequence> T appendPyishString(T appendable) | |||
| 914 | 915 | throw new DeferredValueException("Can't serialize"); | |
| 915 | 916 | } | |
| 916 | 917 | } | |
| 918 | + | ||
| 919 | + @Test | ||
| 920 | + public void itCountsBigDecimalAsPrimitive() { | ||
| 921 | + assertThat(EagerExpressionResolver.isResolvableObject(new BigDecimal("2.1E7"))) | ||
| 922 | + .isTrue(); | ||
| 923 | + } | ||
| 917 | 924 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments