Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void afterCellDispose(CellWriteHandlerContext context) {
Cell cell = context.getCell();

if (BooleanUtils.isFalse(context.getHead()) && cell.getColumnIndex() != 0) {
RecordData record = (RecordData) context.getOriginalRecord();
RecordData record = context.getOriginalRecord();
log.info("写入数据:{}", record);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge impacting performance and security part on write record with info level.

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public String convertToJavaData(ReadConverterContext<?> context) {
@Override
public WriteCellData<?> convertToExcelData(WriteConverterContext<String> context) {
// 获取原始数据
RecordData record = (RecordData) context.getRecord();
RecordData record = context.getRecord();
log.info("原始数据:{}", record);
return new WriteCellData<>("自定义:" + context.getValue() + "-" + record.getDoubleData());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@

package org.apache.fesod.excel.converters;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid import *

import org.apache.fesod.excel.context.WriteContext;
import org.apache.fesod.excel.metadata.property.ExcelContentProperty;

Expand Down Expand Up @@ -58,4 +54,9 @@ public class WriteConverterContext<T> {
* write context
*/
private WriteContext writeContext;

@SuppressWarnings("unchecked")
public <E extends Object> E getRecord() {
return (E) record;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,9 @@ public CellWriteHandlerContext(
this.head = head;
this.excelContentProperty = excelContentProperty;
}

@SuppressWarnings("unchecked")
public <E extends Object> E getOriginalRecord() {
return (E) originalRecord;
}
}