<commit_before>package org.lamport.tla.toolbox.job;

import java.util.List;
import java.util.Vector;

import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.lamport.tla.toolbox.util.ResourceHelper;
import org.lamport.tla.toolbox.util.TLAMarkerHelper;
import org.lamport.tla.toolbox.util.pref.IPreferenceConstants;

import pcal.Translator;

/**
 * Runs the PCal translator
 * @author <NAME>
 * @version $Id$
 */
public class TranslatorJob extends WorkspaceJob
{
    private Translator  translator = new Translator();
    private Vector      callParams = new Vector();
    private IResource   fileToBuild;
    
    /**
     * @param name
     */
    public TranslatorJob(IResource fileToBuild)
    {
        super("PCal Translation");
        this.fileToBuild = fileToBuild;
        
        System.out.println("Translating " + fileToBuild.getLocation().toOSString());

        boolean hasPcalAlg = false;
        String[] params;

        try
        {
            hasPcalAlg = ((Boolean) fileToBuild.getSessionProperty(ResourceHelper
                    .getQName(IPreferenceConstants.CONTAINS_PCAL_ALGORITHM))).booleanValue();
            params = ((String) fileToBuild.getPersistentProperty(ResourceHelper
                    .getQName(IPreferenceConstants.PCAL_CAL_PARAMS))).split(" ");

        } catch (CoreException e1)
        {
            e1.printStackTrace();
            params = new String[0];
        }

        if (!hasPcalAlg)
        {
            // no algorithm detected
            System.out.println("No algorithm found");<commit_msg>null pointer removed<commit_after>package org.lamport.tla.toolbox.job;

import java.util.List;
import java.util.Vector;

import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.lamport.tla.toolbox.util.ResourceHelper;
import org.lamport.tla.toolbox.util.TLAMarkerHelper;
import org.lamport.tla.toolbox.util.pref.IPreferenceConstants;

import pcal.Translator;

/**
 * Runs the PCal translator
 * @author <NAME>
 * @version $Id$
 */
public class TranslatorJob extends WorkspaceJob
{
    private Translator  translator = new Translator();
    private Vector      callParams = new Vector();
    private IResource   fileToBuild;
    
    /**
     * @param name
     */
    public TranslatorJob(IResource fileToBuild)
    {
        super("PCal Translation");
        this.fileToBuild = fileToBuild;
        
        System.out.println("Translating " + fileToBuild.getLocation().toOSString());

        boolean hasPcalAlg = false;
        String[] params;

        try
        {
            hasPcalAlg = ((Boolean) fileToBuild.getSessionProperty(ResourceHelper
                    .getQName(IPreferenceConstants.CONTAINS_PCAL_ALGORITHM))).booleanValue();
            String paramString = ((String) fileToBuild.getPersistentProperty(ResourceHelper
                    .getQName(IPreferenceConstants.PCAL_CAL_PARAMS)));
            if (paramString != null) 
            {
                params = paramString.split(" ");
            } else {
                params = new String[0];
            }

        } catch (CoreException e1)
        {
            e1.printStackTrace();
            params = new String[0];
        }

        if (!hasPcalAlg)
        {
            // no algorithm detected
            System.out.println("No algorithm found");
{'fraction_non_alphanumeric': 0.10386221294363257, 'fraction_numerical': 0.0018267223382045928, 'mean_word_length': 2.6820365033621516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3438583', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1088, 'n_words': 199}