<commit_before>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.extra.scheduler.examples;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map.Entry;

import org.objectweb.proactive.extra.scheduler.common.exception.SchedulerException;
import org.objectweb.proactive.extra.scheduler.common.job.JobId;
import org.objectweb.proactive.extra.scheduler.common.job.JobResult;
import org.objectweb.proactive.extra.scheduler.common.scheduler.SchedulerAuthenticationInterface;
import org.objectweb.proactive.extra.scheduler.common.scheduler.SchedulerConnection;
import org.objectweb.proactive.extra.scheduler.common.scheduler.UserSchedulerInterface;
import org.objectweb.proactive.extra.scheduler.common.task.TaskResult;


public class ResultRecup {
    public static void main(String[] args) {
        try {
            //GET SCHEDULER
            UserSchedulerInterface scheduler;
            SchedulerAuthenticationInterface auth;
            if (args.length > 0) {
                auth = SchedulerConnection.join("//" + args[0] + "/" +
                        SchedulerConnection.SCHEDULER_DEFAULT_NAME);
            } else {
                auth = SchedulerConnection.join(null);
            }

            scheduler = auth.logAsUser("chri", "chri");

            InputStreamReader reader = new InputStreamReader(System.in);

            // Wrap the reader with a buffered reader.
            BufferedReader buf = new BufferedReader(reader);
            String jID;
            System.out.print(
                "\nPlease enter the job id to get its result or 'exit' to exit :  ");
            while (!(jID = buf.readLine()).equals("exit")) {
                int begin = 0;
                int end = 0;
                if (jID.matches(".* to .*")) {
                    String[] TjID = jID.split(" to ");
                    begin = Integer.parseInt(TjID[0]);
                    end = Integer.parseInt(TjID[1]);
                } else {
                    begin = Integer.parseInt(jID);
                    end = Integer.parseInt(jID);
                }
                for (int i = begin; i <= end; i++) {
                    try {
                        JobResult result = scheduler.getResult(JobId.makeJobId(i +
                                    ""));
                        if (result != null) {
                            System.out.println("Job " + i + " Result => ");
                            for (Entry<String, TaskResult> e : result.getTaskResults()
                                                                     .entrySet()) {
                                TaskResult tRes = e.getValue();
                                try {
                                    System.out.println("\t " + e.getKey() +
                                        " : " + tRes.value());
                                } catch (Throwable e1) {
                                    System.out.println("\t ERROR : " +
                                        e.getKey() + " : " +
                                        tRes.getException().getMessage());
                                }
                            }
                        } else {
                            System.out.println("Job " + i +
                                " is not finished or unknown !");
                        }
                    } catch (SchedulerException e) {
                        System.out.println("Error job " + i + " : " +
                            e.getMessage());
                    }
                }
                System.out.print(
                    "\nPlease enter the job id to get its result or 'exit' to exit :  ");
            }
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
            //e.printStackTrace();
            System.exit(1);
        }

        System.exit(0);
    }
}
<commit_msg>better to print the full exception in the ResultRecup script<commit_after>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.extra.scheduler.examples;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map.Entry;

import org.objectweb.proactive.extra.scheduler.common.exception.SchedulerException;
import org.objectweb.proactive.extra.scheduler.common.job.JobId;
import org.objectweb.proactive.extra.scheduler.common.job.JobResult;
import org.objectweb.proactive.extra.scheduler.common.scheduler.SchedulerAuthenticationInterface;
import org.objectweb.proactive.extra.scheduler.common.scheduler.SchedulerConnection;
import org.objectweb.proactive.extra.scheduler.common.scheduler.UserSchedulerInterface;
import org.objectweb.proactive.extra.scheduler.common.task.TaskResult;


public class ResultRecup {
    public static void main(String[] args) {
        try {
            //GET SCHEDULER
            UserSchedulerInterface scheduler;
            SchedulerAuthenticationInterface auth;
            if (args.length > 0) {
                auth = SchedulerConnection.join("//" + args[0] + "/" +
                        SchedulerConnection.SCHEDULER_DEFAULT_NAME);
            } else {
                auth = SchedulerConnection.join(null);
            }

            scheduler = auth.logAsUser("chri", "chri");

            InputStreamReader reader = new InputStreamReader(System.in);

            // Wrap the reader with a buffered reader.
            BufferedReader buf = new BufferedReader(reader);
            String jID;
            System.out.print(
                "\nPlease enter the job id to get its result or 'exit' to exit :  ");
            while (!(jID = buf.readLine()).equals("exit")) {
                int begin = 0;
                int end = 0;
                if (jID.matches(".* to .*")) {
                    String[] TjID = jID.split(" to ");
                    begin = Integer.parseInt(TjID[0]);
                    end = Integer.parseInt(TjID[1]);
                } else {
                    begin = Integer.parseInt(jID);
                    end = Integer.parseInt(jID);
                }
                for (int i = begin; i <= end; i++) {
                    try {
                        JobResult result = scheduler.getResult(JobId.makeJobId(i +
                                    ""));
                        if (result != null) {
                            System.out.println("Job " + i + " Result => ");
                            for (Entry<String, TaskResult> e : result.getTaskResults()
                                                                     .entrySet()) {
                                TaskResult tRes = e.getValue();
                                try {
                                    System.out.println("\t " + e.getKey() +
                                        " : " + tRes.value());
                                } catch (Throwable e1) {
                                    System.out.println(
                                        "\t ERROR during execution of " +
                                        e.getKey() + "... ");
                                    tRes.getException().printStackTrace();
                                }
                            }
                        } else {
                            System.out.println("Job " + i +
                                " is not finished or unknown !");
                        }
                    } catch (SchedulerException e) {
                        System.out.println("Error job " + i + " : " +
                            e.getMessage());
                    }
                }
                System.out.print(
                    "\nPlease enter the job id to get its result or 'exit' to exit :  ");
            }
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
            //e.printStackTrace();
            System.exit(1);
        }

        System.exit(0);
    }
}

{'fraction_non_alphanumeric': 0.11923039549120591, 'fraction_numerical': 0.006219026333689631, 'mean_word_length': 1.511469009272816, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2017877', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2416, 'n_words': 653}