Browse Source

代码质量:从源头返回空list

bugfix/10.0
alex.sung 6 years ago
parent
commit
ad14f65c1e
  1. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  3. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -104,10 +104,8 @@ public class AlphaFineHelper {
List<AlphaCellModel> recentList = RecentSearchManager.getInstance().getRecentModelList();
List<AlphaCellModel> recommendList = RecommendSearchManager.getInstance().getRecommendModelList();
SearchResult filterResult = new SearchResult();
if(recentList != null && recommendList != null){
filterResult.addAll(recentList);
filterResult.addAll(recommendList);
}
return filterResult;
}

2
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() {

6
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<AlphaCellModel> getRecommendModelList() {
SearchResult result = new SearchResult();
if(recommendModelList != null){
result.addAll(recommendModelList);
result.addAll(modelList);
result.addAll(moreModelList);
}
return result;
}

Loading…
Cancel
Save