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

A deferred diagnostic of a second compilation error on the same element is not reported #124

Open
fbiville opened this issue Jun 23, 2017 · 1 comment
Labels
P3 type=defect Bug, not working as expected

Comments

@fbiville
Copy link
Contributor

fbiville commented Jun 23, 2017

Versions

  • compile-testing: 0.10 (cannot upgrade to 0.11 because of the incompatibilities of Guava 18 from Neo4j and Guava 20 required by the truth assertion library pulled by compile-testing 0.11, see Inline Guava #125).
  • javac: 1.8.0_65
  • OS: Mac OS 10.12.5

Context

In Neo4j, an aggregation function is defined with an @UserAggregationFunction-annotated method whose returned type's enclosing class (aka aggregation type) must define two methods, one annotated with @UserAggregationUpdate, another @UserAggregationResult.

Now, I have got a unit test that makes sure that an aggregation type without those two annotations triggers two compilation errors (1 for the missing @UserAggregationUpdate, 1 for the missing @UserAggregationResult).

First diagnostic

After debugging a bit com.google.testing.compile.Compiler#compile(java.lang.Iterable<? extends javax.tools.JavaFileObject>), it seems the deferred diagnostic for the second compilation error never comes, despite both errors being sent.

How to reproduce

## setup steps
 $> git clone -b update_compiler_3.2 [email protected]:fbiville/neo4j.git && cd neo4j 
## this one may take some time (https://xkcd.com/303/)
 $> mvn -am -pl community/procedure-compiler/processor clean install -DskipTests
 $> sed -i.bak '/@Ignore/d' community/procedure-compiler/processor/src/test/java/org/neo4j/tooling/procedure/UserAggregationFunctionProcessorTest.java
## actually run the failing test
 $> mvn test -Dtest="UserAggregationFunctionProcessorTest#fails_if_aggregation_function_exposes_return_type_without_aggregation_methods" -f community/procedure-compiler/processor/pom.xml
@netdpb
Copy link
Member

netdpb commented May 24, 2021

Some older versions of the compiler don't report more than one diagnostic on a single line. Are you still seeing this problem? Which JDK are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 type=defect Bug, not working as expected
Projects
None yet
Development

No branches or pull requests

4 participants