lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [lucene-solr] branch jira/solr-14749-cluster-singleton updated: SOLR-14749: Use allowEmpty instead of required.
Date Mon, 12 Oct 2020 14:01:20 GMT
This is an automated email from the ASF dual-hosted git repository.

ab pushed a commit to branch jira/solr-14749-cluster-singleton
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/jira/solr-14749-cluster-singleton by this
push:
     new ef13cd9  SOLR-14749: Use allowEmpty instead of required.
ef13cd9 is described below

commit ef13cd92d42357a3192d33ad9949f46769264a7f
Author: Andrzej Bialecki <ab@apache.org>
AuthorDate: Mon Oct 12 16:00:51 2020 +0200

    SOLR-14749: Use allowEmpty instead of required.
---
 solr/core/src/java/org/apache/solr/api/AnnotatedApi.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java b/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java
index 1558f1c..f9f97a4 100644
--- a/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java
+++ b/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java
@@ -92,11 +92,11 @@ public class AnnotatedApi extends Api implements PermissionNameProvider
, Closea
    * Get a list of Api-s supported by this class.
    * @param theClass class
    * @param obj object of this class (may be null)
-   * @param required if true then an exception is thrown if no Api-s can be retrieved, if
false
+   * @param allowEmpty if false then an exception is thrown if no Api-s can be retrieved,
if true
    *                then absence of Api-s is silently ignored.
    * @return list of discovered Api-s
    */
-  public static List<Api> getApis(Class<? extends Object> theClass , Object obj,
boolean required)  {
+  public static List<Api> getApis(Class<? extends Object> theClass , Object obj,
boolean allowEmpty)  {
     Class<?> klas = null;
     try {
       klas = MethodHandles.publicLookup().accessClass(theClass);
@@ -131,7 +131,7 @@ public class AnnotatedApi extends Api implements PermissionNameProvider
, Closea
         SpecProvider specProvider = readSpec(endPoint, Collections.singletonList(m));
         apis.add(new AnnotatedApi(specProvider, endPoint, Collections.singletonMap("", cmd),
null));
       }
-      if (required && apis.isEmpty()) {
+      if (!allowEmpty && apis.isEmpty()) {
         throw new RuntimeException("Invalid Class : " + klas.getName() + " No @EndPoints");
       }
 


Mime
View raw message