Skip to content

Commit c8a64f4

Browse files
committed
per suggestions
1 parent 78a17d9 commit c8a64f4

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/main/java/org/hydev/mcpm/client/commands/entries/SearchPackagesController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ public SearchPackagesController(SearchPackagesBoundary searcher) {
3434
public void searchPackages(List<String> pluginNames, Consumer<String> log) {
3535
throw new NotImplementedException();
3636
}
37-
}
37+
}

src/main/java/org/hydev/mcpm/client/database/inputs/SearchPackagesInput.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
/**
44
* Input for the SearchPackagesBoundary.
55
*
6-
* @param type An int that specifies the type of search.
7-
* 1 if the search is by name, 2 if the search is by command. Else the search is by keyword.
6+
* @param type Specifies the type of search.
87
* @param searchStr String containing the name, keyword, or command to search by.
98
* @param noCache If true, the ListPackagesBoundary will re-download the database before performing the request.
109
*

src/main/java/org/hydev/mcpm/client/database/searchusecase/SearchInteractor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public SearchInteractor(DatabaseFetcher fetcher) {
3737
public SearchInteractor(DatabaseFetcher fetcher, DatabaseFetcherListener listener) {
3838
this.fetcher = fetcher;
3939
this.listener = listener;
40-
4140
}
4241

4342
/**

src/main/java/org/hydev/mcpm/client/database/searchusecase/SearcherByName.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ public Map<String, List<PluginModel>> constructSearchMaps(List<PluginModel> plug
4747
* Returns null if inp is not a string.
4848
*/
4949
@Override
50-
public List<PluginModel> getSearchList(Object inp, List<PluginModel> plugins) {
50+
public List<PluginModel> getSearchList(String inp, List<PluginModel> plugins) {
5151
// Instantiate if null
5252
if (SearcherByName.nameMap == null) {
5353
SearcherByName.nameMap = constructSearchMaps(plugins);
5454
}
55-
if (!(inp instanceof String name))
56-
return null;
57-
return SearcherByName.nameMap.get(name);
55+
return SearcherByName.nameMap.get(inp.toLowerCase());
5856
}
5957
}

0 commit comments

Comments
 (0)