qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [1/2] qpid-jms git commit: QPIDJMS-54: remove indirection around selector check, no longer needed
Date Wed, 20 May 2015 13:28:19 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master 021867fd1 -> 6b7320052


QPIDJMS-54: remove indirection around selector check, no longer needed


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/760e0224
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/760e0224
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/760e0224

Branch: refs/heads/master
Commit: 760e0224f9d25ad043c74fa83e38737d9edce299
Parents: 021867f
Author: Robert Gemmell <robbie@apache.org>
Authored: Wed May 20 10:57:51 2015 +0100
Committer: Robert Gemmell <robbie@apache.org>
Committed: Wed May 20 14:27:16 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/qpid/jms/JmsSession.java    | 35 ++++----------------
 1 file changed, 6 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/760e0224/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
index 3f6ef07..19d86e5 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
@@ -79,7 +79,6 @@ import org.slf4j.LoggerFactory;
 /**
  * JMS Session implementation
  */
-@SuppressWarnings("static-access")
 public class JmsSession implements Session, QueueSession, TopicSession, JmsMessageDispatcher
{
 
     private static final Logger LOG = LoggerFactory.getLogger(JmsSession.class);
@@ -821,38 +820,16 @@ public class JmsSession implements Session, QueueSession, TopicSession,
JmsMessa
         }
     }
 
-    // This extra wrapping class around SelectorParser is used to avoid
-    // ClassNotFoundException if SelectorParser is not in the class path.
-    static class OptionalSectorParser {
-        public static void check(String selector) throws InvalidSelectorException {
-            try {
-                SelectorParser.parse(selector);
-            } catch (FilterException e) {
-                throw new InvalidSelectorException(e.getMessage());
-            }
-        }
-    }
-
-    static final OptionalSectorParser SELECTOR_PARSER;
-    static {
-        OptionalSectorParser parser;
-        try {
-            // lets verify it's working..
-            parser = new OptionalSectorParser();
-            parser.check("x=1");
-        } catch (Throwable e) {
-            parser = null;
-        }
-        SELECTOR_PARSER = parser;
-    }
-
-    public static String checkSelector(String selector) throws InvalidSelectorException {
+    static String checkSelector(String selector) throws InvalidSelectorException {
         if (selector != null) {
             if (selector.trim().length() == 0) {
                 return null;
             }
-            if (SELECTOR_PARSER != null) {
-                SELECTOR_PARSER.check(selector);
+
+            try {
+                SelectorParser.parse(selector);
+            } catch (FilterException e) {
+                throw new InvalidSelectorException(e.getMessage());
             }
         }
         return selector;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message