You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DynamicHelloWorld.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Copyright (c) 2002 Contributors.
  2. *
  3. * This program and the accompanying materials are made available
  4. * under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * PARC initial implementation
  10. */
  11. package org.aspectj.weaver.test;
  12. import java.io.*;
  13. import java.util.*;
  14. /**
  15. * FIXME regen with an Eclipse 2.1 the testdata/bin with this new package
  16. * same for all classes in that package
  17. * and update tests then (pointcuts etc)
  18. *
  19. * @version 1.0
  20. * @author
  21. */
  22. public class DynamicHelloWorld implements Serializable {
  23. public static void main(String[] args) {
  24. try {
  25. new DynamicHelloWorld().doit("hello", Collections.EMPTY_LIST);
  26. } catch (UnsupportedOperationException t) {
  27. System.out.println("expected and caught: " + t);
  28. return;
  29. }
  30. throw new RuntimeException("should have caught exception");
  31. }
  32. String doit(String s, List l) {
  33. l.add(s); // this will throw an exception
  34. return l.toString();
  35. }
  36. }