You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Daniel Barclay (Drill) (JIRA)" <ji...@apache.org> on 2015/04/15 20:02:58 UTC

[jira] [Commented] (DRILL-2680) Assertions, thrown AssertionErrors should include some message text [umbrella/tracking bug]

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

Daniel Barclay (Drill) commented on DRILL-2680:
-----------------------------------------------

Partial info:

{{grep -r '\bassert\b[^.][^:]*;' . --include="*.java" | grep -v "/target/"}} yields about 250 raw locations (raw in the sense of not filtering out cases where a message probably isn't really needed)

At the moment I can't find cases with {{throw new AssertionError()}} that I thought I remembered seeing.

However, in searching now, I need a number of cases of {{throw new UnsupportedOperationException()}} that could use a message (and some of which should be some kind of "unexpected-case" exception (e.g., AssertionError)), for example:
{{noformat}}
  public static MajorType overrideMinorType(final MajorType originalMajorType, final MinorType overrideMinorType) {
    switch (originalMajorType.getMode()) {
      case REPEATED:
        return repeated(overrideMinorType);
      case OPTIONAL:
        return optional(overrideMinorType);
      case REQUIRED:
        return required(overrideMinorType);
      default:
        throw new UnsupportedOperationException();
    }
  }
{{noformat}}




> Assertions, thrown AssertionErrors should include some message text [umbrella/tracking bug]
> -------------------------------------------------------------------------------------------
>
>                 Key: DRILL-2680
>                 URL: https://issues.apache.org/jira/browse/DRILL-2680
>             Project: Apache Drill
>          Issue Type: Task
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>
> Drill seems to have a lot of "assert ..." statements and "throw new AssertionError()" cases that include no message text.
> Many of them should at least include a phrase or two about what's wrong.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)