From 21e50a50646d44400c26285454e71701120d9390 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Tue, 27 Dec 2022 23:13:35 +0800 Subject: [PATCH 1/9] Update Apache POI to 5.2.3 in preparation for GraalVM NativeTest --- easyexcel-core/pom.xml | 4 -- .../excel/analysis/v07/XlsxSaxAnalyser.java | 14 +++-- .../alibaba/excel/metadata/csv/CsvCell.java | 5 -- .../excel/metadata/csv/CsvCellStyle.java | 43 ++++------------ .../alibaba/excel/metadata/csv/CsvSheet.java | 17 +++++++ .../excel/metadata/csv/CsvWorkbook.java | 51 ++++++++----------- .../easyexcel/test/temp/Lock2Test.java | 2 +- .../test/temp/dataformat/DataFormatter1.java | 13 ++--- pom.xml | 11 ++-- 9 files changed, 64 insertions(+), 96 deletions(-) diff --git a/easyexcel-core/pom.xml b/easyexcel-core/pom.xml index d6e58002..d192402d 100644 --- a/easyexcel-core/pom.xml +++ b/easyexcel-core/pom.xml @@ -28,10 +28,6 @@ org.apache.poi poi-ooxml - - org.apache.poi - poi-ooxml-schemas - org.apache.commons commons-csv diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java index 5104b1e3..024789b8 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java @@ -31,7 +31,6 @@ import com.alibaba.excel.util.SheetUtils; import com.alibaba.excel.util.StringUtils; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackageAccess; @@ -41,10 +40,9 @@ import org.apache.poi.openxml4j.opc.PackageRelationshipCollection; import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.apache.poi.ss.util.CellAddress; import org.apache.poi.xssf.eventusermodel.XSSFReader; +import org.apache.poi.xssf.model.Comments; import org.apache.poi.xssf.model.CommentsTable; -import org.apache.poi.xssf.model.SharedStringsTable; import org.apache.poi.xssf.usermodel.XSSFComment; -import org.apache.poi.xssf.usermodel.XSSFRelation; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr; import org.openxmlformats.schemas.spreadsheetml.x2006.main.WorkbookDocument; @@ -121,9 +119,9 @@ public class XlsxSaxAnalyser implements ExcelReadExecutor { sheetList.add(new ReadSheet(index, ite.getSheetName())); sheetMap.put(index, inputStream); if (xlsxReadContext.readWorkbookHolder().getExtraReadSet().contains(CellExtraTypeEnum.COMMENT)) { - CommentsTable commentsTable = ite.getSheetComments(); - if (null != commentsTable) { - commentsTableMap.put(index, commentsTable); + Comments comments = ite.getSheetComments(); + if (comments instanceof CommentsTable) { + commentsTableMap.put(index, (CommentsTable) comments); } } if (xlsxReadContext.readWorkbookHolder().getExtraReadSet().contains(CellExtraTypeEnum.HYPERLINK)) { @@ -179,7 +177,7 @@ public class XlsxSaxAnalyser implements ExcelReadExecutor { } private void analysisSharedStringsTable(InputStream sharedStringsTableInputStream, - XlsxReadWorkbookHolder xlsxReadWorkbookHolder) throws Exception { + XlsxReadWorkbookHolder xlsxReadWorkbookHolder) { ContentHandler handler = new SharedStringsTableHandler(xlsxReadWorkbookHolder.getReadCache()); parseXmlSource(sharedStringsTableInputStream, handler); xlsxReadWorkbookHolder.getReadCache().putFinished(); @@ -199,7 +197,7 @@ public class XlsxSaxAnalyser implements ExcelReadExecutor { } File readTempFile = FileUtils.createCacheTmpFile(); xlsxReadWorkbookHolder.setTempFile(readTempFile); - File tempFile = new File(readTempFile.getPath(), UUID.randomUUID().toString() + ".xlsx"); + File tempFile = new File(readTempFile.getPath(), UUID.randomUUID() + ".xlsx"); if (decryptedStream != null) { FileUtils.writeToFile(tempFile, decryptedStream, false); } else { diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java index 72beb30a..a75c5765 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCell.java @@ -227,11 +227,6 @@ public class CsvCell extends CellBase { return getCellType(); } - @Override - public CellType getCachedFormulaResultTypeEnum() { - return getCellType(); - } - @Override public String getCellFormula() { if (formulaData == null) { diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java index a992f213..7a2714a0 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvCellStyle.java @@ -76,7 +76,7 @@ public class CsvCellStyle implements CellStyle { } @Override - public short getFontIndex() { + public int getFontIndex() { return 0; } @@ -125,11 +125,6 @@ public class CsvCellStyle implements CellStyle { return null; } - @Override - public HorizontalAlignment getAlignmentEnum() { - return null; - } - @Override public void setWrapText(boolean wrapped) { @@ -150,11 +145,6 @@ public class CsvCellStyle implements CellStyle { return null; } - @Override - public VerticalAlignment getVerticalAlignmentEnum() { - return null; - } - @Override public void setRotation(short rotation) { @@ -185,11 +175,6 @@ public class CsvCellStyle implements CellStyle { return null; } - @Override - public BorderStyle getBorderLeftEnum() { - return null; - } - @Override public void setBorderRight(BorderStyle border) { @@ -200,11 +185,6 @@ public class CsvCellStyle implements CellStyle { return null; } - @Override - public BorderStyle getBorderRightEnum() { - return null; - } - @Override public void setBorderTop(BorderStyle border) { @@ -215,11 +195,6 @@ public class CsvCellStyle implements CellStyle { return null; } - @Override - public BorderStyle getBorderTopEnum() { - return null; - } - @Override public void setBorderBottom(BorderStyle border) { @@ -230,11 +205,6 @@ public class CsvCellStyle implements CellStyle { return null; } - @Override - public BorderStyle getBorderBottomEnum() { - return null; - } - @Override public void setLeftBorderColor(short color) { @@ -286,12 +256,12 @@ public class CsvCellStyle implements CellStyle { } @Override - public FillPatternType getFillPatternEnum() { - return null; + public void setFillBackgroundColor(short bg) { + } @Override - public void setFillBackgroundColor(short bg) { + public void setFillBackgroundColor(Color color) { } @@ -310,6 +280,11 @@ public class CsvCellStyle implements CellStyle { } + @Override + public void setFillForegroundColor(Color color) { + + } + @Override public short getFillForegroundColor() { return 0; diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java index 725addbc..317569e0 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java @@ -33,6 +33,8 @@ import org.apache.poi.ss.usermodel.Drawing; import org.apache.poi.ss.usermodel.Footer; import org.apache.poi.ss.usermodel.Header; import org.apache.poi.ss.usermodel.Hyperlink; +import org.apache.poi.ss.usermodel.PageMargin; +import org.apache.poi.ss.usermodel.PaneType; import org.apache.poi.ss.usermodel.PrintSetup; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; @@ -397,11 +399,21 @@ public class CsvSheet implements Sheet, Closeable { return 0; } + @Override + public double getMargin(PageMargin pageMargin) { + return 0; + } + @Override public void setMargin(short margin, double size) { } + @Override + public void setMargin(PageMargin pageMargin, double v) { + + } + @Override public boolean getProtect() { return false; @@ -467,6 +479,11 @@ public class CsvSheet implements Sheet, Closeable { } + @Override + public void createSplitPane(int i, int i1, int i2, int i3, PaneType paneType) { + + } + @Override public PaneInformation getPaneInformation() { return null; diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java index 4e713509..f381d482 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvWorkbook.java @@ -11,7 +11,9 @@ import lombok.Getter; import lombok.Setter; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.SpreadsheetVersion; +import org.apache.poi.ss.formula.EvaluationWorkbook; import org.apache.poi.ss.formula.udf.UDFFinder; +import org.apache.poi.ss.usermodel.CellReferenceType; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.DataFormat; @@ -39,10 +41,9 @@ public class CsvWorkbook implements Workbook { /** * true if date uses 1904 windowing, or false if using 1900 date windowing. - * + *

* default is false * - * @return */ private Boolean use1904windowing; @@ -53,7 +54,7 @@ public class CsvWorkbook implements Workbook { /** * Whether to use scientific Format. - * + *

* default is false */ private Boolean useScientificFormat; @@ -185,7 +186,7 @@ public class CsvWorkbook implements Workbook { } @Override - public short getNumberOfFonts() { + public int getNumberOfFonts() { return 0; } @@ -194,11 +195,6 @@ public class CsvWorkbook implements Workbook { return 0; } - @Override - public Font getFontAt(short idx) { - return null; - } - @Override public Font getFontAt(int idx) { return null; @@ -257,31 +253,11 @@ public class CsvWorkbook implements Workbook { return null; } - @Override - public Name getNameAt(int nameIndex) { - return null; - } - @Override public Name createName() { return null; } - @Override - public int getNameIndex(String name) { - return 0; - } - - @Override - public void removeName(int index) { - - } - - @Override - public void removeName(String name) { - - } - @Override public void removeName(Name name) { @@ -402,10 +378,25 @@ public class CsvWorkbook implements Workbook { } @Override - public int addOlePackage(byte[] oleData, String label, String fileName, String command) throws IOException { + public int addOlePackage(byte[] oleData, String label, String fileName, String command) { return 0; } + @Override + public EvaluationWorkbook createEvaluationWorkbook() { + return null; + } + + @Override + public CellReferenceType getCellReferenceType() { + return null; + } + + @Override + public void setCellReferenceType(CellReferenceType cellReferenceType) { + + } + @Override public Iterator iterator() { return null; diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java index 63141ba4..13ed4ae6 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java @@ -15,9 +15,9 @@ import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.fastjson.JSON; import org.apache.commons.collections4.CollectionUtils; -import org.apache.poi.hssf.util.CellReference; import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.util.CellReference; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java index c4dce8d3..05f3d09f 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java @@ -38,6 +38,7 @@ import java.util.Observer; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.alibaba.excel.analysis.ExcelAnalyserImpl; import org.apache.poi.ss.format.CellFormat; import org.apache.poi.ss.format.CellFormatResult; import org.apache.poi.ss.formula.ConditionalFormattingEvaluator; @@ -54,8 +55,8 @@ import org.apache.poi.ss.usermodel.FractionFormat; import org.apache.poi.ss.util.DateFormatConverter; import org.apache.poi.ss.util.NumberToTextConverter; import org.apache.poi.util.LocaleUtil; -import org.apache.poi.util.POILogFactory; -import org.apache.poi.util.POILogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * DataFormatter contains methods for formatting the value stored in an Cell. This can be useful for reports and GUI @@ -227,7 +228,7 @@ public class DataFormatter1 implements Observer { private final LocaleChangeObservable localeChangedObservable = new LocaleChangeObservable(); /** For logging any problems we find */ - private static POILogger logger = POILogFactory.getLogger(DataFormatter.class); + private static final Logger logger = LoggerFactory.getLogger(ExcelAnalyserImpl.class); /** * Creates a formatter using the {@link Locale#getDefault() default locale}. @@ -346,7 +347,7 @@ public class DataFormatter1 implements Observer { // Wrap and return (non-cachable - CellFormat does that) return new CellFormatResultWrapper(cfmt.apply(cellValueO)); } catch (Exception e) { - logger.log(POILogger.WARN, "Formatting failed for format " + formatStr + ", falling back", e); + logger.warn("Formatting failed for format {}, falling back", formatStr, e); } } @@ -589,7 +590,7 @@ public class DataFormatter1 implements Observer { try { return new ExcelStyleDateFormatter(formatStr, dateSymbols); } catch (IllegalArgumentException iae) { - logger.log(POILogger.DEBUG, "Formatting failed for format " + formatStr + ", falling back", iae); + logger.debug("Formatting failed for format {}, falling back", formatStr, iae); // the pattern could not be parsed correctly, // so fall back to the default number format return getDefaultFormat(cellValue); @@ -750,7 +751,7 @@ public class DataFormatter1 implements Observer { try { return new InternalDecimalFormatWithScale(format, symbols); } catch (IllegalArgumentException iae) { - logger.log(POILogger.DEBUG, "Formatting failed for format " + formatStr + ", falling back", iae); + logger.debug("Formatting failed for format {}, falling back", formatStr, iae); // the pattern could not be parsed correctly, // so fall back to the default number format return getDefaultFormat(cellValue); diff --git a/pom.xml b/pom.xml index eca83ca2..475061c0 100644 --- a/pom.xml +++ b/pom.xml @@ -96,22 +96,17 @@ org.apache.poi poi - 4.1.2 + 5.2.3 org.apache.poi poi-ooxml - 4.1.2 - - - org.apache.poi - poi-ooxml-schemas - 4.1.2 + 5.2.3 org.apache.commons commons-csv - 1.8 + 1.9.0 org.slf4j From 5264a5d56aa6a3b4e5f6a2041499130af3803b4b Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 10 Feb 2023 20:51:34 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B04.0.0-beta1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../easyexcel/test/temp/StyleTest.java | 3 +- pom.xml | 44 ++++++------------- update.md | 7 +++ 3 files changed, 22 insertions(+), 32 deletions(-) diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java index 0f1f0832..b4675b1d 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java @@ -7,7 +7,6 @@ import java.lang.reflect.Field; import java.util.Date; import java.util.List; -import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; @@ -181,7 +180,7 @@ public class StyleTest { private void isDate(Cell cell) { System.out.println( DateUtil.isADateFormat(cell.getCellStyle().getDataFormat(), cell.getCellStyle().getDataFormatString())); - System.out.println(HSSFDateUtil.isCellDateFormatted(cell)); + //System.out.println(HSSFDateUtil.isCellDateFormatted(cell)); DataFormatter f = new DataFormatter(); System.out.println(f.formatCellValue(cell)); diff --git a/pom.xml b/pom.xml index 92ba60d5..917ac555 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - 3.2.1 + 4.0.0-beta1 UTF-8 1.8 true @@ -106,52 +106,36 @@ org.apache.commons commons-csv - 1.9.0 - - - org.slf4j - slf4j-api - 1.7.32 + 1.10.0 org.ehcache ehcache 3.9.9 - - org.projectlombok - lombok - 1.18.20 - - + - org.springframework - spring-core - 5.3.15 + org.springframework.boot + spring-boot-dependencies + 2.7.8 + pom + import - + - ch.qos.logback - logback-classic - 1.2.5 + org.projectlombok + lombok + 1.18.26 + + com.alibaba.fastjson2 fastjson2 2.0.23 - - org.springframework.boot - spring-boot-starter-web - 2.6.3 - - - junit - junit - 4.13.2 - diff --git a/update.md b/update.md index f315c5b3..5b74be9b 100644 --- a/update.md +++ b/update.md @@ -1,3 +1,10 @@ +# 4.0.0-beta1 + +* `poi`由`4.1.2`升级到`5.2.3` +* `commons-csv`由`1.9.0`升级到`1.10.0` +* `commons-csv`由`1.7.32`升级到`1.7.36` +* `ehcache`由`3.9.9`升级到`3.10.8` + # 3.2.1 * 兼容`LocalDate` [Issue #2908](https://github.com/alibaba/easyexcel/issues/2908) From 8caa034f15e3203237d58a0bec88ec147a6a3c4a Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 10 Feb 2023 20:52:01 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B04.0.0-beta1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.md b/update.md index 5b74be9b..0bbdef26 100644 --- a/update.md +++ b/update.md @@ -2,7 +2,7 @@ * `poi`由`4.1.2`升级到`5.2.3` * `commons-csv`由`1.9.0`升级到`1.10.0` -* `commons-csv`由`1.7.32`升级到`1.7.36` +* `slf4j-api`由`1.7.32`升级到`1.7.36` * `ehcache`由`3.9.9`升级到`3.10.8` # 3.2.1 From 4eca3328a791f7fe9a2b71dcdfeed192c210d2f8 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 13 Feb 2023 19:59:04 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=BC=95=E5=85=A5jcl-over-slf4j?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easyexcel-test/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/easyexcel-test/pom.xml b/easyexcel-test/pom.xml index 73fc20d7..e13c5a9b 100644 --- a/easyexcel-test/pom.xml +++ b/easyexcel-test/pom.xml @@ -21,6 +21,13 @@ + + + org.slf4j + jcl-over-slf4j + test + + com.alibaba easyexcel-core From 65aadff8ecb237acdd8b1e1ad3656a7063e1e20a Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Tue, 5 Dec 2023 19:30:51 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 62bc605b..723d0ab8 100644 --- a/pom.xml +++ b/pom.xml @@ -127,13 +127,12 @@ org.projectlombok lombok - 1.18.20 + 1.18.26 commons-io commons-io 2.11.0 - 1.18.26 From 4f4a2e6ebcfc4852e0d42eaa03f60469e492d59d Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Tue, 5 Dec 2023 19:34:53 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easyexcel-test/pom.xml | 6 ----- .../easyexcel/test/temp/StyleTest.java | 1 - pom.xml | 22 +++---------------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/easyexcel-test/pom.xml b/easyexcel-test/pom.xml index 723e092f..be59278c 100644 --- a/easyexcel-test/pom.xml +++ b/easyexcel-test/pom.xml @@ -21,12 +21,6 @@ - - - org.slf4j - jcl-over-slf4j - test - com.alibaba diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java index f604eda6..29ac81b4 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java @@ -10,7 +10,6 @@ import java.util.List; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson2.JSON; -import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; diff --git a/pom.xml b/pom.xml index 723d0ab8..2d38e69c 100644 --- a/pom.xml +++ b/pom.xml @@ -113,14 +113,10 @@ ehcache 3.9.9 - - - org.springframework.boot - spring-boot-dependencies - 2.7.8 - pom - import + commons-io + commons-io + 2.11.0 @@ -129,18 +125,6 @@ lombok 1.18.26 - - commons-io - commons-io - 2.11.0 - - - - - com.alibaba.fastjson2 - fastjson2 - 2.0.23 - From b9e76d8342a02d4813885b39e8fc2f4f5b693cc2 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 17 Jun 2024 19:50:27 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- .../listener/ModelBuildEventListener.java | 7 +-- .../com/alibaba/excel/util/BeanMapUtils.java | 4 +- .../com/alibaba/excel/util/ClassUtils.java | 2 +- .../com/alibaba/excel/util/FieldUtils.java | 3 +- .../write/executor/ExcelWriteAddExecutor.java | 4 +- easyexcel-support/pom.xml | 2 +- easyexcel-test/pom.xml | 8 ++-- .../easyexcel/test/temp/Xls03Test.java | 4 +- .../test/temp/write/TempWriteTest.java | 2 +- pom.xml | 44 +++++-------------- update.md | 6 +-- 12 files changed, 30 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc68ecf9..e4270c20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ 8, 11, 17] + java: [ 8, 11, 17, 21] distribution: [ 'adopt' ] fail-fast: false max-parallel: 4 diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java b/easyexcel-core/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java index c3fb3bc9..fab5a7c6 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java @@ -4,9 +4,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Map; -import javax.print.DocFlavor.STRING; - -import com.alibaba.excel.constant.EasyExcelConstants; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.enums.HeadKindEnum; @@ -17,15 +14,13 @@ import com.alibaba.excel.metadata.data.DataFormatData; import com.alibaba.excel.metadata.data.ReadCellData; import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; import com.alibaba.excel.read.metadata.property.ExcelReadHeadProperty; +import com.alibaba.excel.support.cglib.beans.BeanMap; import com.alibaba.excel.util.BeanMapUtils; -import com.alibaba.excel.util.BooleanUtils; import com.alibaba.excel.util.ClassUtils; import com.alibaba.excel.util.ConverterUtils; import com.alibaba.excel.util.DateUtils; import com.alibaba.excel.util.MapUtils; -import com.alibaba.excel.util.StringUtils; -import org.springframework.cglib.beans.BeanMap; /** * Convert to the object the user needs diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/util/BeanMapUtils.java b/easyexcel-core/src/main/java/com/alibaba/excel/util/BeanMapUtils.java index 30b2c692..29926aa0 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/util/BeanMapUtils.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/util/BeanMapUtils.java @@ -1,7 +1,7 @@ package com.alibaba.excel.util; -import org.springframework.cglib.beans.BeanMap; -import org.springframework.cglib.core.DefaultNamingPolicy; +import com.alibaba.excel.support.cglib.beans.BeanMap; +import com.alibaba.excel.support.cglib.core.DefaultNamingPolicy; /** * bean utils diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/util/ClassUtils.java b/easyexcel-core/src/main/java/com/alibaba/excel/util/ClassUtils.java index f9a53e08..3f3e14a0 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/util/ClassUtils.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/util/ClassUtils.java @@ -33,6 +33,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.metadata.property.FontProperty; import com.alibaba.excel.metadata.property.NumberFormatProperty; import com.alibaba.excel.metadata.property.StyleProperty; +import com.alibaba.excel.support.cglib.beans.BeanMap; import com.alibaba.excel.write.metadata.holder.WriteHolder; import lombok.AllArgsConstructor; @@ -41,7 +42,6 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; -import org.springframework.cglib.beans.BeanMap; /** * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/util/FieldUtils.java b/easyexcel-core/src/main/java/com/alibaba/excel/util/FieldUtils.java index 42cc3e4a..2d5647ca 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/util/FieldUtils.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/util/FieldUtils.java @@ -5,8 +5,7 @@ import java.lang.reflect.Modifier; import java.util.Map; import com.alibaba.excel.metadata.NullObject; - -import org.springframework.cglib.beans.BeanMap; +import com.alibaba.excel.support.cglib.beans.BeanMap; /** * Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java b/easyexcel-core/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java index 2bdd713f..d1d82cc2 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java @@ -1,12 +1,10 @@ package com.alibaba.excel.write.executor; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; -import java.util.TreeMap; import com.alibaba.excel.context.WriteContext; import com.alibaba.excel.enums.HeadKindEnum; @@ -14,6 +12,7 @@ import com.alibaba.excel.metadata.FieldCache; import com.alibaba.excel.metadata.FieldWrapper; import com.alibaba.excel.metadata.Head; import com.alibaba.excel.metadata.property.ExcelContentProperty; +import com.alibaba.excel.support.cglib.beans.BeanMap; import com.alibaba.excel.util.BeanMapUtils; import com.alibaba.excel.util.ClassUtils; import com.alibaba.excel.util.FieldUtils; @@ -30,7 +29,6 @@ import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; -import org.springframework.cglib.beans.BeanMap; /** * Add the data into excel diff --git a/easyexcel-support/pom.xml b/easyexcel-support/pom.xml index 20e7c937..85e5a533 100644 --- a/easyexcel-support/pom.xml +++ b/easyexcel-support/pom.xml @@ -21,7 +21,7 @@ org.springframework spring-core - 5.3.27 + 5.3.37 org.springframework diff --git a/easyexcel-test/pom.xml b/easyexcel-test/pom.xml index be59278c..cd1bdb91 100644 --- a/easyexcel-test/pom.xml +++ b/easyexcel-test/pom.xml @@ -29,17 +29,17 @@ com.alibaba.fastjson2 fastjson2 - 2.0.29 + 2.0.51 org.springframework.boot spring-boot-starter-web - 2.7.11 + 2.7.18 org.springframework.boot spring-boot-starter-test - 2.7.11 + 2.7.18 @@ -61,7 +61,7 @@ ch.qos.logback logback-classic - 1.2.12 + 1.5.6 diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java index 7d5a4490..a43525ae 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java @@ -3,14 +3,14 @@ package com.alibaba.easyexcel.test.temp; import java.util.List; import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.support.cglib.beans.BeanMap; +import com.alibaba.excel.support.cglib.core.DebuggingClassWriter; import com.alibaba.excel.util.BeanMapUtils; import com.alibaba.fastjson2.JSON; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.cglib.beans.BeanMap; -import org.springframework.cglib.core.DebuggingClassWriter; /** * 临时测试 diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java index 8c75deab..9f66a507 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/temp/write/TempWriteTest.java @@ -8,6 +8,7 @@ import java.util.Map; import com.alibaba.easyexcel.test.demo.read.CustomStringStringConverter; import com.alibaba.easyexcel.test.util.TestFileUtil; import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.support.cglib.beans.BeanMap; import com.alibaba.excel.util.BeanMapUtils; import com.alibaba.excel.util.FileUtils; import com.alibaba.excel.util.ListUtils; @@ -24,7 +25,6 @@ import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.junit.jupiter.api.Test; -import org.springframework.cglib.beans.BeanMap; @Slf4j public class TempWriteTest { diff --git a/pom.xml b/pom.xml index 2d38e69c..24f54ddc 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - 4.0.0-beta1 + 4.0.0 UTF-8 1.8 true @@ -90,40 +90,45 @@ com.alibaba easyexcel-support - ${revision} + 3.3.4 org.apache.poi poi - 5.2.3 + 5.2.5 org.apache.poi poi-ooxml - 5.2.3 + 5.2.5 org.apache.commons commons-csv - 1.10.0 + 1.11.0 org.ehcache ehcache - 3.9.9 + 3.10.8 commons-io commons-io 2.11.0 + + org.slf4j + slf4j-api + 1.7.36 + org.projectlombok lombok - 1.18.26 + 1.18.32 @@ -313,31 +318,6 @@ - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - - - ${project.groupId}:${project.artifactId} - - - - - org.springframework - com.alibaba.excel.support - - - - - - org.codehaus.mojo diff --git a/update.md b/update.md index 49416303..74ca52ed 100644 --- a/update.md +++ b/update.md @@ -1,7 +1,7 @@ -# 4.0.0-beta1 +# 4.0.0 -* `poi`由`4.1.2`升级到`5.2.3` -* `commons-csv`由`1.9.0`升级到`1.10.0` +* `poi`由`4.1.2`升级到`5.2.5` +* `commons-csv`由`1.1.0`升级到`1.10.0` * `slf4j-api`由`1.7.32`升级到`1.7.36` * `ehcache`由`3.9.9`升级到`3.10.8` From c68bf685c1289c985e0be004879ab56d7a8cc055 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 17 Jun 2024 19:57:03 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- update.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 24f54ddc..0a3da974 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ org.ehcache ehcache - 3.10.8 + 3.9.11 commons-io diff --git a/update.md b/update.md index 74ca52ed..b0fc5642 100644 --- a/update.md +++ b/update.md @@ -3,7 +3,8 @@ * `poi`由`4.1.2`升级到`5.2.5` * `commons-csv`由`1.1.0`升级到`1.10.0` * `slf4j-api`由`1.7.32`升级到`1.7.36` -* `ehcache`由`3.9.9`升级到`3.10.8` +* `ehcache`由`3.9.9`升级到`3.9.11` +* 支持`jdk21` # 3.3.4 From c0687903591df1fe02d6714deae2e6e1c74414b7 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 17 Jun 2024 20:02:43 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc5c9352..baa22739 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ easyexcel重写了poi对07版Excel的解析,一个3M的excel用POI sax解析 com.alibaba easyexcel - 3.3.4 + 4.0.0 ```