Bug 499936 - Initialize Cloud Foundry target manager in field declaration to avoid NPE
Summary: Initialize Cloud Foundry target manager in field declaration to avoid NPE
Status: RESOLVED FIXED
Alias: None
Product: CFT
Classification: ECD
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal
Target Milestone: 1.0.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: plan
Keywords: plan
Depends on:
Blocks:
 
Reported: 2016-08-18 13:47 EDT by Nieraj Singh CLA
Modified: 2016-08-18 14:05 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nieraj Singh CLA 2016-08-18 13:47:15 EDT
To avoid NPEs with the target manager due to possible race condition when initializing the CloudFoundryServerBehaviour (CFSB) by WTP, initialize the target manager in the field declaration instead of the initialize method of the CFSB.

Below is an NPE that was thrown due to a race condition when initializing the CFSB.



        java.lang.NullPointerException
        at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.getTarget(CloudFoundryServerBehaviour.java:198)
        at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.getRequestFactory(CloudFoundryServerBehaviour.java:180)
        at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.getApplications(CloudFoundryServerBehaviour.java:695)
Comment 1 Nieraj Singh CLA 2016-08-18 14:05:41 EDT
Fix pushed to master branch.