[ImageJ-devel] @Parameter fields - don't make them final

Curtis Rueden ctrueden at wisc.edu
Fri May 27 12:46:03 CDT 2011


Hi Dscho,

I actually like the idea of Eiffel to have multiple levels of contract
> checking. We do not have that in Java (unless we implement it ourselves),
> but at least we could have assertions, right?
>

There are a handful of assertions sprinkled throughout the IJ2 code, but no
formal policy on when they should be used, as of yet.

We do have a sort of multi-level contract checking, in that there are
multiple levels of logging. Calling Log.error is most severe, followed by
Log.warn, then Log.info, and lastly Log.debug. I would say calls to
Log.error and Log.warn are two different levels of severity as far as
notifying the user of abnormalities in execution. And of course, more severe
than any log message would be throwing an exception.

Regards,
Curtis

On Thu, May 26, 2011 at 1:22 PM, Johannes Schindelin <
Johannes.Schindelin at gmx.de> wrote:

> Hi,
>
> On Thu, 26 May 2011, Curtis Rueden wrote:
>
> > I implemented a fix yesterday:
>
> I should have known :0)
>
> >   http://dev.imagejdev.org/trac/imagej/ticket/543
> >   http://dev.imagejdev.org/trac/imagej/changeset/2957
> >
> > It simply flags the parameter as "resolved," meaning it will not appear
> > in the input dialog.
> >
> > I also added a warning message if a final parameter is detected:
> >   http://dev.imagejdev.org/trac/imagej/changeset/2958
> >
> > However, we could be stricter and throw an exception instead, as you
> > suggest. What do you think?
>
> I actually like the idea of Eiffel to have multiple levels of contract
> checking. We do not have that in Java (unless we implement it ourselves),
> but at least we could have assertions, right?
>
> Ciao,
> Dscho
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20110527/9e3471d0/attachment.html>


More information about the ImageJ-devel mailing list