1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 14:02:06 +01:00

Make fields in Packet and Message final

This commit is contained in:
Florian Schmaus 2014-10-27 13:18:30 +01:00
parent f94f7590a6
commit 416f42deb7
2 changed files with 6 additions and 6 deletions

View file

@ -480,8 +480,8 @@ public final class Message extends Packet {
*/ */
public static class Subject { public static class Subject {
private String subject; private final String subject;
private String language; private final String language;
private Subject(String language, String subject) { private Subject(String language, String subject) {
if (language == null) { if (language == null) {
@ -543,8 +543,8 @@ public final class Message extends Packet {
*/ */
public static class Body { public static class Body {
private String message; private final String message;
private String language; private final String language;
private Body(String language, String message) { private Body(String language, String message) {
if (language == null) { if (language == null) {

View file

@ -48,13 +48,13 @@ public abstract class Packet extends TopLevelStreamElement {
/** /**
* A prefix helps to make sure that ID's are unique across multiple instances. * A prefix helps to make sure that ID's are unique across multiple instances.
*/ */
private static String prefix = StringUtils.randomString(5) + "-"; private static final String prefix = StringUtils.randomString(5) + "-";
/** /**
* Keeps track of the current increment, which is appended to the prefix to * Keeps track of the current increment, which is appended to the prefix to
* forum a unique ID. * forum a unique ID.
*/ */
private static AtomicLong id = new AtomicLong(); private static final AtomicLong id = new AtomicLong();
private final Map<String, PacketExtension> packetExtensions = new HashMap<String, PacketExtension>(12); private final Map<String, PacketExtension> packetExtensions = new HashMap<String, PacketExtension>(12);