You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Robert Kanter (JIRA)" <ji...@apache.org> on 2017/11/16 19:27:00 UTC

[jira] [Commented] (HADOOP-13493) Compatibility Docs should clarify the policy for what takes precedence when a conflict is found

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

Robert Kanter commented on HADOOP-13493:
----------------------------------------

The patch basically says that the most inner thing has priority.  For instance, a method supersedes a class.  However, in your example in this JIRA, it was the opposite - the class superseded the method.  I'm actually wondering if maybe that's the correct way (and the patch is backwards).  Think about this: if a class is marked as private, then no methods in it should be public because how could you access that method without first accessing that class?

> Compatibility Docs should clarify the policy for what takes precedence when a conflict is found
> -----------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-13493
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13493
>             Project: Hadoop Common
>          Issue Type: Task
>          Components: documentation
>    Affects Versions: 2.7.2
>            Reporter: Robert Kanter
>            Assignee: Daniel Templeton
>            Priority: Critical
>         Attachments: HADOOP-13493.001.patch
>
>
> The Compatibility Docs (https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-common/Compatibility.html#Java_API) list the policies for Private, Public, not annotated, etc Classes and members, but it doesn't say what happens when there's a conflict.  We should try obviously try to avoid this situation, but it would be good to explicitly state what takes precedence.
> As an example, until YARN-3225 made it consistent, {{RefreshNodesRequest}} looked like this:
> {code:java}
> @Private
> @Stable
> public abstract class RefreshNodesRequest {
>   @Public
>   @Stable
>   public static RefreshNodesRequest newInstance() {
>     RefreshNodesRequest request = Records.newRecord(RefreshNodesRequest.class);
>     return request;
>   }
> }
> {code}
> Note that the class is marked {{\@Private}}, but the method is marked {{\@Public}}.
> In this example, I'd say that the class level should have priority.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org