Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event variables should be final #4

Open
melwil opened this issue May 26, 2013 · 0 comments
Open

Event variables should be final #4

melwil opened this issue May 26, 2013 · 0 comments
Labels

Comments

@melwil
Copy link
Collaborator

melwil commented May 26, 2013

Variables in events should be final, since the same reference is distributed to all plugins, we should prevent plugins from rewriting information in the Event capsules.

Example:

public class ErrorEvent extends Event {

    private final String message;

    public ErrorEvent(IRCEventPacket packet, Network network) {
        super(network, packet.getRawline(), EventType.ERROR);
        message = packet.getParameter(0);
    }

    public String getMessage() {
        return message;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant