Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation error for multidimensional array constructor reference #59

Closed
marek-parfianowicz opened this issue Dec 16, 2019 · 2 comments · Fixed by #156
Closed

Instrumentation error for multidimensional array constructor reference #59

marek-parfianowicz opened this issue Dec 16, 2019 · 2 comments · Fixed by #156
Labels
bug Something isn't working resolved
Milestone

Comments

@marek-parfianowicz
Copy link
Member

Uwe Schindler created an issue 2018-02-11
When compiling the following code, Clover fails:

private static byte[][] toPayloads(String... strings) { return Arrays.stream(strings).map(s -> s == null ? null : s.getBytes(StandardCharsets.UTF_8)).toArray(byte[][]::new); }

This is similar to, but this time it affects array initializer with multiple dimensions: https://jira.atlassian.com/browse/CLOV-1984

Error:

common.compile-test: [mkdir] Created dir: /home/jenkins/jenkins-slave/workspace/Lucene-Solr-Clover-master/lucene/build/analysis/opennlp/classes/test [javac] Compiling 5 source files to /home/jenkins/jenkins-slave/workspace/Lucene-Solr-Clover-master/lucene/build/analysis/opennlp/classes/test [clover] Clover Version 4.0.4, built on April 15 2015 (build-957) [clover] Loaded from: /home/jenkins/.ivy2/cache/com.atlassian.clover/clover/jars/clover-4.0.4.jar [clover] Clover: Open Source License registered to Apache. [clover] Updating existing database at '/home/jenkins/jenkins-slave/workspace/Lucene-Solr-Clover-master/lucene/build/clover/db/coverage.db'. [clover] Processing files at 1.8 source level. [clover] /home/jenkins/jenkins-slave/workspace/Lucene-Solr-Clover-master/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPPOSFilterFactory.java:56:12:unexpected token: Arrays [clover] /home/jenkins/jenkins-slave/workspace/Lucene-Solr-Clover-master/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPPOSFilterFactory.java:56:12:unexpected token: Arrays [clover] ** Error(s) occurred and the instrumentation process can't continue.

This error message was from previous Atlassian Clover, but also happens with OpenClover. I just had no example message ready.

@marek-parfianowicz
Copy link
Member Author

Uwe Schindler REPORTER
This affects the Clover build of Apache Lucene, since we added the new OpenNLP module. We recently updated our builds to OpenClover (see https://issues.apache.org/jira/browse/LUCENE-8169).

The work around is to exclude the OpenNLP test files from instrumenting. We do not want to change the code, because method references like this are the way how to do this typical "toArray()" stuff in Java 8.

@marek-parfianowicz marek-parfianowicz added this to the 4.6.0 milestone Dec 16, 2019
@marek-parfianowicz
Copy link
Member Author

Original report: https://bitbucket.org/openclover/clover/issues/59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant