Compare commits

..

2 Commits

Author SHA1 Message Date
a
1e62b4e3bc Merge branch 'async' of git@github.com:Stirling-Tools/Stirling-PDF.git into async 2025-06-20 11:26:56 +01:00
Anthony Stirling
1a998f4cdc remove 2025-06-20 10:43:43 +01:00

View File

@ -8,7 +8,6 @@ import java.util.concurrent.atomic.AtomicReference;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*; import org.aspectj.lang.annotation.*;
import org.springframework.beans.BeanUtils;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -251,11 +250,10 @@ public class AutoJobAspect {
if (arg instanceof PDFFile pdfFile) { if (arg instanceof PDFFile pdfFile) {
// Create a copy of PDFFile to avoid mutating the original // Create a copy of PDFFile to avoid mutating the original
// Using direct property access instead of reflection for better performance
PDFFile pdfFileCopy = new PDFFile(); PDFFile pdfFileCopy = new PDFFile();
pdfFileCopy.setFileId(pdfFile.getFileId());
// Use Spring's BeanUtils to copy all properties, avoiding missed fields if PDFFile pdfFileCopy.setFileInput(pdfFile.getFileInput());
// grows
BeanUtils.copyProperties(pdfFile, pdfFileCopy);
// Case 1: fileId is provided but no fileInput // Case 1: fileId is provided but no fileInput
if (pdfFileCopy.getFileInput() == null && pdfFileCopy.getFileId() != null) { if (pdfFileCopy.getFileInput() == null && pdfFileCopy.getFileId() != null) {