Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-3

Issue with getHeader("", Boolean.class)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 1.0.0
    • camel-core
    • None

    Description

          public void testNPE() throws Exception {
              final CamelContext camelContext = new DefaultCamelContext();
              final String fromQueue = "queue:A";
              camelContext.addRoutes(new RouteBuilder() {
                  public void configure() throws Exception {
                      from(fromQueue).process(new Processor() {
                          public void process(Exchange exchange) throws Exception {
                              final Message in = exchange.getIn();
                              assertNotNull("Message is Null", in);
                              String isDebugString = in.getHeader("someproperty", String.class);
                              assertNull(isDebugString);
                              assertNotNull("Message is Null", in);
                              boolean isDebug = in.getHeader("someproperty", Boolean.class);
                              assertFalse(isDebug);
                          }
                      });
                  }
              });
              camelContext.start();
              new CamelTemplate(camelContext).sendBody(fromQueue, "ha!");
              Thread.sleep(5000L);
          }
      

      throws NPE on the isDebug = ... line.

      Attachments

        Activity

          People

            jstrachan James Strachan
            nnordrum Noah Nordrum
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: