You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Adam Winer (JIRA)" <ji...@apache.org> on 2008/09/03 02:09:44 UTC

[jira] Created: (SHINDIG-565) Don't use exceptions for set checking in UserId/GroupId.fromJson()

Don't use exceptions for set checking in UserId/GroupId.fromJson()
------------------------------------------------------------------

                 Key: SHINDIG-565
                 URL: https://issues.apache.org/jira/browse/SHINDIG-565
             Project: Shindig
          Issue Type: Improvement
            Reporter: Adam Winer
            Priority: Minor


UserId and GroupId.fromJson() are implemented like so:

    try {
      Type idSpecEnum = Type.valueOf(jsonId.substring(1));
      return new UserId(idSpecEnum, null);
    } catch (IllegalArgumentException e) {
      return new UserId(Type.userId, jsonId);
    }

Using exceptions for non-error cases is odd and inefficient.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-565) Don't use exceptions for set checking in UserId/GroupId.fromJson()

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

Adam Winer updated SHINDIG-565:
-------------------------------

    Attachment: shindig-565.patch

Patch to clean this up.

> Don't use exceptions for set checking in UserId/GroupId.fromJson()
> ------------------------------------------------------------------
>
>                 Key: SHINDIG-565
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-565
>             Project: Shindig
>          Issue Type: Improvement
>            Reporter: Adam Winer
>            Priority: Minor
>         Attachments: shindig-565.patch
>
>
> UserId and GroupId.fromJson() are implemented like so:
>     try {
>       Type idSpecEnum = Type.valueOf(jsonId.substring(1));
>       return new UserId(idSpecEnum, null);
>     } catch (IllegalArgumentException e) {
>       return new UserId(Type.userId, jsonId);
>     }
> Using exceptions for non-error cases is odd and inefficient.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SHINDIG-565) Don't use exceptions for set checking in UserId/GroupId.fromJson()

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

Paul Lindner resolved SHINDIG-565.
----------------------------------

    Resolution: Fixed

resolved with changes, better encapsulation.

> Don't use exceptions for set checking in UserId/GroupId.fromJson()
> ------------------------------------------------------------------
>
>                 Key: SHINDIG-565
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-565
>             Project: Shindig
>          Issue Type: Improvement
>            Reporter: Adam Winer
>            Priority: Minor
>         Attachments: shindig-565.patch
>
>
> UserId and GroupId.fromJson() are implemented like so:
>     try {
>       Type idSpecEnum = Type.valueOf(jsonId.substring(1));
>       return new UserId(idSpecEnum, null);
>     } catch (IllegalArgumentException e) {
>       return new UserId(Type.userId, jsonId);
>     }
> Using exceptions for non-error cases is odd and inefficient.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.