From: wisberg Date: Wed, 14 May 2003 04:29:18 +0000 (+0000) Subject: patch mentioned on the list for detecting errs in incremental command line X-Git-Tag: V1_1_0~127 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=58570a499ae31b5774352910d5927e1ea5245fdb;p=aspectj.git patch mentioned on the list for detecting errs in incremental command line --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java index 10d3279c4..d1444a4e0 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/AjdtCommand.java @@ -121,12 +121,29 @@ public class AjdtCommand implements ICommand { return false; } - /** @throws AbortException on error after handling message */ + /** + * This creates a build configuration for the arguments. + * Errors reported to the handler: + *
    + *
  1. The parser detects some directly
  2. + *
  3. The parser grabs some from the error stream + * emitted by its superclass
  4. + *
  5. The configuration has a self-test
  6. + *
+ * In the latter two cases, the errors do not have + * a source location context for locating the error. + */ public static AjBuildConfig genBuildConfig(String[] args, CountingMessageHandler handler) { BuildArgParser parser = new BuildArgParser(); AjBuildConfig config = parser.genBuildConfig(args, handler); String message = parser.getOtherMessages(true); + if (null != message) { + IMessage.Kind kind = inferKind(message); + IMessage m = new Message(message, kind, null, null); + handler.handleMessage(m); + } + message = config.configErrors(); if (null != message) { IMessage.Kind kind = inferKind(message); IMessage m = new Message(message, kind, null, null); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java index 01acc2966..9a9ac69d6 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java @@ -502,9 +502,10 @@ public class Main { */ public String[] init(String[] args, IMessageHandler sink) { running = true; + String[] unused; if (!LangUtil.isEmpty(args)) { String[][] options = LangUtil.copyStrings(OPTIONS); - args = LangUtil.extractOptions(args, options); + unused = LangUtil.extractOptions(args, options); incremental = (null != options[0][0]); if (null != options[1][0]) { File file = new File(options[1][1]);