Skip to content

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

Open
@fbiville

Description

@fbiville

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3type=defectBug, not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions