aboutsummaryrefslogtreecommitdiffstats
path: root/ajbrowser
diff options
context:
space:
mode:
authoraclement <aclement>2009-04-09 19:56:28 +0000
committeraclement <aclement>2009-04-09 19:56:28 +0000
commitd2afa9933475f4423c80826950b5ac19b2f18523 (patch)
tree869bdddb13a5a7f7b6ba571ce85c7ca33b1c22fc /ajbrowser
parent21af07ee311f913e13197534e89a1c85e3a26d30 (diff)
downloadaspectj-d2afa9933475f4423c80826950b5ac19b2f18523.tar.gz
aspectj-d2afa9933475f4423c80826950b5ac19b2f18523.zip
trigger build
Diffstat (limited to 'ajbrowser')
-rw-r--r--ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java95
1 files changed, 47 insertions, 48 deletions
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);
+ }
}