[
https://issues.apache.org/jira/browse/GEODE-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14626509#comment-14626509
]
ASF subversion and git services commented on GEODE-94:
------------------------------------------------------
Commit d993684693c2cf0da02f2282232aaf0d29bfbbdc in incubator-geode's branch
refs/heads/develop from [[email protected]]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=d993684 ]
GEODE-94: Add typecast to prevent ambiguous method calls under JDK 8
Add typecast to Object for ambiguous logger arguments.
> 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
> Assignee: 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)