This is an automated email from the ASF dual-hosted git repository.
delei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fesod.git
The following commit(s) were added to refs/heads/main by this push:
new 1508c7f8 refactor: remove unnecessary @SuppressWarnings and simplify
logic (#684)
1508c7f8 is described below
commit 1508c7f84c52d83a3d7557fd0e5316900ba65da6
Author: gongzhongqiang <[email protected]>
AuthorDate: Fri Nov 14 19:38:50 2025 +0800
refactor: remove unnecessary @SuppressWarnings and simplify logic (#684)
* refactor: remove unnecessary @SuppressWarnings annotations and simplify
cache activation logic
* Apply suggestion from @Copilot
Co-authored-by: Copilot <[email protected]>
---------
Co-authored-by: DeleiGuo <[email protected]>
Co-authored-by: Copilot <[email protected]>
---
.../fesod/sheet/cache/selector/SimpleReadCacheSelector.java | 10 +++-------
.../org/apache/fesod/sheet/metadata/format/DataFormatter.java | 5 +----
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git
a/fesod/src/main/java/org/apache/fesod/sheet/cache/selector/SimpleReadCacheSelector.java
b/fesod/src/main/java/org/apache/fesod/sheet/cache/selector/SimpleReadCacheSelector.java
index 85a2e8dc..ef1a7acd 100644
---
a/fesod/src/main/java/org/apache/fesod/sheet/cache/selector/SimpleReadCacheSelector.java
+++
b/fesod/src/main/java/org/apache/fesod/sheet/cache/selector/SimpleReadCacheSelector.java
@@ -114,13 +114,9 @@ public class SimpleReadCacheSelector implements
ReadCacheSelector {
// In order to be compatible with the code
// If the user set up `maxCacheActivateSize`, then continue using it
- if (maxCacheActivateSize != null) {
- return new Ehcache(maxCacheActivateSize,
maxCacheActivateBatchCount);
- } else {
- if (maxCacheActivateBatchCount == null) {
- maxCacheActivateBatchCount =
DEFAULT_MAX_EHCACHE_ACTIVATE_BATCH_COUNT;
- }
- return new Ehcache(maxCacheActivateSize,
maxCacheActivateBatchCount);
+ if (maxCacheActivateBatchCount == null) {
+ maxCacheActivateBatchCount =
DEFAULT_MAX_EHCACHE_ACTIVATE_BATCH_COUNT;
}
+ return new Ehcache(maxCacheActivateSize, maxCacheActivateBatchCount);
}
}
diff --git
a/fesod/src/main/java/org/apache/fesod/sheet/metadata/format/DataFormatter.java
b/fesod/src/main/java/org/apache/fesod/sheet/metadata/format/DataFormatter.java
index 8ab4bf1a..ec37963d 100644
---
a/fesod/src/main/java/org/apache/fesod/sheet/metadata/format/DataFormatter.java
+++
b/fesod/src/main/java/org/apache/fesod/sheet/metadata/format/DataFormatter.java
@@ -747,7 +747,6 @@ public class DataFormatter {
/**
* Format class for Excel's SSN format. This class mimics Excel's built-in
SSN formatting.
*/
- @SuppressWarnings("serial")
private static final class SSNFormat extends Format {
private static final DecimalFormat df =
createIntegerOnlyFormat("000000000");
@@ -777,7 +776,6 @@ public class DataFormatter {
/**
* Format class for Excel Zip + 4 format. This class mimics Excel's
built-in formatting for Zip + 4.
*/
- @SuppressWarnings("serial")
private static final class ZipPlusFourFormat extends Format {
private static final DecimalFormat df =
createIntegerOnlyFormat("000000000");
@@ -807,7 +805,6 @@ public class DataFormatter {
/**
* Format class for Excel phone number format. This class mimics Excel's
built-in phone number formatting.
*/
- @SuppressWarnings("serial")
private static final class PhoneFormat extends Format {
private static final DecimalFormat df =
createIntegerOnlyFormat("##########");
@@ -857,7 +854,7 @@ public class DataFormatter {
* non-cachable wrapper around a
* {@link CellFormatResult}
*/
- private final class CellFormatResultWrapper extends Format {
+ private static final class CellFormatResultWrapper extends Format {
private final CellFormatResult result;
private CellFormatResultWrapper(CellFormatResult result) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]