airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] 02/02: AIRAVATA-3102 if no accessible experiments, return empty list
Date Wed, 10 Jul 2019 19:49:18 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit eca17b443cc255deb4c10ac0461bf8cb2b8fbc0e
Author: Marcus Christie <machrist@iu.edu>
AuthorDate: Wed Jul 10 15:49:06 2019 -0400

    AIRAVATA-3102 if no accessible experiments, return empty list
---
 .../core/repositories/expcatalog/ExperimentSummaryRepository.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentSummaryRepository.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentSummaryRepository.java
index ca75d62..68a7e4e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentSummaryRepository.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentSummaryRepository.java
@@ -292,10 +292,13 @@ public class ExperimentSummaryRepository extends ExpCatAbstractRepository<Experi
             query += "ES.executionId LIKE :" + DBConstants.Experiment.EXECUTION_ID + " AND
";
         }
 
-        if (experimentIds != null) {
+        if (!experimentIds.isEmpty()) {
             logger.debug("Filter Experiments by experimentIds");
             queryParameters.put(DBConstants.Experiment.EXPERIMENT_ID, experimentIds);
             query += "ES.experimentId IN :" + DBConstants.Experiment.EXPERIMENT_ID + " AND
";
+        } else {
+            // If no experiments are accessible then immediately return an empty list
+            return new ArrayList<ExperimentSummaryModel>();
         }
 
         if (resourceHostName != null) {


Mime
View raw message