geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirk Lund (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GEODE-94) Compilation under JDK 8 fails due to ambiguous method calls
Date Fri, 10 Jul 2015 20:48:04 GMT
Kirk Lund created GEODE-94:
------------------------------

             Summary: Compilation under JDK 8 fails due to ambiguous method calls
                 Key: GEODE-94
                 URL: https://issues.apache.org/jira/browse/GEODE-94
             Project: Geode
          Issue Type: Bug
            Reporter: Kirk Lund


If you change the build from JDK 7 compatible to straight JDK 8, the build fails due to ambiguous
method calls.

This is caused by improvements in JDK 8's Type Inference.

See:
1 - https://docs.oracle.com/javase/tutorial/java/generics/genTypeInference.html
2 - https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.12.2.5
3 - https://docs.oracle.com/javase/specs/jls/se8/html/jls-18.html#jls-18.5.1

There are only 6 lines of code (at this time) in Geode that fail to build due to this. They
are all calls to logger methods with (StringId, Object) parameters. Classes are:

1) FRAG2 (gemfire-jgroups) 
2) SMACK (gemfire-jgroups) 
3) UDP_NIO (gemfire-jgroups) 
4) VIEW_ENFORCER (gemfire-jgroups) 
5) JGroupMembershipManager (gemfire-core)

Example from JGroups code:

if(log.isInfoEnabled()) log.info(ExternalStrings.UDP_NIO_RECEIVED_CONFIG_EVENT__0, evt.getArg());

This can be fixed simply by casting the 2nd argument to an Object:

if(log.isInfoEnabled()) log.info(ExternalStrings.UDP_NIO_RECEIVED_CONFIG_EVENT__0, (Object)evt.getArg());




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message