Example usage for org.aspectj.bridge IMessage getSourceStart

List of usage examples for org.aspectj.bridge IMessage getSourceStart

Introduction

In this page you can find the example usage for org.aspectj.bridge IMessage getSourceStart.

Prototype

int getSourceStart();

Source Link

Document

Return the start position of the problem (inclusive), or -1 if unknown.

Usage

From source file:org.eclipse.ajdt.internal.ui.ajde.UIMessageHandler.java

License:Open Source License

public boolean handleMessage(IMessage message) {
    IMessage.Kind kind = message.getKind();
    if (kind == IMessage.ABORT || message.getThrown() != null) {
        // an exception has been thrown by AspectJ, therefore
        // want to create an error dialog containing the information
        // and display it to the user
        AJDTErrorHandler.handleInternalError(UIMessages.ajErrorDialogTitle, message.getMessage(),
                message.getThrown());/*  w  ww .j av  a2  s .  co m*/
        return true;
    }
    if (isIgnoring(kind)) {
        return true;
    }
    if (message.getSourceLocation() == null) {
        AJLog.log(AJLog.COMPILER_MESSAGES, message.getMessage()); //$NON-NLS-1$
        problems.add(new ProblemTracker(message.getMessage(), null, message.getKind()));
    } else {
        if (DebugTracing.DEBUG_COMPILER_MESSAGES) {
            // avoid constructing log string if trace is not active
            AJLog.log(AJLog.COMPILER_MESSAGES, "addSourcelineTask message=" //$NON-NLS-1$
                    + message.getMessage() + " file=" //$NON-NLS-1$
                    + message.getSourceLocation().getSourceFile().getPath() + " line=" //$NON-NLS-1$
                    + message.getSourceLocation().getLine());
        } else {
            AJLog.log(AJLog.COMPILER_MESSAGES, message.getMessage());
        }
        problems.add(new ProblemTracker(message.getMessage(), message.getSourceLocation(), message.getKind(),
                message.getDeclared(), message.getExtraSourceLocations(), message.getID(),
                message.getSourceStart(), message.getSourceEnd(), message.getThrown()));
    }
    return true;
}