[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Developers] Data-related exceptions




"Ward, Evan" <Evan.Ward@nrl.navy.mil> a écrit :

Hi Yannick,

On Mon, 2018-07-02 at 08:56 +0000, JEANDROZ, Yannick [FR] wrote:

I believe this change would allow for a more lightweight code for Orekit users. What are your thoughts about this proposition ? If there is a consensus, I could push the analysis further and begin to tinker with Orekit code.

I am OK with making OrekitException a RuntimeException.

Wow, this would be a drastic change! For sure, it would solve Yannick
(and many others) problem.

What I like in checked exception is that you don't get surprised, the
compiler prevents you from creating code that does not check for errors.
However, I do agree that this can go out of hands if the code has many
internal checks and errors can be raised almost everywhere. So I admit
that we failed at some points and that as Yannick writes, almost every
method throws an OrekitException. Therefore, the current code is
crippled with throws declaration in too many places.

So... I'm on the fence on being convinced to follow Evan drastic suggestion.
What do other people think about this? Could someone push a little
harder to convince old school developers like me?

If we go this way, should we directly remove the "throws OrekitException"
declarations and remove the corresponding Javadoc? I think we should,
because with unchecked exceptions, the tools (IDE, compiler, checkstyle...)
will not help us maintain the consistency of such declarations, and it
will soon become inconsistent with underlying code.

best regards,
Luc


Best Regards,
Evan