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.

InterfaceConstructor.java 353B

123456789101112131415161718
  1. interface I { }
  2. public class InterfaceConstructor implements I {
  3. public static void main(String[] args) {
  4. new InterfaceConstructor();
  5. }
  6. }
  7. aspect NoSuchJP {
  8. before(): execution(I.new(..)) { // error expected
  9. // No constructor-execution on interface type
  10. }
  11. before(): execution(I+.new(..)) { // no error
  12. // This is OK, as there is a +
  13. }
  14. }