<commit_before>package nl.uva.cs.lobcder.catalogue.delsweep;

import java.util.logging.Level;
import lombok.extern.java.Log;
import nl.uva.cs.lobcder.catalogue.beans.PdriBean;
import nl.uva.cs.lobcder.catalogue.beans.PdriGroupBean;
import nl.uva.cs.lobcder.resources.PDRI;
import nl.uva.cs.lobcder.resources.PDRIDescr;
import nl.uva.cs.lobcder.resources.PDRIFactory;

/**
 * User: dvasunin Date: 25.02.13 Time: 16:31 To change this template use File |
 * Settings | File Templates.
 */
@Log
public class DeleteSweep implements Runnable {

    private final ConnectorI connector;

    public DeleteSweep(ConnectorI connector) {
        this.connector = connector;
    }

    @Override
    public void run() {
        try {
            for (PdriGroupBean pdriGroupBean : connector.getPdriGroupsToProcess()) {
                for (PdriBean pdriBean : pdriGroupBean.getPdri()) {
                    try {
                        PDRI pdri = PDRIFactory.getFactory().createInstance(pdriBean);
                        if (pdri.exists(pdri.getFileName())) {
                            pdri.delete();
                        }
                    } catch (Exception e) {
                        if (e.getMessage().contains("No route to host") || e.getMessage().contains("Moved Permanently") || e instanceof java.net.UnknownHostException) {
                            DeleteSweep.log.log(Level.WARNING, null, e);
                        } else {
                            throw e;
                        }
                    }
                }
                connector.confirmPdriGroup(pdriGroupBean.getId());
            }
        } catch (Exception e) {
            DeleteSweep.log.log(Level.SEVERE, null, e);
        }
    }
}
<commit_msg>fixes for DeleteSweep: added check for null for pdri<commit_after>package nl.uva.cs.lobcder.catalogue.delsweep;

import java.util.logging.Level;
import lombok.extern.java.Log;
import nl.uva.cs.lobcder.catalogue.beans.PdriBean;
import nl.uva.cs.lobcder.catalogue.beans.PdriGroupBean;
import nl.uva.cs.lobcder.resources.PDRI;
import nl.uva.cs.lobcder.resources.PDRIDescr;
import nl.uva.cs.lobcder.resources.PDRIFactory;

/**
 * User: dvasunin Date: 25.02.13 Time: 16:31 To change this template use File |
 * Settings | File Templates.
 */
@Log
public class DeleteSweep implements Runnable {

    private final ConnectorI connector;

    public DeleteSweep(ConnectorI connector) {
        this.connector = connector;
    }

    @Override
    public void run() {
        try {
            for (PdriGroupBean pdriGroupBean : connector.getPdriGroupsToProcess()) {
                if(pdriGroupBean.getPdri() != null) {
                    for (PdriBean pdriBean : pdriGroupBean.getPdri()) {
                        try {
                            PDRI pdri = PDRIFactory.getFactory().createInstance(pdriBean);
                            if (pdri.exists(pdri.getFileName())) {
                                pdri.delete();
                            }
                        } catch (Exception e) {
                            if (e.getMessage().contains("No route to host") || e.getMessage().contains("Moved Permanently") || e instanceof java.net.UnknownHostException) {
                                DeleteSweep.log.log(Level.WARNING, null, e);
                            } else {
                                throw e;
                            }
                        }
                    }
                }
                connector.confirmPdriGroup(pdriGroupBean.getId());
            }
        } catch (Exception e) {
            DeleteSweep.log.log(Level.SEVERE, null, e);
        }
    }
}

{'fraction_non_alphanumeric': 0.10304192929569746, 'fraction_numerical': 0.005480953685941353, 'mean_word_length': 1.6818515797207936, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5110534', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1089, 'n_words': 194}