Community
Participate
Working Groups
If I copy this code to the clipboard: package p; class C {} and paste it directly onto a selected AspectJ project, I get a package p created with a new file C.java inside. If I copy this code to the clipboard: package p; aspect A {} I get a package called snippet with a file Snippet.java created: --- package snippet; public class Snippet { public static void main(String[] args) { package p; aspect A {} } } --- Presumably it failed to correctly interpret what I was pasting in so guessed at it being just a snippet of code (this snippet behaviour is what happens if I paste something incomplete in, like simply "i=5;")
Yup. This is a problem. Probably won't make it into 1.6.2 final, but I'll take a look at it and if this is easy to fix, then I will.
The problem is in o.e.jdt.internal.ui.refactoring.reorg.PasteAction.TextPaster.ParsedCu.parseCus. This method takes a bunch of text and attempts to parse it into a compilation unit. But it is using a Java parser and so it fails when there is AJ text in it. The only way around this, as I see it, would be to advise this method and use an AJ parser instead.
Move to the 2.0.2 release.
No longer slated for the next release.