JDK-8203477 : reference to [method] is ambiguous
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: generic
  • CPU: x86_64
  • Submitted: 2018-05-18
  • Updated: 2018-07-14
  • Resolved: 2018-05-22
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
The github issue and Travis report shows different JDK 11 environment where the error occurs, here's one of them corresponding to a recent JDK11 :

openjdk version "11-ea" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11-ea+13)
OpenJDK 64-Bit Server VM 18.9 (build 11-ea+13, mixed mode)

A DESCRIPTION OF THE PROBLEM :
AssertJ Core open source project (https://github.com/joel-costigliola/assertj-core) fails to compile under JDK 11 when it compiles successfully with JDK 8, JDK 9  and JDK 10.

The issue has been in reported in https://github.com/joel-costigliola/assertj-core/issues/1232.

The compilation error occurs in different environments and JDK 11 EA versions as per the previous issue description and the following Travis CI build report: https://travis-ci.org/joel-costigliola/assertj-core/builds/375047906?utm_source=github_status&utm_medium=notification


REGRESSION : Last worked in version 10.0.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
clone assertj core: git clone https://github.com/joel-costigliola/assertj-core.git
compile it including the tests: mvn clean test

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Successful compilation
ACTUAL -
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/api/AutoCloseableBDDSoftAssertionsTest.java:[62,13] reference to then is ambiguous
  both method <T>then(T) in org.assertj.core.api.Java6AbstractBDDSoftAssertions and method then(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractBDDSoftAssertions match
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/perf/SoftAssertionsPerfTest.java:[214,13] reference to assertThat is ambiguous
  both method <T>assertThat(T) in org.assertj.core.api.Java6AbstractStandardSoftAssertions and method assertThat(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractStandardSoftAssertions match
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/api/SoftAssertionsTest.java:[219,13] reference to assertThat is ambiguous
  both method <T>assertThat(T) in org.assertj.core.api.Java6AbstractStandardSoftAssertions and method assertThat(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractStandardSoftAssertions match
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/api/Assertions_assertThat_with_CharSequence_Test.java:[35,61] reference to assertThat is ambiguous
  both method assertThat(java.lang.CharSequence) in org.assertj.core.api.Assertions and method <T>assertThat(T) in org.assertj.core.api.Assertions match
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/api/Assertions_assertThat_with_CharSequence_Test.java:[41,61] reference to assertThat is ambiguous
  both method assertThat(java.lang.CharSequence) in org.assertj.core.api.Assertions and method <T>assertThat(T) in org.assertj.core.api.Assertions match
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/api/BDDSoftAssertionsTest.java:[216,13] reference to then is ambiguous
  both method <T>then(T) in org.assertj.core.api.Java6AbstractBDDSoftAssertions and method then(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractBDDSoftAssertions match
[ERROR] /home/joel/prog/assertj/assertj-core-3.x/src/test/java/org/assertj/core/api/AutoCloseableSoftAssertionsTest.java:[71,13] reference to assertThat is ambiguous
  both method <T>assertThat(T) in org.assertj.core.api.Java6AbstractStandardSoftAssertions and method assertThat(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractStandardSoftAssertions match
[INFO] 7 errors 

---------- BEGIN SOURCE ----------
git clone https://github.com/joel-costigliola/assertj-core.git
compile it including the tests: mvn clean test

I'm going to try write a smaller test case for this issue, in the meantime, this is the steps to reproduce this issue. 
---------- END SOURCE ----------

FREQUENCY : always



Comments
This seems like a source compatibility, expected, issue provoked by JDK-8137326
22-05-2018

Regression started from 11 ea b04 onwards 10 GA - Pass 11 ea b03 - Pass 11 ea b04 - Fail 11 ea b13 - Fail
21-05-2018

There is nothing changed in 11 ea b04 as part of javac that can cause this isssue. One likely change in core-libs JDK-8137326 which has changed for "Methods for comparing CharSequence, StringBuilder, and StringBuffer" Forwarding dev to mark component/subcomponent properly
21-05-2018

I am able to reproduce this issue in 11 ea b13 == [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/api/SoftAssertionsTest.java:[219,13] reference to assertThat is ambiguous both method <T>assertThat(T) in org.assertj.core.api.Java6AbstractStandardSoftAssertions and method assertThat(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractStandardSoftAssertions match [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/api/BDDSoftAssertionsTest.java:[216,13] reference to then is ambiguous both method <T>then(T) in org.assertj.core.api.Java6AbstractBDDSoftAssertions and method then(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractBDDSoftAssertions match [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/api/Assertions_assertThat_with_CharSequence_Test.java:[35,61] reference to assertThat is ambiguous both method assertThat(java.lang.CharSequence) in org.assertj.core.api.Assertions and method <T>assertThat(T) in org.assertj.core.api.Assertions match [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/api/Assertions_assertThat_with_CharSequence_Test.java:[41,61] reference to assertThat is ambiguous both method assertThat(java.lang.CharSequence) in org.assertj.core.api.Assertions and method <T>assertThat(T) in org.assertj.core.api.Assertions match [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/api/AutoCloseableBDDSoftAssertionsTest.java:[62,13] reference to then is ambiguous both method <T>then(T) in org.assertj.core.api.Java6AbstractBDDSoftAssertions and method then(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractBDDSoftAssertions match [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/api/AutoCloseableSoftAssertionsTest.java:[71,13] reference to assertThat is ambiguous both method <T>assertThat(T) in org.assertj.core.api.Java6AbstractStandardSoftAssertions and method assertThat(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractStandardSoftAssertions match [ERROR] /scratch/fairoz/JI/9053857/assertj-core/src/test/java/org/assertj/core/perf/SoftAssertionsPerfTest.java:[214,13] reference to assertThat is ambiguous both method <T>assertThat(T) in org.assertj.core.api.Java6AbstractStandardSoftAssertions and method assertThat(java.lang.CharSequence) in org.assertj.core.api.Java6AbstractStandardSoftAssertions match [INFO] 7 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ ==
21-05-2018