Skip to content

Delete CommonsLogErrorReporter — stub class is worse than removal #311

@bjagg

Description

@bjagg

Context

PR #303 gutted CommonsLogErrorReporter since it was a YUI Compressor / Rhino ErrorReporter adapter that's no longer needed:

@Deprecated
public class CommonsLogErrorReporter {
    private final Log logger;

    public CommonsLogErrorReporter() {
        this.logger = LogFactory.getLog(CommonsLogErrorReporter.class);
    }

    public CommonsLogErrorReporter(Log logger) {
        this.logger = logger;
    }
}

Problem

The class still has constructors but no methods. Any existing code that does new CommonsLogErrorReporter(log) and uses the result as an org.mozilla.javascript.ErrorReporter will fail at runtime with NoSuchMethodError or ClassCastException — the interface is no longer implemented.

The current state is worse than either extreme: keeping the class with working methods, or deleting it entirely and letting classloading fail loudly.

Proposed fix

Delete CommonsLogErrorReporter.java entirely. Any adopter with a binary dependency on it will get a clear ClassNotFoundException at startup rather than subtle runtime failures.

Priority

Low — unlikely anyone is depending on this class directly. Filing as a follow-up to PR #303.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions