Don't alter type declaration modifiers

Issue #143 resolved
Jesper Öqvist created an issue

JastAdd2 does some sneaky changes to modifiers for class- and interface-declarations in aspect files.

If there were no modifiers it adds the public modifier, and if static is in the modifier list it just strips that.

This can be seen in action in previous versions of JastAddJ where the Problem class, declared in the ErrorCheck aspect, was declared like this:

class Problem {
    ...
}

and then used outside the AST package. Since it was not declared public it shouldn't have been visible. This has since been fixed in JastAddJ so that the declaration is

public class Problem {
    ...
}

Comments (1)

  1. Jesper Öqvist reporter

    Don't alter modifiers for type declarations

    • don't add public modifier if modifiers is empty
    • don't remove static modifiers
    • fixed some redundant modifier whitespace padding
    • allow annotations on aspect-declared interface and class declarations

    fixes issue #143 (bitbucket)

    → <<cset e03a13e431ea>>

  2. Log in to comment