diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index a1c901d9ff..1057d92868 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -104,10 +104,8 @@ public class AlphaFineHelper { List recentList = RecentSearchManager.getInstance().getRecentModelList(); List recommendList = RecommendSearchManager.getInstance().getRecommendModelList(); SearchResult filterResult = new SearchResult(); - if(recentList != null && recommendList != null){ - filterResult.addAll(recentList); - filterResult.addAll(recommendList); - } + filterResult.addAll(recentList); + filterResult.addAll(recommendList); return filterResult; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 93fb511bc3..72a4859774 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -57,7 +57,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private Directory directory = null; private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer); private IndexWriter indexWriter = null; - private SearchResult recentModelList; + private SearchResult recentModelList = new SearchResult(); public static RecentSearchManager getInstance() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 467eee07fb..e15c5b9661 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -26,8 +26,8 @@ import java.util.List; */ public class RecommendSearchManager implements AlphaFineSearchProvider { private static volatile RecommendSearchManager instance; - private SearchResult modelList; - private SearchResult recommendModelList; + private SearchResult modelList = new SearchResult(); + private SearchResult recommendModelList = new SearchResult(); private SearchResult complementAdviceModelList; private SearchResult moreModelList = new SearchResult(); @@ -187,11 +187,9 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { public List getRecommendModelList() { SearchResult result = new SearchResult(); - if(recommendModelList != null){ - result.addAll(recommendModelList); - result.addAll(modelList); - result.addAll(moreModelList); - } + result.addAll(recommendModelList); + result.addAll(modelList); + result.addAll(moreModelList); return result; }