Added backward compatibility support for corpusQuery parameter.

Change-Id: I1fc6721c62fad1b40f0fe2f5c9a398d2d97722f6
diff --git a/core/Changes b/core/Changes
index 038b9ce..c35049b 100644
--- a/core/Changes
+++ b/core/Changes
@@ -5,7 +5,9 @@
    - Disabled some unused web-services: search post, query serialization, 
      collocation base (margaretha)
 11/07/2019
-   - Added cq parameter to VC statistics API and deprecate corpusQuery (margaretha) 
+   - Added cq parameter to VC statistics API and deprecate corpusQuery (margaretha)
+15/07/2019
+   - Added backward compatibility support for corpusQuery parameter (margaretha)    
 
 # version 0.62
 18/03/2019
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java b/core/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java
index 66eb27a..84c4bb8 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java
@@ -79,20 +79,17 @@
         String stats;
         String json = null;
         boolean isDeprecated = false;
-        boolean hasCq = false;
         try {
             if (cq != null && !cq.isEmpty()) {
                 builder.with(cq);
                 json = builder.toJSON();
-                hasCq = true;
             }
-            if (corpusQuery != null && !corpusQuery.isEmpty()) {
+            else if (corpusQuery != null && !corpusQuery.isEmpty()) {
+                builder.with(corpusQuery);
+                json = builder.toJSON();
                 isDeprecated = true;
-                if (!hasCq) {
-                    builder.with(corpusQuery);
-                    json = builder.toJSON();
-                }
             }
+            
             stats = searchKrill.getStatistics(json);
             
             if (isDeprecated){