[
https://issues.apache.org/jira/browse/DRILL-2680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14496606#comment-14496606
]
Daniel Barclay (Drill) edited comment on DRILL-2680 at 7/9/15 11:08 PM:
------------------------------------------------------------------------
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 see 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}
was (Author: dsbos):
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}
> [umbrella] Assertions, thrown AssertionErrors should include some message text
> ------------------------------------------------------------------------------
>
> 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)
> Fix For: 1.2.0
>
>
> 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)