From eb48d02673d78604cf1335c6283073294a16a2e0 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Fri, 19 Dec 2014 11:15:01 +0100 Subject: [PATCH] Make compressionMethod final in XMPPInputOutputStream --- .../smack/compression/jzlib/JzlibInputOutputStream.java | 2 +- .../smack/compression/Java7ZlibInputOutputStream.java | 2 +- .../smack/compression/XMPPInputOutputStream.java | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java b/smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java index 68e4d16d5..f129dc991 100644 --- a/smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java +++ b/smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java @@ -40,7 +40,7 @@ public class JzlibInputOutputStream extends XMPPInputOutputStream { } public JzlibInputOutputStream() { - compressionMethod = "zlib"; + super("zlib"); } @Override diff --git a/smack-core/src/main/java/org/jivesoftware/smack/compression/Java7ZlibInputOutputStream.java b/smack-core/src/main/java/org/jivesoftware/smack/compression/Java7ZlibInputOutputStream.java index 873f8b599..08ca3c179 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/compression/Java7ZlibInputOutputStream.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/compression/Java7ZlibInputOutputStream.java @@ -63,7 +63,7 @@ public class Java7ZlibInputOutputStream extends XMPPInputOutputStream { } public Java7ZlibInputOutputStream() { - compressionMethod = "zlib"; + super("zlib"); } @Override diff --git a/smack-core/src/main/java/org/jivesoftware/smack/compression/XMPPInputOutputStream.java b/smack-core/src/main/java/org/jivesoftware/smack/compression/XMPPInputOutputStream.java index 6fd289325..0092e9d01 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/compression/XMPPInputOutputStream.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/compression/XMPPInputOutputStream.java @@ -35,7 +35,11 @@ public abstract class XMPPInputOutputStream { XMPPInputOutputStream.flushMethod = flushMethod; } - protected String compressionMethod; + protected final String compressionMethod; + + protected XMPPInputOutputStream(String compressionMethod) { + this.compressionMethod = compressionMethod; + } public String getCompressionMethod() { return compressionMethod;