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;
}
}
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: