Bug 499936

Summary: Initialize Cloud Foundry target manager in field declaration to avoid NPE
Product: [ECD] CFT Reporter: Nieraj Singh <nierajsingh>
Component: GeneralAssignee: Project Inbox <cft-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: plan
Version: unspecified   
Target Milestone: 1.0.1   
Hardware: PC   
OS: Mac OS X   
Whiteboard: plan

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.