From: aclement Date: Wed, 28 Nov 2007 11:19:32 +0000 (+0000) Subject: testcode for 162539 and 176991 X-Git-Tag: V1_5_4rc1~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=646b77427bf44ec097829a18ec4336bcd7b2e67f;p=aspectj.git testcode for 162539 and 176991 --- diff --git a/tests/bugs154/pr162539/lib.jar b/tests/bugs154/pr162539/lib.jar new file mode 100644 index 000000000..ae0983d9b Binary files /dev/null and b/tests/bugs154/pr162539/lib.jar differ diff --git a/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/AtAspect.java b/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/AtAspect.java new file mode 100644 index 000000000..0c988c8d2 --- /dev/null +++ b/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/AtAspect.java @@ -0,0 +1,19 @@ +package test.ataspectj.pointcutlibrary; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class AtAspect { +// @Pointcut("execution(public void main(String[]))") +// public void mainMethod () { +// } + + @Before("(PointcutLibrary.mainMethod())") + public void beforeMainMethod (JoinPoint.StaticPart thisJoinPointStaticPart, JoinPoint thisJoinPoint) { + System.out.println("AtAspect.beforeMainMethod() " + thisJoinPoint); + } + +} diff --git a/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/HelloWorld.java b/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/HelloWorld.java new file mode 100644 index 000000000..6515d48f9 --- /dev/null +++ b/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/HelloWorld.java @@ -0,0 +1,9 @@ +package test.ataspectj.pointcutlibrary; + +public class HelloWorld { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } + +} diff --git a/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/PointcutLibrary.java b/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/PointcutLibrary.java new file mode 100644 index 000000000..54b0a4aff --- /dev/null +++ b/tests/bugs154/pr162539/test/ataspectj/pointcutlibrary/PointcutLibrary.java @@ -0,0 +1,11 @@ +package test.ataspectj.pointcutlibrary; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; + +//@Aspect +public class PointcutLibrary { +//pointcut mainMethod(): execution(public void main(String[])); +@Pointcut("execution(public void main(String[]))") public void mainMethod () { } + +} diff --git a/tests/bugs154/pr176991/AspectJBugTestCase.java b/tests/bugs154/pr176991/AspectJBugTestCase.java new file mode 100644 index 000000000..9b9b27d78 --- /dev/null +++ b/tests/bugs154/pr176991/AspectJBugTestCase.java @@ -0,0 +1,91 @@ +package com.ihg.dec.framework.commons.utils.cow; + +import java.util.AbstractSet; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.Map.Entry; + +public class AspectJBugTestCase { + class Value { + private V value; + public Value(V value) { + this.value = value; + } + public V getValue() { + return value; + } + public void setValue(V value) { + this.value = value; + } + } + + class EntrySetEntry implements Entry { + private Entry> wrapped; + + public EntrySetEntry(Entry> wrapped) { + this.wrapped = wrapped; + } + + public K getKey() { + return wrapped.getKey(); + } + + public V getValue() { + return wrapped.getValue().getValue(); + } + + public V setValue(V value) { + Value old = wrapped.setValue(new Value(value)); + return old == null ? null : old.getValue(); + } + + } + + class EntrySetIterator implements Iterator> { + private Iterator>> wrapped; + + public EntrySetIterator(Iterator>> wrapped) { + this.wrapped = wrapped; + } + + public boolean hasNext() { + return wrapped.hasNext(); + } + + public Entry next() { + return new EntrySetEntry(wrapped.next()); + } + + public void remove() { + throw new UnsupportedOperationException("Not implemented."); + } + } + + class EntrySet extends AbstractSet> implements + Set> { + private Set>> wrapped; + + public EntrySet(Set>> wrapped) { + this.wrapped = wrapped; + } + + @Override + public Iterator> iterator() { + return new EntrySetIterator(wrapped.iterator()); + } + + @Override + public int size() { + return wrapped.size(); + } + } + + public void testIt() { + new EntrySet( new HashSet>>()); + } +} + +aspect X { + declare parents: *.Entry* implements java.io.Serializable; +}