From: aclement Date: Thu, 9 Apr 2009 19:56:28 +0000 (+0000) Subject: trigger build X-Git-Tag: V1_6_5~67 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d2afa9933475f4423c80826950b5ac19b2f18523;p=aspectj.git trigger build --- diff --git a/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java b/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java index 03f18a607..37c8eb62d 100644 --- a/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java +++ b/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java @@ -11,63 +11,62 @@ * Xerox/PARC initial implementation * ******************************************************************/ - package org.aspectj.tools.ajbrowser; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; - /** * Run ajbrowser if 0+ .lst file arguments, and ajc otherwise. */ public class Main { - - /** - * Run ajbrowser if args contains only .lst files - * and ajc otherwise. - * @param args the String[] of args to interpret - */ - public static void main(String[] args) { - if (!compilerMain(args)) { - BrowserManager.getDefault().init(args, true); - } - } - - /** - * Invoke the compiler if there are arguments and some are not .lst files. - * @return false if compiler was not invoked and the browser main should be - */ - static boolean compilerMain(String[] args) { - if ((null == args) || (0 == args.length)) { - return false; - } - int numConfigFiles = 0; - for (int i = 0; i < args.length; i++) { - if ((null != args[i]) && args[i].endsWith(".lst")) { - numConfigFiles++; - } + + /** + * Run ajbrowser if args contains only .lst files and ajc otherwise. + * + * @param args the String[] of args to interpret + */ + public static void main(String[] args) { + if (!compilerMain(args)) { + BrowserManager.getDefault().init(args, true); + } + } + + /** + * Invoke the compiler if there are arguments and some are not .lst files. + * + * @return false if compiler was not invoked and the browser main should be + */ + static boolean compilerMain(String[] args) { + if ((null == args) || (0 == args.length)) { + return false; + } + int numConfigFiles = 0; + for (int i = 0; i < args.length; i++) { + if ((null != args[i]) && args[i].endsWith(".lst")) { + numConfigFiles++; + } + } + if (numConfigFiles != args.length) { + try { + Class ajc = Class.forName("org.aspectj.tools.ajc.Main"); + Method main = ajc.getMethod("main", new Class[] { String[].class }); + main.invoke(null, new Object[] { args }); + return true; + } catch (ClassNotFoundException e) { + report(e); + } catch (NoSuchMethodException e) { + report(e); + } catch (IllegalAccessException e) { + report(e); + } catch (InvocationTargetException e) { + report(e.getTargetException()); + } } - if (numConfigFiles != args.length) { - try { - Class ajc = Class.forName("org.aspectj.tools.ajc.Main"); - Method main = ajc.getMethod("main", new Class[] { String[].class}); - main.invoke(null, new Object[] { args}); - return true; - } catch (ClassNotFoundException e) { - report(e); - } catch (NoSuchMethodException e) { - report(e); - } catch (IllegalAccessException e) { - report(e); - } catch (InvocationTargetException e) { - report(e.getTargetException()); - } - } - return false; - } + return false; + } - private static void report(Throwable t) { - t.printStackTrace(System.err); - } + private static void report(Throwable t) { + t.printStackTrace(System.err); + } }