You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2019/04/10 16:19:00 UTC

[jira] [Updated] (SOLR-13388) FileExchangeRateProvider is not a public class, but appears in config files

     [ https://issues.apache.org/jira/browse/SOLR-13388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated SOLR-13388:
---------------------------------
    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 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.

  was:
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 instances. The suggested replacement is to use getDeclaredConctructor(). But we decided to use getConstructor(), as all dynamic code who instantiates a class 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.


> FileExchangeRateProvider is not a public class, but appears in config files
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-13388
>                 URL: https://issues.apache.org/jira/browse/SOLR-13388
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Schema and Analysis
>            Reporter: Uwe Schindler
>            Priority: Major
>
> 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 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org