Skip to content

Commit 1508c7f

Browse files
GOODBOY008deleiCopilot
authored
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]>
1 parent 9aa6bc1 commit 1508c7f

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

fesod/src/main/java/org/apache/fesod/sheet/cache/selector/SimpleReadCacheSelector.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,9 @@ public ReadCache readCache(PackagePart sharedStringsTablePackagePart) {
114114

115115
// In order to be compatible with the code
116116
// If the user set up `maxCacheActivateSize`, then continue using it
117-
if (maxCacheActivateSize != null) {
118-
return new Ehcache(maxCacheActivateSize, maxCacheActivateBatchCount);
119-
} else {
120-
if (maxCacheActivateBatchCount == null) {
121-
maxCacheActivateBatchCount = DEFAULT_MAX_EHCACHE_ACTIVATE_BATCH_COUNT;
122-
}
123-
return new Ehcache(maxCacheActivateSize, maxCacheActivateBatchCount);
117+
if (maxCacheActivateBatchCount == null) {
118+
maxCacheActivateBatchCount = DEFAULT_MAX_EHCACHE_ACTIVATE_BATCH_COUNT;
124119
}
120+
return new Ehcache(maxCacheActivateSize, maxCacheActivateBatchCount);
125121
}
126122
}

fesod/src/main/java/org/apache/fesod/sheet/metadata/format/DataFormatter.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ public static void setExcelStyleRoundingMode(DecimalFormat format, RoundingMode
747747
/**
748748
* Format class for Excel's SSN format. This class mimics Excel's built-in SSN formatting.
749749
*/
750-
@SuppressWarnings("serial")
751750
private static final class SSNFormat extends Format {
752751
private static final DecimalFormat df = createIntegerOnlyFormat("000000000");
753752

@@ -777,7 +776,6 @@ public Object parseObject(String source, ParsePosition pos) {
777776
/**
778777
* Format class for Excel Zip + 4 format. This class mimics Excel's built-in formatting for Zip + 4.
779778
*/
780-
@SuppressWarnings("serial")
781779
private static final class ZipPlusFourFormat extends Format {
782780
private static final DecimalFormat df = createIntegerOnlyFormat("000000000");
783781

@@ -807,7 +805,6 @@ public Object parseObject(String source, ParsePosition pos) {
807805
/**
808806
* Format class for Excel phone number format. This class mimics Excel's built-in phone number formatting.
809807
*/
810-
@SuppressWarnings("serial")
811808
private static final class PhoneFormat extends Format {
812809
private static final DecimalFormat df = createIntegerOnlyFormat("##########");
813810

@@ -857,7 +854,7 @@ public Object parseObject(String source, ParsePosition pos) {
857854
* non-cachable wrapper around a
858855
* {@link CellFormatResult}
859856
*/
860-
private final class CellFormatResultWrapper extends Format {
857+
private static final class CellFormatResultWrapper extends Format {
861858
private final CellFormatResult result;
862859

863860
private CellFormatResultWrapper(CellFormatResult result) {

0 commit comments

Comments
 (0)