Commit 28ce4056 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

searching for nadh drug resulted with a drug with empty name

parent 11c17743
Pipeline #17295 passed with stage
in 13 minutes and 19 seconds
......@@ -8,6 +8,7 @@ minerva (14.0.5) stable; urgency=medium
* Bug fix: uploading of the page with low internet connection speed could
produce empty screen for several seconds/minutes - now the loading icon is
present (#1025)
* Bug fix: search for NADH drug resulted in drug with empty name (#1018)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 02 Dec 2019 16:00:00 +0200
......
......@@ -88,6 +88,7 @@ public class Drug implements Serializable, TargettingStructure {
if (drug == null) {
return;
}
this.name = drug.name;
this.sources.addAll(drug.getSources());
this.description = drug.description;
this.brandNames.addAll(drug.getBrandNames());
......
......@@ -32,8 +32,10 @@ public class DrugTest extends AnnotationTestFunctions {
public void testConstructor() {
Drug d = new Drug();
d.setDescription("x");
d.setName("y");
Drug copy = new Drug(d);
assertEquals("x", copy.getDescription());
assertEquals("y", copy.getName());
}
@Test
......
......@@ -190,8 +190,8 @@ public class DrugService extends DbSearchService implements IDrugService {
logger.error("Problem with accessing drugBank parser", e);
}
try {
Set<String> foundDrugs = new HashSet<String>();
Set<String> searchNames = new HashSet<String>();
Set<String> foundDrugs = new HashSet<>();
Set<String> searchNames = new HashSet<>();
// two step searching in Chembl:
// * search for name
searchNames.add(name);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment