You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Andreas Schaefer <sc...@me.com.INVALID> on 2018/07/06 19:45:59 UTC

Issue with Animal Snigger Maven Plugin

Hi

Will developing some code in org-apache-sling-resourceresolver I ran into an issue with the animal sniffer maven plugin.

I create an Interface that contains:
- an enum called ‘CHECK'
- an inner class that is named’ Check'
- that inner class has a private variable 'CHECK check’

Then I see this report while building the module:

[INFO] --- animal-sniffer-maven-plugin:1.16:check (default) @ org.apache.sling.resourceresolver ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java17:1.0
[ERROR] /Users/schaefa/Development/madplanet.com/apache/sling-dev/sling-git/org-apache-sling-resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:993: Undefined reference: org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CHECK
[ERROR] /Users/schaefa/Development/madplanet.com/apache/sling-dev/sling-git/org-apache-sling-resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:993: Undefined reference: org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CHECK org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CHECK.found

Renaming the enum to something else like ‘STATUS’ did resolve the issue.

Upgrading to 1.17 did caused the same issue but I now see this error which seems to indicate an issue with the plugin itself:

[ERROR] Failed to execute goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.17:check (default) on project org.apache.sling.resourceresolver: Execution default of goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.17:check failed: An API incompatibility was encountered while executing org.codehaus.mojo:animal-sniffer-maven-plugin:1.17:check: java.lang.NoSuchMethodError: java.nio.CharBuffer.position(I)Ljava/nio/CharBuffer;
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:animal-sniffer-maven-plugin:1.17
…

Did anyone see something similar?

Cheers - Andy Schaefer

Re: Issue with Animal Snigger Maven Plugin

Posted by Robert Munteanu <ro...@apache.org>.
Hi Andy,

On Fri, 2018-07-06 at 12:45 -0700, Andreas Schaefer wrote:

(snip)

> Then I see this report while building the module:
> 
> [INFO] --- animal-sniffer-maven-plugin:1.16:check (default) @
> org.apache.sling.resourceresolver ---
> [INFO] Checking unresolved references to
> org.codehaus.mojo.signature:java17:1.0
> [ERROR] /Users/schaefa/Development/madplanet.com/apache/sling-
> dev/sling-git/org-apache-sling-
> resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl
> /mapping/MapEntries.java:993: Undefined reference:
> org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CH
> ECK
> [ERROR] /Users/schaefa/Development/madplanet.com/apache/sling-
> dev/sling-git/org-apache-sling-
> resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl
> /mapping/MapEntries.java:993: Undefined reference:
> org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CH
> ECK
> org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CH
> ECK.found

(snip)

> Did anyone see something similar?

I have not, maybe put something up on Github so we can try?

Thanks,

Robert

Re: Issue with Animal Snigger Maven Plugin

Posted by Justin Edelson <ju...@justinedelson.com>.
I don't know if this is necessarily related to the problem you are having,
but FWIW, doing this will cause problems on case-insensitive filesystems --
depending on the compile sequencing (I assume it is the sequence in the
file, but I'm not sure), the class file for Check will overwrite the class
file for CHECK.

Personally, I would stay away from names that are so possibly conflatable,
either by humans or machines.

Regards,
Justin

On Fri, Jul 6, 2018 at 3:46 PM Andreas Schaefer <sc...@me.com.invalid>
wrote:

> Hi
>
> Will developing some code in org-apache-sling-resourceresolver I ran into
> an issue with the animal sniffer maven plugin.
>
> I create an Interface that contains:
> - an enum called ‘CHECK'
> - an inner class that is named’ Check'
> - that inner class has a private variable 'CHECK check’
>
> Then I see this report while building the module:
>
> [INFO] --- animal-sniffer-maven-plugin:1.16:check (default) @
> org.apache.sling.resourceresolver ---
> [INFO] Checking unresolved references to
> org.codehaus.mojo.signature:java17:1.0
> [ERROR] /Users/schaefa/Development/
> madplanet.com/apache/sling-dev/sling-git/org-apache-sling-resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:993:
> Undefined reference:
> org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CHECK
> [ERROR] /Users/schaefa/Development/
> madplanet.com/apache/sling-dev/sling-git/org-apache-sling-resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:993:
> Undefined reference:
> org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CHECK
> org.apache.sling.resourceresolver.impl.mapping.PlaceholderProvider.CHECK.found
>
> Renaming the enum to something else like ‘STATUS’ did resolve the issue.
>
> Upgrading to 1.17 did caused the same issue but I now see this error which
> seems to indicate an issue with the plugin itself:
>
> [ERROR] Failed to execute goal
> org.codehaus.mojo:animal-sniffer-maven-plugin:1.17:check (default) on
> project org.apache.sling.resourceresolver: Execution default of goal
> org.codehaus.mojo:animal-sniffer-maven-plugin:1.17:check failed: An API
> incompatibility was encountered while executing
> org.codehaus.mojo:animal-sniffer-maven-plugin:1.17:check:
> java.lang.NoSuchMethodError:
> java.nio.CharBuffer.position(I)Ljava/nio/CharBuffer;
> [ERROR] -----------------------------------------------------
> [ERROR] realm =
> plugin>org.codehaus.mojo:animal-sniffer-maven-plugin:1.17
> …
>
> Did anyone see something similar?
>
> Cheers - Andy Schaefer