geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-3723) Reconsider using Optional<String> as the parameter for getRequiredPermissions
Date Wed, 04 Oct 2017 20:59:00 GMT

    [ https://issues.apache.org/jira/browse/GEODE-3723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16192025#comment-16192025
] 

ASF subversion and git services commented on GEODE-3723:
--------------------------------------------------------

Commit 5e868d38b8091227fc08768d33a017e8d1e72411 in geode's branch refs/heads/develop from
Karen Miller
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=5e868d3 ]

GEODE-3723 Revise javadoc defn of getRequiredPermissions parameter (#864)



> Reconsider using Optional<String> as the parameter for getRequiredPermissions
> -----------------------------------------------------------------------------
>
>                 Key: GEODE-3723
>                 URL: https://issues.apache.org/jira/browse/GEODE-3723
>             Project: Geode
>          Issue Type: Bug
>          Components: security
>            Reporter: Dan Smith
>            Assignee: Karen Smoler Miller
>             Fix For: 1.3.0
>
>
> The new method on function, getRequiredPermissions takes an Optional<String> as
parameter.
> At point point, we added a parameterized type to the function interface (Function<T>).
However, if someone tries to implement Function without the type (eg implements Function instead
of implemments Function<Object>), then they get the below compilation error:
> {noformat}
> Error:(85, 41) java: name clash: getRequiredPermissions(java.util.Optional<java.lang.String>)
in org.apache.geode.cache.lucene.internal.distributed.WaitUntilFlushedFunction and getRequiredPermissions(java.util.Optional<java.lang.String>)
in org.apache.geode.cache.execute.Function have the same erasure, yet neither overrides the
other
> {noformat}
> In addition to this annoyance Optional is generally discouraged as a parameter to a method
in favor of method overloading. At least my IDE is providing a warning to that effect. Maybe
having an overloaded method for getRequiredPermissions would be better?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message