From 30d1db184fd47c74014b1b87fc95e2d950d00c54 Mon Sep 17 00:00:00 2001 From: wisberg Date: Wed, 30 Apr 2003 02:36:45 +0000 Subject: [PATCH] - IMessage-based compiler messages --- .../ajde/ui/swing/CompilerMessage.java | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessage.java b/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessage.java index 28540c6b0..467abcdb5 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessage.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/CompilerMessage.java @@ -16,35 +16,20 @@ package org.aspectj.ajde.ui.swing; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; +import org.aspectj.util.LangUtil; /** * @author Mik Kersten */ public class CompilerMessage { - public String message; - public ISourceLocation sourceLocation; - public IMessage.Kind kind; + public final IMessage message; - public CompilerMessage(String message, IMessage.Kind kind) { + public CompilerMessage(IMessage message) { + LangUtil.throwIaxIfNull(message, "message"); this.message = message; - this.sourceLocation = null; - this.kind = kind; - } - - public CompilerMessage(String message, ISourceLocation sourceLocation, IMessage.Kind kind) { - this.message = message; - this.sourceLocation = sourceLocation; - this.kind = kind; } public String toString() { - if (sourceLocation != null) { - return sourceLocation.getSourceFile().getAbsolutePath() + ":" - + " " + message - + " at line " + sourceLocation.getLine() - + ", column " + sourceLocation.getColumn(); - } else { - return message; - } + return message.toString(); } } -- 2.39.5