#vulnerable code 
                                protected void updateExecutionTask(ResCloudlet rcl, double currentTime, Processor p) {
        NetworkCloudlet netcl = (NetworkCloudlet)rcl.getCloudlet();
        /**
         * @todo @author manoelcampos updates the execution
         * length of the task, considering the NetworkCloudlet
         * has only one execution task.
         */
        CloudletExecutionTask task = (CloudletExecutionTask)netcl.getCurrentTask();
        task.process(netcl.getCloudletFinishedSoFar());   
        if (task.isFinished()) {
            netcl.getCurrentTask().computeExecutionTime(currentTime);
            startNextTask(netcl);
        }            
    } 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                protected void updateExecutionTask(ResCloudlet rcl, double currentTime, Processor p) {
        NetworkCloudlet netcl = (NetworkCloudlet)rcl.getCloudlet();
        if(!(netcl.getCurrentTask() instanceof CloudletExecutionTask))
            throw new RuntimeException(
                "This method has to be called only when the current task of the NetworkCloudlet, inside the given ResCloudlet, is a CloudletExecutionTask");
        
        /**
         * @todo @author manoelcampos The method updates the execution
         * length of the task, considering the NetworkCloudlet
         * has only 1 execution task.
         */
        CloudletExecutionTask task = (CloudletExecutionTask)netcl.getCurrentTask();
        task.process(netcl.getCloudletFinishedSoFar());   
        if (task.isFinished()) {
            netcl.getCurrentTask().computeExecutionTime(currentTime);
            startNextTask(netcl);
        }            
    }