1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-26 06:07:59 +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 {
private String subject;
private String language;
private final String subject;
private final String language;
private Subject(String language, String subject) {
if (language == null) {
@ -543,8 +543,8 @@ public final class Message extends Packet {
*/
public static class Body {
private String message;
private String language;
private final String message;
private final String language;
private Body(String language, String message) {
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.
*/
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
* 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);