Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Anticipating a change in IProblemFactory

If you are NOT using compiler internal API IProblemFactory, then you may
ignore this note.

The current definition of IProblemFactory says that #createProblem(...) is
answering
org.eclipse.jdt.core.compiler.IProblem.
We would like to change this into
org.eclipse.jdt.core.compiler.CategorizedProblem

CategorizedProblem is an extension of IProblem introduced in 3.2, which
offers possibility
to categorize problems better and have participant issue their own problems
in a non
colliding fashion (i.e. no longer need to worry about colliding problem
IDs).

Since IProblemFactory is not public API, this is not a breaking change; but
they are a few
users of our batch compiler technology out there, and we would like them to
speak up if
they want to veto this change.

If we do not perform the change, then we internally need to swallow
arbitrary IProblem
and CategorizedProblem, which is causing unnecessary pain.

NOTE: if you are simply using:
org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory
then no change is required, since it will get leveraged for free.

This is what IProblemFactory would look like after the change:

package org.eclipse.jdt.internal.compiler;
import java.util.Locale;
import org.eclipse.jdt.core.compiler.*;
public interface IProblemFactory {
      CategorizedProblem createProblem(
            char[] originatingFileName,
            int problemId,
            String[] problemArguments,
            String[] messageArguments, // shorter versions of the
problemArguments
            int severity,
            int startPosition,
            int endPosition,
            int lineNumber);
      Locale getLocale();
      String getLocalizedMessage(int problemId, String[] messageArguments);
}



Back to the top