You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Uwe Schindler (Jira)" <ji...@apache.org> on 2020/05/05 15:31:00 UTC

[jira] [Comment Edited] (SOLR-14426) forbidden api error during precommit DateMathFunction

    [ https://issues.apache.org/jira/browse/SOLR-14426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17100004#comment-17100004 ] 

Uwe Schindler edited comment on SOLR-14426 at 5/5/20, 3:30 PM:
---------------------------------------------------------------

This is the usual problem with the old-style package-private classes which are in same source file than the main class. I fixed some of them already, but they are bad Java style. The only workaround is to do ant clean. The problem is that Java/Javac/Gradle/Ant can't figure out where the class file is coming from. When it gets recompiled, the leftover class without source file is a relic leading to those failures. It's not really forbiddenapis fault, because the class file should not be there at all.

We can only fix that at some point. Eclipse is also getting angry about those quite often.

To fix this, the classes should be moverd as static inner class into the main class. In most cases this can be done with copypaste, but there's no automated  refactoring in Eclipse. Maybe other IDEs have better refactoring tools.


was (Author: thetaphi):
This is the usual problem with the old-style package-private classes which are in same source file than the main class. I fixed some of them already, but they are bad Java style. The only workaround is to do ant clean. The problem is that Java/Javac/Gradle/Ant can't figure out where the class file is coming from. When it gets recompiled, the leftover class without source file is a leftover.

We can only fix that at some point. Eclipse is also getting angry about those quite often.

To fix this, the classes should be moverd as static inner class into the main class. In most cases this can be done with copypaste, but there's no automated  refactoring in Eclipse. Maybe other IDEs have better refactoring tools.

> forbidden api error during precommit DateMathFunction
> -----------------------------------------------------
>
>                 Key: SOLR-14426
>                 URL: https://issues.apache.org/jira/browse/SOLR-14426
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Build
>            Reporter: Mike Drob
>            Priority: Major
>
> When running `./gradlew precommit` I'll occasionally see
> {code}
> * What went wrong:
> Execution failed for task ':solr:contrib:analytics:forbiddenApisMain'.
> > de.thetaphi.forbiddenapis.ForbiddenApiException: Check for forbidden API calls failed while scanning class 'org.apache.solr.analytics.function.mapping.DateMathFunction' (DateMathFunction.java): java.lang.ClassNotFoundException: org.apache.solr.analytics.function.mapping.DateMathValueFunction (while looking up details about referenced class 'org.apache.solr.analytics.function.mapping.DateMathValueFunction')
> {code}
> `./gradlew clean` fixes this, but I don't understand what or why this happens. Feels like a gradle issue?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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