<commit_before>package bndtools.wizards.workspace;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;

import aQute.bnd.build.Workspace;
import bndtools.Plugin;
import bndtools.preferences.BndPreferences;

public class CnfSetupWizard extends Wizard {

    private CnfSetupDecision decision;

    private final CnfSetupUserConfirmationWizardPage confirmPage;
    private final CnfImportOrOpenWizardPage importPage;
    private final CnfTemplateSelectionWizardPage templatePage = new CnfTemplateSelectionWizardPage();

    private CnfSetupOperation operation;

    public CnfSetupWizard(CnfSetupOperation op) {
        this.decision = CnfSetupDecision.SETUP;
        this.operation = op;
        setForcePreviousAndNextButtons(true);
        setNeedsProgressMonitor(true);

        confirmPage = new CnfSetupUserConfirmationWizardPage(decision);
        importPage = new CnfImportOrOpenWizardPage();

        addPage(confirmPage);
        addPage(templatePage);

        importPage.setWizard(this);

        confirmPage.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                decision = confirmPage.getDecision();

                if (confirmPage.isCreateInEclipseWorkspace())
                    operation = determineNecessaryOperation(true);<commit_msg>Fix npe in cnf setup wizard<commit_after>package bndtools.wizards.workspace;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;

import aQute.bnd.build.Workspace;
import bndtools.Plugin;
import bndtools.preferences.BndPreferences;

public class CnfSetupWizard extends Wizard {

    private CnfSetupDecision decision;

    private final CnfSetupUserConfirmationWizardPage confirmPage;
    private final CnfImportOrOpenWizardPage importPage;
    private final CnfTemplateSelectionWizardPage templatePage = new CnfTemplateSelectionWizardPage();

    private CnfSetupOperation operation;

    public CnfSetupWizard(CnfSetupOperation op) {
        this.decision = CnfSetupDecision.SETUP;
        this.operation = op;
        setForcePreviousAndNextButtons(true);
        setNeedsProgressMonitor(true);

        confirmPage = new CnfSetupUserConfirmationWizardPage(decision);
        importPage = new CnfImportOrOpenWizardPage();

        addPage(confirmPage);
        addPage(templatePage);

        importPage.setWizard(this);
        importPage.setOperation(operation);

        confirmPage.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                decision = confirmPage.getDecision();

                if (confirmPage.isCreateInEclipseWorkspace())
                    operation = determineNecessaryOperation(true);
{'fraction_non_alphanumeric': 0.07680491551459294, 'fraction_numerical': 0.0, 'mean_word_length': 4.426388888888889, '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': '980884', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1081, 'n_words': 191}