You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/12/04 09:54:43 UTC

[2/2] camel git commit: CAMEL-8117: cleanup checkstyle issues

CAMEL-8117: cleanup checkstyle issues


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3114a7b0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3114a7b0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3114a7b0

Branch: refs/heads/master
Commit: 3114a7b065741f61993552c5d79c856cde7f0399
Parents: 8678432
Author: Daniel Pocock <da...@pocock.pro>
Authored: Thu Dec 4 09:41:05 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Dec 4 09:51:27 2014 +0100

----------------------------------------------------------------------
 .../camel/component/smpp/SmppSmCommand.java       | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3114a7b0/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
----------------------------------------------------------------------
diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
index 2f0c641..ae1342d 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
@@ -26,17 +26,19 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public abstract class SmppSmCommand extends AbstractSmppCommand {
-    private static final Logger LOG = LoggerFactory.getLogger(SmppSmCommand.class);
 
+    // FIXME: these constants should be defined somewhere in jSMPP:
     public static final int SMPP_NEG_RESPONSE_MSG_TOO_LONG = 1;
 
     protected Charset ascii = Charset.forName("US-ASCII");
     protected Charset latin1 = Charset.forName("ISO-8859-1");
-    protected Charset charset;
+    protected Charset defaultCharset;
+
+    private final Logger logger = LoggerFactory.getLogger(SmppSmCommand.class);
 
     public SmppSmCommand(SMPPSession session, SmppConfiguration config) {
         super(session, config);
-        this.charset = Charset.forName(config.getEncoding());
+        defaultCharset = Charset.forName(config.getEncoding());
     }
 
     protected byte[][] splitBody(Message message) throws SmppException {
@@ -132,7 +134,7 @@ public abstract class SmppSmCommand extends AbstractSmppCommand {
             if (Charset.isSupported(encoding)) {
                 return Charset.forName(encoding);
             } else {
-                LOG.warn("Unsupported encoding \"{}\" requested in header.", encoding);
+                logger.warn("Unsupported encoding \"{}\" requested in header.", encoding);
             }
         }
         return null;
@@ -150,15 +152,15 @@ public abstract class SmppSmCommand extends AbstractSmppCommand {
             return Charset.forName(SmppConstants.UCS2_ENCODING); 
         }
         
-        return charset;
+        return defaultCharset;
     }
 
     private Alphabet determineAlphabet(Message message) {
         String body = message.getBody(String.class);
         byte alphabet = getProvidedAlphabet(message);
-        Charset _charset = getCharsetForMessage(message);
-        if (_charset == null) {
-            _charset = charset;
+        Charset charset = getCharsetForMessage(message);
+        if (charset == null) {
+            charset = defaultCharset;
         }
 
         Alphabet alphabetObj;