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

Issue with getHeader("", Boolean.class)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Component/s: camel-core
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: