[moved to dev] The AsyncInvocation lambdas in MultiUserDUnitTest.testMultiUser do appear to be ambiguous to me even if the later releases of JDK 1.8.0 no longer detects it as ambiguous.
The 1st AsyncInvocation ends up invoking "public <T> AsyncInvocation<T> invokeAsync(final name, final SerializableCallableIF<T> callable)" while the later AsyncInvocation calls in that test end up invoking "public <T> AsyncInvocation<T> invokeAsync(final name, final SerializableRunnableIF serializable)". The structure of the lambda blocks look identical to me (no return and no unchecked exceptions). That 1st call has no return value do differentiate it as a callable instead of runnable, and in fact, if I insert a typecast to SerializableRunnableIF it still compiles and runs fine but ends up invoking the SerializableRunnableIF method instead of the SerializableCallableIF<T> one: Open MultiUserDUnitTest in IntelliJ or Eclipse, and follow the call to invokeAsync, you'll see the following is interpreted as *SerializableCallableIF*<T>: AsyncInvocation vm1Invoke = vm1.*invokeAsync*("run as data-reader", () -> { String shellId = getClass().getSimpleName() + "_vm1"; HeadlessGfsh shell = new HeadlessGfsh(shellId, 30, gfshDir); while (true) { connect((String) results[0], (Integer) results[1], (Integer) results[2], shell, "data-reader", "1234567"); Awaitility.waitAtMost(5, TimeUnit.MILLISECONDS); shell.executeCommand("disconnect"); } }); Calls "public <T> AsyncInvocation<T> invokeAsync(final name, final *SerializableCallableIF*<T> callable)" Next insert this typecast: AsyncInvocation vm1Invoke = vm1.*invokeAsync*("run as data-reader", *(SerializableRunnableIF)*() -> { String shellId = getClass().getSimpleName() + "_vm1"; HeadlessGfsh shell = new HeadlessGfsh(shellId, 30, gfshDir); while (true) { connect((String) results[0], (Integer) results[1], (Integer) results[2], shell, "data-reader", "1234567"); Awaitility.waitAtMost(5, TimeUnit.MILLISECONDS); shell.executeCommand("disconnect"); } }); Now it calls "public <T> AsyncInvocation<T> invokeAsync(final name, final *SerializableRunnableIF* serializable)" A later version of 1.8.0 must have changed the inference rules slightly. The later uses of AsyncInvocation in that same test look just as ambiguous to me and yet they all call the SerializableRunnableIF flavor by default instead of SerializableCallableIF. The potential for the block of code to throw an unchecked Exception might potentially cause a non-returning block to be interpreted as a Callable instead of Serializable, but that's not happening in this case. -Kirk On Wed, Feb 1, 2017 at 9:07 AM, Dan Smith <dsm...@pivotal.io> wrote: > Ah - I misread your JDK version. 1.8.0-b132 is *older* than 1.8.0_92-b14. > Building with a newer JDK should fix the issue. > > -Dan > > On Wed, Feb 1, 2017 at 8:53 AM, Kevin Duling <kdul...@pivotal.io> wrote: > >> It's also building fine with : >> >> java version "1.8.0_92" >>> Java(TM) SE Runtime Environment (build 1.8.0_92-b14) >>> Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode) >> >> I would suggest trying this, too: >> >> ./gradlew build -x spotlessCheck -x rat -x javadoc -x test >> >> I'm not sure -Dskip.tests=true works. >> >> On Wed, Feb 1, 2017 at 7:20 AM, Anthony Baker <aba...@pivotal.io> wrote: >> >>> Seems to run clean on the latest Oracle JDK: >>> >>> ~/code/incubator-geode (develop)$ java -version >>> java version "1.8.0_121" >>> Java(TM) SE Runtime Environment (build 1.8.0_121-b13) >>> Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) >>> >>> Anthony >>> >>> >>> > On Jan 31, 2017, at 9:35 PM, Dan Smith <dsm...@pivotal.io> wrote: >>> > >>> > Hi Jags! >>> > >>> > Good to hear from you! I think it is related to the version of java 8 >>> that you are using. At least I know Anil hit that error with 1.8.0_20 and >>> it went away by upgrading. See this earlier mail conversation - >>> http://markmail.org/thread/srdhtpnelaa6axn4. But if have the latest JDK >>> maybe this issue is back :( >>> > >>> > -Dan >>> > >>> > On Tue, Jan 31, 2017 at 8:44 PM, Anthony Baker <aba...@pivotal.io> >>> wrote: >>> > Hi Jags! >>> > >>> > The master branch is the last release; the develop branch is the >>> staging area for new work. What JDK are you using? What build command? >>> > >>> > I ran `gradle clean build` without trouble from the develop branch >>> without seeing this error. >>> > >>> > Anthony >>> > >>> > >>> >> On Jan 31, 2017, at 8:16 PM, Jags Ramnarayan < >>> jramnara...@snappydata.io> wrote: >>> >> >>> >> Hi friends, >>> >> Trying to build from source but ran into this .... I shouldn't >>> be on the develop branch ? >>> >> >>> >> -------------- >>> >> /Users/jramnara/git/geode/geode-core/src/test/java/org/apach >>> e/geode/management/internal/security/MultiUserDUnitTest.java:62: error: >>> reference to invokeAsync is ambiguous >>> >> >>> >> AsyncInvocation vm1Invoke = vm1.invokeAsync("run as data-reader", >>> () -> { >>> >> >>> >> ^ >>> >> >>> >> both method invokeAsync(String,SerializableRunnableIF) in VM and >>> method <T>invokeAsync(String,SerializableCallableIF<T>) in VM match >>> >> >>> >> where T is a type-variable: >>> >> >>> >> T extends Object declared in method <T>invokeAsync(String,Serializ >>> ableCallableIF<T>) >>> >> >>> >> /Users/jramnara/git/geode/geode-core/src/test/java/org/apach >>> e/geode/security/templates/LdapUserAuthenticator.java:89: warning: >>> LdapCtxFactory is internal proprietary API and may be removed in a future >>> release >>> >> >>> >> env.put(Context.INITIAL_CONTEXT_FACTORY, >>> com.sun.jndi.ldap.LdapCtxFactory.class.getName()); >>> >> >>> >> ^ >>> >> >>> >> Note: Some input files use or override a deprecated API. >>> >> >>> >> Note: Recompile with -Xlint:deprecation for details. >>> >> >>> >> Note: Some input files use unchecked or unsafe operations. >>> >> >>> >> Note: Recompile with -Xlint:unchecked for details. >>> >> >>> >> 1 error >>> >> >>> >> 1 warning >>> >> >>> >> :geode-core:compileTestJava FAILED >>> >> >>> >> -------- >>> >> >>> >> >>> >> >>> >> ----- >>> >> >>> >> Jags >>> >> SnappyData blog >>> >> Download binary, source >>> >> >>> > >>> > >>> >>> >> >