Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

DeclareMethodAnnotation.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Preserve lineation of affected types or redo expected messages
  2. @interface MtAn {}
  3. public aspect DeclareMethodAnnotation {
  4. // ------------------ affected types
  5. static class Untyped {
  6. void untypedName() {} // declare warning 16
  7. void untypedPrefix_blah() {} // declare warning 17
  8. void blah_untypedSuffix() {} // declare warning 18
  9. }
  10. static class Star {
  11. void starName() {} // declare warning 22
  12. void starPrefix_blah() {} // declare warning 23
  13. void blah_starSuffix() {} // declare warning 24
  14. }
  15. static class Type{
  16. void typeName() {} // declare warning 27
  17. void typePrefix_blah() {} // declare warning 28
  18. void blah_typeSuffix() {} // declare warning 29
  19. }
  20. static class TypePlus {
  21. void typeplusName() {} // declare warning 33
  22. void typeplusPrefix_blah() {} // declare warning 34
  23. void blah_typeplusSuffix() {} // declare warning 35
  24. }
  25. static class TypePlusSubtype extends TypePlus {
  26. void typeplusName() {} // declare warning 39
  27. void typeplusPrefix_blah() {} // declare warning 40
  28. void blah_typeplusSuffix() {} // declare warning 41
  29. }
  30. // ------------------ tests
  31. declare @method: * untypedName() : @MtAn;
  32. declare @method: * untypedPrefix*() : @MtAn;
  33. declare @method: * *untypedSuffix() : @MtAn;
  34. declare @method: * *.starName() : @MtAn;
  35. declare @method: * *.starPrefix*() : @MtAn;
  36. declare @method: * *.*starSuffix() : @MtAn;
  37. declare @method: * Type.typeName() : @MtAn;
  38. declare @method: * Type.typePrefix*() : @MtAn;
  39. declare @method: * Type.*typeSuffix() : @MtAn;
  40. declare @method: * TypePlus+.typeplusName() : @MtAn;
  41. declare @method: * TypePlus+.typeplusPrefix*() : @MtAn;
  42. declare @method: * TypePlus+.*typeplusSuffix() : @MtAn;
  43. // ------------------ check using warnings, expected in .xml
  44. declare warning : execution(@MtAn * *()): "all";
  45. }