aboutsummaryrefslogtreecommitdiffstats
path: root/docs/sandbox/common/com
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-08-06 02:08:40 +0000
committerwisberg <wisberg>2003-08-06 02:08:40 +0000
commita63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43 (patch)
treecd4e827c60136df7bf9850591b0c64baff549d20 /docs/sandbox/common/com
parentb0d37c4b51a344bee94bb7f7cc1ecef1a233e3ab (diff)
downloadaspectj-a63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43.tar.gz
aspectj-a63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43.zip
initial checkin of the sandbox.
The basic structure and examples of each type are there, but I have more examples and the ones there are not altogether validated. I'll make a few more changes before emailing dev and users about usage, etc.
Diffstat (limited to 'docs/sandbox/common/com')
-rw-r--r--docs/sandbox/common/com/company/app/AppException.java11
-rw-r--r--docs/sandbox/common/com/company/app/Main.java40
-rw-r--r--docs/sandbox/common/com/company/lib/Factory.java14
3 files changed, 65 insertions, 0 deletions
diff --git a/docs/sandbox/common/com/company/app/AppException.java b/docs/sandbox/common/com/company/app/AppException.java
new file mode 100644
index 000000000..aa23eeff8
--- /dev/null
+++ b/docs/sandbox/common/com/company/app/AppException.java
@@ -0,0 +1,11 @@
+
+package com.company.app;
+
+public class AppException extends Exception {
+ public AppException() {
+ super();
+ }
+ public AppException(String s) {
+ super(s);
+ }
+} \ No newline at end of file
diff --git a/docs/sandbox/common/com/company/app/Main.java b/docs/sandbox/common/com/company/app/Main.java
new file mode 100644
index 000000000..8d04c0ec9
--- /dev/null
+++ b/docs/sandbox/common/com/company/app/Main.java
@@ -0,0 +1,40 @@
+
+package com.company.app;
+
+import java.util.Arrays;
+import org.aspectj.lang.SoftException;
+
+public class Main implements Runnable {
+ public static void main(String[] argList) {
+ new Main().runMain(argList);
+ }
+
+ String[] input;
+
+ void spawn() {
+ new Thread(this, toString()).start(); // KEEP CE 15 declares-factory
+ }
+
+ public void runMain(String[] argList) {
+ this.input = argList;
+ run();
+ }
+
+ public void run() {
+ String[] input = this.input;
+ String s = ((null == input) || (0 == input.length))
+ ? "[]"
+ : Arrays.asList(input).toString();
+ System.out.println("input: " + s);
+ try {
+ doDangerousThings(); // KEEP CW 30 declares-exceptionSpelunking
+ } catch (AppException e) { // KEEP CW 31 declares-exceptionSpelunking
+ e.printStackTrace(System.err);
+ }
+ }
+
+ private void doDangerousThings() throws AppException { // KEEP CW 38
+
+ }
+
+} \ No newline at end of file
diff --git a/docs/sandbox/common/com/company/lib/Factory.java b/docs/sandbox/common/com/company/lib/Factory.java
new file mode 100644
index 000000000..3abb207c9
--- /dev/null
+++ b/docs/sandbox/common/com/company/lib/Factory.java
@@ -0,0 +1,14 @@
+
+package com.company.lib;
+
+public class Factory {
+
+ public static Thread makeThread(Runnable runnable, String name) {
+ class MyThread extends Thread {
+ MyThread(Runnable runnable, String name) {
+ super(runnable, name);
+ }
+ }
+ return new MyThread(runnable, name);
+ }
+} \ No newline at end of file