Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13388

FileExchangeRateProvider is not a public class, but appears in config files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 8.0
    • 8.1, 9.0
    • Schema and Analysis
    • None

    Description

      While working on LUCENE-8738, jpountz figured out that Solr tests were failing becase FileExchangeRateProvider is not a public class. Reason for this:

      In Java 11, Class#newInstance is deprecated, as it does not work correctly with Exceptions. The suggested replacement is to use getDeclaredConctructor(). But we decided to use getConstructor(), as all dynamic code who instantiates a class, e.g., from a config file, should only do this using public APIs.

      But this caused Solr to fail as some config files refer this class, which is "package private"! So we should fix this bug and make the class public! All managed-schema files are referring a package private class (as default).

      In the Java-11 branch we already fixed this, but it's a bug also in Java 8. It just works, because the code who instantiates the class is luckily in the correct package.

      Attachments

        1. SOLR-13388.patch
          0.9 kB
          Uwe Schindler

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: