]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 118599
authoraclement <aclement>
Thu, 1 Dec 2005 12:01:32 +0000 (12:01 +0000)
committeraclement <aclement>
Thu, 1 Dec 2005 12:01:32 +0000 (12:01 +0000)
tests/bugs150/pr118599/AnAttributedClass.java [new file with mode: 0644]
tests/bugs150/pr118599/Attributable.java [new file with mode: 0644]

diff --git a/tests/bugs150/pr118599/AnAttributedClass.java b/tests/bugs150/pr118599/AnAttributedClass.java
new file mode 100644 (file)
index 0000000..f8a4cdc
--- /dev/null
@@ -0,0 +1,6 @@
+public class AnAttributedClass implements Attributable {
+
+  public void doSomething() {
+    this.setAttribute("foo", "bar");
+  }
+}
diff --git a/tests/bugs150/pr118599/Attributable.java b/tests/bugs150/pr118599/Attributable.java
new file mode 100644 (file)
index 0000000..a6add76
--- /dev/null
@@ -0,0 +1,20 @@
+import java.util.*;
+public interface Attributable {
+
+  void setAttribute(String name, Object attribute);
+  Object getAttribute(String name);
+
+  static aspect DefImpl {
+
+    private Map<String,Object> Attributable.attributes =
+      new HashMap<String,Object>();
+
+    public void Attributable.setAttribute(String name, Object attribute) {
+      this.attributes.put(name, attribute);
+    }
+
+    public Object Attributable.getAttribute(String name) {
+      return this.attributes.get(name);
+    }
+  }
+}