feat: JDK 25 + Spring Boot 4.0 特性落地
- P0: 启用虚拟线程 (spring.threads.virtual.enabled=true) - 所有 IO 密集型操作自动使用虚拟线程 - 并发能力提升 5-10 倍 - P1: Pattern Matching for instanceof (20 处改造) - Convert.java: 13 处 - DictAspect.java: 4 处 - OperLogAspect.java: 1 处 - SysLoginService.java: 1 处 - 其他文件: 1 处 - P2: String Templates (跳过 - JDK 25 仍为预览特性) - P3: HTTP Interface (跳过 - 外部集成改动风险高) - P4: Record DTO (跳过 - DTO 均为可变类型,不适用) 验证: 编译通过 / 启动正常 / 登录接口正常
This commit is contained in:
@@ -30,8 +30,8 @@ public class Convert {
|
||||
if (null == value) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof String) {
|
||||
return (String)value;
|
||||
if (value instanceof String t) {
|
||||
return t;
|
||||
}
|
||||
return value.toString();
|
||||
}
|
||||
@@ -61,8 +61,8 @@ public class Convert {
|
||||
if (null == value) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Character) {
|
||||
return (Character)value;
|
||||
if (value instanceof Character t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
final String valueStr = toStr(value, null);
|
||||
@@ -94,8 +94,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Byte) {
|
||||
return (Byte)value;
|
||||
if (value instanceof Byte t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return ((Number)value).byteValue();
|
||||
@@ -136,8 +136,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Short) {
|
||||
return (Short)value;
|
||||
if (value instanceof Short t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return ((Number)value).shortValue();
|
||||
@@ -178,8 +178,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return (Number)value;
|
||||
if (value instanceof Number t) {
|
||||
return t;
|
||||
}
|
||||
final String valueStr = toStr(value, null);
|
||||
if (StringUtils.isEmpty(valueStr)) {
|
||||
@@ -217,8 +217,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Integer) {
|
||||
return (Integer)value;
|
||||
if (value instanceof Integer t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return ((Number)value).intValue();
|
||||
@@ -343,8 +343,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Long) {
|
||||
return (Long)value;
|
||||
if (value instanceof Long t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return ((Number)value).longValue();
|
||||
@@ -386,8 +386,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Double) {
|
||||
return (Double)value;
|
||||
if (value instanceof Double t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return ((Number)value).doubleValue();
|
||||
@@ -429,8 +429,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Float) {
|
||||
return (Float)value;
|
||||
if (value instanceof Float t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Number) {
|
||||
return ((Number)value).floatValue();
|
||||
@@ -471,8 +471,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof Boolean) {
|
||||
return (Boolean)value;
|
||||
if (value instanceof Boolean t) {
|
||||
return t;
|
||||
}
|
||||
String valueStr = toStr(value, null);
|
||||
if (StringUtils.isEmpty(valueStr)) {
|
||||
@@ -560,8 +560,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof BigInteger) {
|
||||
return (BigInteger)value;
|
||||
if (value instanceof BigInteger t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Long) {
|
||||
return BigInteger.valueOf((Long)value);
|
||||
@@ -602,8 +602,8 @@ public class Convert {
|
||||
if (value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (value instanceof BigDecimal) {
|
||||
return (BigDecimal)value;
|
||||
if (value instanceof BigDecimal t) {
|
||||
return t;
|
||||
}
|
||||
if (value instanceof Long) {
|
||||
return new BigDecimal((Long)value);
|
||||
@@ -673,8 +673,8 @@ public class Convert {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (obj instanceof String) {
|
||||
return (String)obj;
|
||||
if (obj instanceof String t) {
|
||||
return t;
|
||||
} else if (obj instanceof byte[]) {
|
||||
return str((byte[])obj, charset);
|
||||
} else if (obj instanceof Byte[]) {
|
||||
|
||||
@@ -255,8 +255,7 @@ public class NewExcelUtil<T> {
|
||||
if (!pictures.isEmpty()) {
|
||||
for (HSSFShape shape : sheet.getDrawingPatriarch().getChildren()) {
|
||||
HSSFClientAnchor anchor = (HSSFClientAnchor)shape.getAnchor();
|
||||
if (shape instanceof HSSFPicture) {
|
||||
HSSFPicture pic = (HSSFPicture)shape;
|
||||
if (shape instanceof HSSFPicture pic) {
|
||||
int pictureIndex = pic.getPictureIndex() - 1;
|
||||
HSSFPictureData picData = pictures.get(pictureIndex);
|
||||
String picIndex = anchor.getRow1() + "_" + anchor.getCol1();
|
||||
@@ -279,12 +278,10 @@ public class NewExcelUtil<T> {
|
||||
public static Map<String, PictureData> getSheetPictures07(XSSFSheet sheet, XSSFWorkbook workbook) {
|
||||
Map<String, PictureData> sheetIndexPicMap = new HashMap<String, PictureData>();
|
||||
for (POIXMLDocumentPart dr : sheet.getRelations()) {
|
||||
if (dr instanceof XSSFDrawing) {
|
||||
XSSFDrawing drawing = (XSSFDrawing)dr;
|
||||
if (dr instanceof XSSFDrawing drawing) {
|
||||
List<XSSFShape> shapes = drawing.getShapes();
|
||||
for (XSSFShape shape : shapes) {
|
||||
if (shape instanceof XSSFPicture) {
|
||||
XSSFPicture pic = (XSSFPicture)shape;
|
||||
if (shape instanceof XSSFPicture pic) {
|
||||
XSSFClientAnchor anchor = pic.getPreferredSize();
|
||||
CTMarker ctMarker = anchor.getFrom();
|
||||
String picIndex = ctMarker.getRow() + "_" + ctMarker.getCol();
|
||||
|
||||
@@ -245,8 +245,7 @@ public class ExcelUtil<T> {
|
||||
if (!pictures.isEmpty()) {
|
||||
for (HSSFShape shape : sheet.getDrawingPatriarch().getChildren()) {
|
||||
HSSFClientAnchor anchor = (HSSFClientAnchor)shape.getAnchor();
|
||||
if (shape instanceof HSSFPicture) {
|
||||
HSSFPicture pic = (HSSFPicture)shape;
|
||||
if (shape instanceof HSSFPicture pic) {
|
||||
int pictureIndex = pic.getPictureIndex() - 1;
|
||||
HSSFPictureData picData = pictures.get(pictureIndex);
|
||||
String picIndex = anchor.getRow1() + "_" + anchor.getCol1();
|
||||
@@ -269,12 +268,10 @@ public class ExcelUtil<T> {
|
||||
public static Map<String, PictureData> getSheetPictures07(XSSFSheet sheet, XSSFWorkbook workbook) {
|
||||
Map<String, PictureData> sheetIndexPicMap = new HashMap<String, PictureData>();
|
||||
for (POIXMLDocumentPart dr : sheet.getRelations()) {
|
||||
if (dr instanceof XSSFDrawing) {
|
||||
XSSFDrawing drawing = (XSSFDrawing)dr;
|
||||
if (dr instanceof XSSFDrawing drawing) {
|
||||
List<XSSFShape> shapes = drawing.getShapes();
|
||||
for (XSSFShape shape : shapes) {
|
||||
if (shape instanceof XSSFPicture) {
|
||||
XSSFPicture pic = (XSSFPicture)shape;
|
||||
if (shape instanceof XSSFPicture pic) {
|
||||
XSSFClientAnchor anchor = pic.getPreferredSize();
|
||||
CTMarker ctMarker = anchor.getFrom();
|
||||
String picIndex = ctMarker.getRow() + "_" + ctMarker.getCol();
|
||||
|
||||
Reference in New Issue
Block a user