title: JMX MBeanServer.queryMBeans with Query exp does not work
body: <p>I'd like to use MBeanServer.queryMBeans(ObjectName name, QueryExp query) to get MBeans with query expression, but it seems it does not really work with QueryExp query. For example I have such test code: </p>
  
  <pre><code>public class CreateAndRegisterMBeanInMBeanServer {
  
  /**
   * @param args
   */
  public static void main(String[] args) throws Exception {
  
      String objectName = "com.javacodegeeks.snippets.enterprise:type=Hello";
      QueryExp exp = Query.eq(Query.attr("type"), Query.value("Hello"));
  
  
      MBeanServer server = ManagementFactory.getPlatformMBeanServer();
  
      // Construct the ObjectName for the Hello MBean we will register
      ObjectName mbeanName = new ObjectName(objectName);
  
      Hello mbean = new Hello();
  
      server.registerMBean(mbean, mbeanName);
  
      Set&lt;ObjectInstance&gt; instances = server.queryMBeans(new ObjectName(objectName), null);
      System.out.println(instances.size());
  
      for (int i = 0; i &lt; instances.size(); i++) {
          ObjectInstance instance = (ObjectInstance) instances.toArray()[i];
  
          System.out.println("Class Name:t" + instance.getClassName());
          System.out.println("Object Name:t" + instance.getObjectName());
      }
  
  }
  
  static class Hello implements HelloMBean {
  
      private String message = "Hello World";
  
      @Override
      public String getMessage() {
          return this.message;
      }
  
      @Override
      public void sayHello() {
          System.out.println(message);
      }
  
      @Override
      public void setMessage(String message) {
          this.message = message;
      }
  
  }
  
  static interface HelloMBean {
  
      // operations
  
      public void sayHello();
  
      // attributes
  
      // a read-write attribute called Message of type String
      public String getMessage();
  
      public void setMessage(String message);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I can get expected out:
  1
  Class Name:tCreateAndRegisterMBeanInMBeanServer$Hello
  Object Name:tcom.javacodegeeks.snippets.enterprise:type=Hello</p>
  
  <p>But if I change my code to use defined QueryExp exp as:</p>
  
  <p>Set instances = server.queryMBeans(new ObjectName(objectName), exp);</p>
  
  <p>I can not see any selected MBean, Is that the correct way to use such Query Exp ? </p>
  
  <p>Thanks,</p>