You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Stefan Below (JIRA)" <ji...@apache.org> on 2010/10/05 17:29:40 UTC

[jira] Created: (CAMEL-3198) DefaultCamelContext throws NPE in getRoute(String id)

 DefaultCamelContext throws NPE in getRoute(String id)
------------------------------------------------------

                 Key: CAMEL-3198
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3198
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.4.0
            Reporter: Stefan Below
            Priority: Minor


 DefaultCamelContext throws NPE in getRoute(String id) if no routes are deployed.
This happens because the "route LinkedHashSet" is not initialized.

Fix:
 don't do Lazy init of route  or add this to getRoute(String id):
 if (routes == null) {
	routes = new LinkedHashSet<Route>();
 } 




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (CAMEL-3198) DefaultCamelContext throws NPE in getRoute(String id)

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-3198 started by Hadrian Zbarcea.

>  DefaultCamelContext throws NPE in getRoute(String id)
> ------------------------------------------------------
>
>                 Key: CAMEL-3198
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3198
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Stefan Below
>            Assignee: Hadrian Zbarcea
>            Priority: Minor
>             Fix For: 2.5.0
>
>
>  DefaultCamelContext throws NPE in getRoute(String id) if no routes are deployed.
> This happens because the "route LinkedHashSet" is not initialized.
> Fix:
>  don't do Lazy init of route  or add this to getRoute(String id):
>  if (routes == null) {
> 	routes = new LinkedHashSet<Route>();
>  } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-3198) DefaultCamelContext throws NPE in getRoute(String id)

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea updated CAMEL-3198:
-----------------------------------

    Fix Version/s: 2.5.0

>  DefaultCamelContext throws NPE in getRoute(String id)
> ------------------------------------------------------
>
>                 Key: CAMEL-3198
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3198
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Stefan Below
>            Assignee: Hadrian Zbarcea
>            Priority: Minor
>             Fix For: 2.5.0
>
>
>  DefaultCamelContext throws NPE in getRoute(String id) if no routes are deployed.
> This happens because the "route LinkedHashSet" is not initialized.
> Fix:
>  don't do Lazy init of route  or add this to getRoute(String id):
>  if (routes == null) {
> 	routes = new LinkedHashSet<Route>();
>  } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3198) DefaultCamelContext throws NPE in getRoute(String id)

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62383#action_62383 ] 

Hadrian Zbarcea commented on CAMEL-3198:
----------------------------------------

Stefan, thanks for reporting this and for the proposed fix! The change below does it (similar to your suggestion), but I have to fix a test before I commit it.

{code}
     public Route getRoute(String id) {
-        for (Route route : routes) {
+        for (Route route : getRoutes()) {
             if (route.getId().equals(id)) {
                 return route;
             }

{code}

>  DefaultCamelContext throws NPE in getRoute(String id)
> ------------------------------------------------------
>
>                 Key: CAMEL-3198
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3198
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Stefan Below
>            Assignee: Hadrian Zbarcea
>            Priority: Minor
>             Fix For: 2.5.0
>
>
>  DefaultCamelContext throws NPE in getRoute(String id) if no routes are deployed.
> This happens because the "route LinkedHashSet" is not initialized.
> Fix:
>  don't do Lazy init of route  or add this to getRoute(String id):
>  if (routes == null) {
> 	routes = new LinkedHashSet<Route>();
>  } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-3198) DefaultCamelContext throws NPE in getRoute(String id)

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea resolved CAMEL-3198.
------------------------------------

    Resolution: Fixed

Fix applied. Thanks Stefan for reporting and proposed fix.

>  DefaultCamelContext throws NPE in getRoute(String id)
> ------------------------------------------------------
>
>                 Key: CAMEL-3198
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3198
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Stefan Below
>            Assignee: Hadrian Zbarcea
>            Priority: Minor
>             Fix For: 2.5.0
>
>
>  DefaultCamelContext throws NPE in getRoute(String id) if no routes are deployed.
> This happens because the "route LinkedHashSet" is not initialized.
> Fix:
>  don't do Lazy init of route  or add this to getRoute(String id):
>  if (routes == null) {
> 	routes = new LinkedHashSet<Route>();
>  } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CAMEL-3198) DefaultCamelContext throws NPE in getRoute(String id)

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea reassigned CAMEL-3198:
--------------------------------------

    Assignee: Hadrian Zbarcea

>  DefaultCamelContext throws NPE in getRoute(String id)
> ------------------------------------------------------
>
>                 Key: CAMEL-3198
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3198
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Stefan Below
>            Assignee: Hadrian Zbarcea
>            Priority: Minor
>             Fix For: 2.5.0
>
>
>  DefaultCamelContext throws NPE in getRoute(String id) if no routes are deployed.
> This happens because the "route LinkedHashSet" is not initialized.
> Fix:
>  don't do Lazy init of route  or add this to getRoute(String id):
>  if (routes == null) {
> 	routes = new LinkedHashSet<Route>();
>  } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.