From ad57ac7b26a58f4b376da0450adf68ebe14d5c35 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 28 Aug 2019 09:13:56 +0800 Subject: [PATCH] fix #506 --- .../write/metadata/holder/AbstractWriteHolder.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java index f6cce67..adaf840 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java @@ -307,7 +307,6 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ // classify Map, List> result = new HashMap, List>(16); - result.put(WriteHandler.class, new ArrayList()); result.put(WorkbookWriteHandler.class, new ArrayList()); result.put(SheetWriteHandler.class, new ArrayList()); result.put(RowWriteHandler.class, new ArrayList()); @@ -315,20 +314,13 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ for (WriteHandler writeHandler : cleanUpHandlerList) { if (writeHandler instanceof CellWriteHandler) { result.get(CellWriteHandler.class).add(writeHandler); - } - if (writeHandler instanceof RowWriteHandler) { + } else if (writeHandler instanceof RowWriteHandler) { result.get(RowWriteHandler.class).add(writeHandler); - } - if (writeHandler instanceof SheetWriteHandler) { + } else if (writeHandler instanceof SheetWriteHandler) { result.get(SheetWriteHandler.class).add(writeHandler); - } - if (writeHandler instanceof SheetWriteHandler) { - result.get(SheetWriteHandler.class).add(writeHandler); - } - if (writeHandler instanceof WorkbookWriteHandler) { + } else if (writeHandler instanceof WorkbookWriteHandler) { result.get(WorkbookWriteHandler.class).add(writeHandler); } - result.get(WriteHandler.class).add(writeHandler); } return result; }