Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Coding horror

Well looking at the blame annotation, that code was last touched in 2006, and I'm pretty sure that whomever wrote it isn't around any more.

If this is getting in your way so much, I would suggest you post a patch.

In the meantime, if you need to debug this, you can always put a dummy line of code in the catch statement and set a breakpoint on it.

===========================
Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto
Inactive hide details for Jesper Eskilson <jesper.eskilson@xxxxxx>Jesper Eskilson <jesper.eskilson@xxxxxx>


          Jesper Eskilson <jesper.eskilson@xxxxxx>
          Sent by: cdt-dev-bounces@xxxxxxxxxxx

          05/04/2009 04:41 AM

          Please respond to
          "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To

"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

cc


Subject

[cdt-dev] Coding horror


This actually gets me wondering about coding discipline in CDT. The
following code snipped is from Option.java:

>     public IOptionApplicability getApplicabilityCalculator() {
>         if (applicabilityCalculator == null) {
>             if (applicabilityCalculatorElement != null) {
>                 try {
>                     if (applicabilityCalculatorElement
>                             .getAttribute(APPLICABILITY_CALCULATOR) != null)
>                         applicabilityCalculator = (IOptionApplicability) applicabilityCalculatorElement
>                                 .createExecutableExtension(APPLICABILITY_CALCULATOR);
>                 } catch (CoreException e) {
>                 }
>             } else if (superClass != null)
>                 applicabilityCalculator = superClass
>                         .getApplicabilityCalculator();
>         }
>
>         return applicabilityCalculator;
>     }

The code is executed when attemping to create a custom applicability
calculator. If an exception is thrown by createExecutableExtension(), it
is silently catched and ignored. No error is logged anywhere. This means
that *any* exception thrown during the instantiation of a custom
applicability calculator will be silently ignored. (HAHA! Loser!
Throwing an exception in an initializer. What an IDIOT! Lets just ignore
him.)

I then ran a search for "catch (.*) \{\s*\}" in all the CDT-projects in
my workspace, and got over 800 hits.

Now I'll stop whining, and get back to work.

--
/Jesper


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

GIF image

GIF image

GIF image


Back to the top