Browse Source

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

bugfix/10.0
alex.sung 6 years ago
parent
commit
ad14f65c1e
  1. 6
      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. 12
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

6
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> recentList = RecentSearchManager.getInstance().getRecentModelList();
List<AlphaCellModel> recommendList = RecommendSearchManager.getInstance().getRecommendModelList(); List<AlphaCellModel> recommendList = RecommendSearchManager.getInstance().getRecommendModelList();
SearchResult filterResult = new SearchResult(); SearchResult filterResult = new SearchResult();
if(recentList != null && recommendList != null){ filterResult.addAll(recentList);
filterResult.addAll(recentList); filterResult.addAll(recommendList);
filterResult.addAll(recommendList);
}
return filterResult; 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 Directory directory = null;
private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer); private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer);
private IndexWriter indexWriter = null; private IndexWriter indexWriter = null;
private SearchResult recentModelList; private SearchResult recentModelList = new SearchResult();
public static RecentSearchManager getInstance() { public static RecentSearchManager getInstance() {

12
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 { public class RecommendSearchManager implements AlphaFineSearchProvider {
private static volatile RecommendSearchManager instance; private static volatile RecommendSearchManager instance;
private SearchResult modelList; private SearchResult modelList = new SearchResult();
private SearchResult recommendModelList; private SearchResult recommendModelList = new SearchResult();
private SearchResult complementAdviceModelList; private SearchResult complementAdviceModelList;
private SearchResult moreModelList = new SearchResult(); private SearchResult moreModelList = new SearchResult();
@ -187,11 +187,9 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
public List<AlphaCellModel> getRecommendModelList() { public List<AlphaCellModel> getRecommendModelList() {
SearchResult result = new SearchResult(); SearchResult result = new SearchResult();
if(recommendModelList != null){ result.addAll(recommendModelList);
result.addAll(recommendModelList); result.addAll(modelList);
result.addAll(modelList); result.addAll(moreModelList);
result.addAll(moreModelList);
}
return result; return result;
} }

Loading…
Cancel
Save