diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index f5da5302c4..60d727fda0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -11,9 +11,8 @@ import com.fr.plugin.observer.PluginEventListener; import com.fr.report.ExtraReportClassManager; import com.fr.report.fun.ReportSupportedFileProvider; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; +import java.util.LinkedHashSet; import java.util.Set; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -23,7 +22,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; */ public class FileNodeConstants { - private static List supportFileType; + private static Set supportFileType; private static ReadWriteLock rwl = new ReentrantReadWriteLock(); private FileNodeConstants() { @@ -47,16 +46,14 @@ public class FileNodeConstants { private static void addAppExtensions(FileExtension[] extensions) { for (int i = 0, size = extensions.length; i < size; i++) { - if (!supportFileType.contains(extensions[i].getExtension())) { - supportFileType.add(extensions[i].getExtension()); - } + supportFileType.add(extensions[i].getExtension()); } } private static void initSupportedTypes() { try { rwl.writeLock().lock(); - supportFileType = new ArrayList(); + supportFileType = new LinkedHashSet<>(); //通过插件扩展的 Set providers = ExtraReportClassManager.getInstance().getArray(ReportSupportedFileProvider.XML_TAG); for (ReportSupportedFileProvider provider : providers) {