Example usage for org.aspectj.bridge IMessage getExtraSourceLocations

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

Introduction

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

Prototype

public List<ISourceLocation> getExtraSourceLocations();

Source Link

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());/*from ww  w.  j ava  2 s .  com*/
        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;
}