<commit_before>package com.christophdietze.jack.client;

import com.allen_sauer.gwt.log.client.Log;
import com.christophdietze.jack.client.event.UncaughtExceptionEvent;
import com.christophdietze.jack.client.presenter.ApplicationContext;
import com.christophdietze.jack.client.util.GlobalEventBus;
import com.christophdietze.jack.client.view.MainView;
import com.christophdietze.jack.shared.ChessServiceAsync;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootLayoutPanel;

public class Main implements EntryPoint {

	private static final MyGinjector injector = GWT.create(MyGinjector.class);

	public void onModuleLoad() {
		final ApplicationContext applicationContext = injector.getApplicationContext();
		final ChessServiceAsync service = injector.getChessServiceAsync();
		final GlobalEventBus eventBus = injector.getEventBus();
		GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
			public void onUncaughtException(Throwable ex) {
				Log.error("Uncaught exception:", ex);
				String errorMessage = buildErrorMessage(ex);
				eventBus.fireEvent(new UncaughtExceptionEvent(errorMessage));
				service.sendErrorReport(applicationContext.getLocationId(), errorMessage, new AsyncCallback<Void>() {
					@Override
					public void onSuccess(Void result) {
					}
					@Override
					public void onFailure(Throwable ex) {
						// don't throw another uncaught exception, rather just fail silently
					}
				});
			}
		});
		MainView mainView = injector.getMainView();
		RootLayoutPanel.get().add(mainView);

		Log.info("GWT Module " + this.getClass().getName() + " initialized.");
	}

	private static String buildErrorMessage(Throwable ex) {
		return buildErrorMessage(new StringBuilder(), ex).toString();
	}

	private static StringBuilder buildErrorMessage(StringBuilder sb, Throwable ex) {
		sb.append(ex.getClass().getName() + ": ");
		sb.append(ex.getMessage());
		if (ex.getCause() != null) {
			sb.append("; Caused by: ");
			return buildErrorMessage(sb, ex.getCause());
		}
		return sb;
	}
}<commit_msg>case 2: My first case to solve https://thunderklaus.fogbugz.com/default.asp?2 BugzID: 2<commit_after>package com.christophdietze.jack.client;

import com.allen_sauer.gwt.log.client.Log;
import com.christophdietze.jack.client.event.UncaughtExceptionEvent;
import com.christophdietze.jack.client.presenter.ApplicationContext;
import com.christophdietze.jack.client.util.GlobalEventBus;
import com.christophdietze.jack.client.view.MainView;
import com.christophdietze.jack.shared.ChessServiceAsync;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootLayoutPanel;

public class Main implements EntryPoint {

	private static final MyGinjector injector = GWT.create(MyGinjector.class);

	public void onModuleLoad() {
		final ApplicationContext applicationContext = injector.getApplicationContext();
		final ChessServiceAsync service = injector.getChessServiceAsync();
		final GlobalEventBus eventBus = injector.getEventBus();
		GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
			public void onUncaughtException(Throwable ex) {
				Log.error("Uncaught exception:", ex);
				String errorMessage = buildErrorMessage(ex);
				eventBus.fireEvent(new UncaughtExceptionEvent(errorMessage));
				service.sendErrorReport(applicationContext.getLocationId(), errorMessage, new AsyncCallback<Void>() {
					@Override
					public void onSuccess(Void result) {
					}
					@Override
					public void onFailure(Throwable ex) {
						// don't throw another uncaught exception, rather just fail silently
					}
				});
			}
		});
		MainView mainView = injector.getMainView();
		RootLayoutPanel.get().add(mainView);

		Log.info("GWT Module " + this.getClass().getName() + " initialized.");
	}

	private String buildErrorMessage(Throwable ex) {
		return buildErrorMessage(new StringBuilder(), ex).toString();
	}

	private StringBuilder buildErrorMessage(StringBuilder sb, Throwable ex) {
		sb.append(ex.getClass().getName() + ": ");
		sb.append(ex.getMessage());
		if (ex.getCause() != null) {
			sb.append("; Caused by: ");
			return buildErrorMessage(sb, ex.getCause());
		}
		return sb;
	}
}
{'fraction_non_alphanumeric': 0.1156307129798903, 'fraction_numerical': 0.0006855575868372943, 'mean_word_length': 5.130252100840337, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '5758932', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1328, 'n_words': 251}