Review Board 1.7.22


SQOOP-879 Sqoop2: NPE when deleting job object that do not have associated any submissions

Review Request #9390 - Created Feb. 9, 2013 and submitted

Jarek Cecho
SQOOP-879
Reviewers
Sqoop
sqoop-sqoop2
I've added explicit null check.

 
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision 5e24ae3e7fd431857faa77b8f556cf8db836d708 New Change
[20] 724 lines
[+20] [+] public boolean existsJob(long id, Connection conn) {
725

    
   
725

   
726
  @Override
726
  @Override
727
  public boolean inUseJob(long jobId, Connection conn) {
727
  public boolean inUseJob(long jobId, Connection conn) {
728
    MSubmission submission = findSubmissionLastForJob(jobId, conn);
728
    MSubmission submission = findSubmissionLastForJob(jobId, conn);
729

    
   
729

   

    
   
730
    // We have no submissions and thus job can't be in use

    
   
731
    if(submission == null) {

    
   
732
      return false;

    
   
733
    }

    
   
734

   
730
    // We can't remove running job
735
    // We can't remove running job
731
    if(submission.getStatus().isRunning()) {
736
    if(submission.getStatus().isRunning()) {
732
      return true;
737
      return true;
733
    }
738
    }
734

    
   
739

   
[+20] [20] 931 lines
  1. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...