Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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




Back to the top