You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Woody Anderson (JIRA)" <ji...@apache.org> on 2011/05/09 20:26:03 UTC

[jira] [Created] (PIG-2053) PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate

PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate
---------------------------------------------------------------------------------

                 Key: PIG-2053
                 URL: https://issues.apache.org/jira/browse/PIG-2053
             Project: Pig
          Issue Type: Improvement
    Affects Versions: 0.10
            Reporter: Woody Anderson
            Priority: Minor
             Fix For: 0.10
         Attachments: 2053.patch

This is a code style/quality improvement.

isAssignableFrom is appropriate when the class is not known at compile type, but assignment needs to be checked.
e.g. foo.getClass().isAssignableFrom(bar.getClass())

but, if the class of foo is known (e.g. X.class), then instanceof is more appropriate and readable.
i also made use of de morgan's to simply the "is combininable" boolean statement, which is hard to grok as written.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIG-2053) PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Gates updated PIG-2053:
----------------------------

    Status: Patch Available  (was: Open)

Submitting patch so this can get reviewed and committed.

> PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate
> ---------------------------------------------------------------------------------
>
>                 Key: PIG-2053
>                 URL: https://issues.apache.org/jira/browse/PIG-2053
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: 0.10
>            Reporter: Woody Anderson
>            Priority: Minor
>              Labels: newbie
>             Fix For: 0.10
>
>         Attachments: 2053.patch
>
>
> This is a code style/quality improvement.
> isAssignableFrom is appropriate when the class is not known at compile type, but assignment needs to be checked.
> e.g. foo.getClass().isAssignableFrom(bar.getClass())
> but, if the class of foo is known (e.g. X.class), then instanceof is more appropriate and readable.
> i also made use of de morgan's to simply the "is combininable" boolean statement, which is hard to grok as written.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2053) PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate

Posted by "Thejas M Nair (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thejas M Nair updated PIG-2053:
-------------------------------

    Resolution: Fixed
      Assignee: Woody Anderson
        Status: Resolved  (was: Patch Available)

> PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate
> ---------------------------------------------------------------------------------
>
>                 Key: PIG-2053
>                 URL: https://issues.apache.org/jira/browse/PIG-2053
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: 0.10
>            Reporter: Woody Anderson
>            Assignee: Woody Anderson
>            Priority: Minor
>              Labels: newbie
>             Fix For: 0.10
>
>         Attachments: 2053.patch
>
>
> This is a code style/quality improvement.
> isAssignableFrom is appropriate when the class is not known at compile type, but assignment needs to be checked.
> e.g. foo.getClass().isAssignableFrom(bar.getClass())
> but, if the class of foo is known (e.g. X.class), then instanceof is more appropriate and readable.
> i also made use of de morgan's to simply the "is combininable" boolean statement, which is hard to grok as written.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2053) PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate

Posted by "Woody Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Woody Anderson updated PIG-2053:
--------------------------------

    Attachment: 2053.patch

patch

> PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate
> ---------------------------------------------------------------------------------
>
>                 Key: PIG-2053
>                 URL: https://issues.apache.org/jira/browse/PIG-2053
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: 0.10
>            Reporter: Woody Anderson
>            Priority: Minor
>             Fix For: 0.10
>
>         Attachments: 2053.patch
>
>
> This is a code style/quality improvement.
> isAssignableFrom is appropriate when the class is not known at compile type, but assignment needs to be checked.
> e.g. foo.getClass().isAssignableFrom(bar.getClass())
> but, if the class of foo is known (e.g. X.class), then instanceof is more appropriate and readable.
> i also made use of de morgan's to simply the "is combininable" boolean statement, which is hard to grok as written.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIG-2053) PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate

Posted by "Thejas M Nair (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067076#comment-13067076 ] 

Thejas M Nair commented on PIG-2053:
------------------------------------

+1 
Patch committed to trunk.
Thanks Woody!

> PigInputFormat uses class.isAssignableFrom() where instanceof is more appropriate
> ---------------------------------------------------------------------------------
>
>                 Key: PIG-2053
>                 URL: https://issues.apache.org/jira/browse/PIG-2053
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: 0.10
>            Reporter: Woody Anderson
>            Priority: Minor
>              Labels: newbie
>             Fix For: 0.10
>
>         Attachments: 2053.patch
>
>
> This is a code style/quality improvement.
> isAssignableFrom is appropriate when the class is not known at compile type, but assignment needs to be checked.
> e.g. foo.getClass().isAssignableFrom(bar.getClass())
> but, if the class of foo is known (e.g. X.class), then instanceof is more appropriate and readable.
> i also made use of de morgan's to simply the "is combininable" boolean statement, which is hard to grok as written.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira