[jira] Resolved: (MAHOUT-10) Replace fall-through exception handlers with propagated unchecked exception.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MAHOUT-10) Replace fall-through exception handlers with propagated unchecked exception.

Soren Daugaard (Jira)

     [ https://issues.apache.org/jira/browse/MAHOUT-10?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dawid Weiss resolved MAHOUT-10.
-------------------------------

    Resolution: Fixed

Applied to trunk.

> Replace fall-through exception handlers with propagated unchecked exception.
> ----------------------------------------------------------------------------
>
>                 Key: MAHOUT-10
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-10
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Clustering
>    Affects Versions: 0.1
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>         Attachments: mah-10.patch
>
>
> I am doing a belated code review. There certain issues that I would like to change, for example fall-through exception handlers like this one:
>     try {
>       Class cl = Class.forName(job.get(DISTANCE_MEASURE_KEY));
>       measure = (DistanceMeasure) cl.newInstance();
>       measure.configure(job);
>     } catch (Exception e) {
>       e.printStackTrace();
>     }
> This prints the stack trace of an exception to the console, but continues thread's execution after the catch clause. Since distance measure key is required, this makes little sense. A runtime exception should be thrown -- this stops the job and causes a full stack trace to be displayed anyway (with the nested exception's message).

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