<commit_before>package de.master.manager.myproject;

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;

import de.master.manager.menueBar.BasePage;
import de.master.manager.model.TransformationModel2;
import de.master.manager.profStuff.Prof;
import de.master.manager.profStuff.WahlPflichtModuleLoader;

@MountPath(value = "/", alt = "/home")
public class DragAndDropPage extends BasePage{

	private static final long serialVersionUID = 1L;
	
	
	public DragAndDropPage() throws IOException{
		InputStream resource = getClass().getResourceAsStream("WahlPflichtModule.txt");
		InputStream breunigPflichtResource = getClass().getResourceAsStream("BreunigPflicht.txt");
		InputStream hinzPflichtResource = getClass().getResourceAsStream("HinzPflicht.txt");
		InputStream heckPflichtResource = getClass().getResourceAsStream("HeckPflicht.txt");
		InputStream hennesPflichtResource = getClass().getResourceAsStream("HennesPflicht.txt");
		
		WahlPflichtModuleLoader courseLoader = new WahlPflichtModuleLoader(IOUtils.toString(resource, "UTF-8"));
		Prof breunig = new Prof("Breunig", courseLoader.loadCourseOfProf(IOUtils.toString(breunigPflichtResource, "UTF-8"))), 
				hinz = new Prof("Hinz", courseLoader.loadCourseOfProf(IOUtils.toString(hinzPflichtResource, "UTF-8"))), 
				heck = new Prof("Heck", courseLoader.loadCourseOfProf(IOUtils.toString(heckPflichtResource, "UTF-8"))), 
				hennes = new Prof("Hennes", courseLoader.loadCourseOfProf(IOUtils.toString(hennesPflichtResource, "UTF-8")));
		
		List<Prof> allProfs = Arrays.asList(breunig, hinz, heck, hennes);
		IModel<Prof> profLeft = Model.of(breunig), profRight = Model.of(hinz);
		Form form = new Form("form");
		ModulButtonPanel panel1 = new ModulButtonPanel("buttonPanel1", profLeft, profRight,  allProfs, courseLoader);
		ModulButtonPanel panel2 = new ModulButtonPanel("buttonPanel2", profRight, profLeft, allProfs, courseLoader);
		
		InfoPanel infoPanel = new InfoPanel("infoPanel", new TransformationModel2<Prof, Prof, List<Prof>>(profLeft, profRight, (p1,p2) -> Arrays.asList(profLeft.getObject(), profRight.getObject())), allProfs);
		add(panel1, panel2, infoPanel);
	}
	<commit_msg>refactoring<commit_after>package de.master.manager.myproject;

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;

import de.master.manager.menueBar.BasePage;
import de.master.manager.model.TransformationModel2;
import de.master.manager.profStuff.Prof;
import de.master.manager.profStuff.WahlPflichtModuleLoader;

@MountPath(value = "/", alt = "/home")
public class DragAndDropPage extends BasePage{

	private static final long serialVersionUID = 1L;
	
	
	public DragAndDropPage() throws IOException{
		/* load all needed wahlcourses and pflichtcourses */
		InputStream resource = getClass().getResourceAsStream("WahlPflichtModule.txt");
		InputStream breunigPflichtResource = getClass().getResourceAsStream("BreunigPflicht.txt");
		InputStream hinzPflichtResource = getClass().getResourceAsStream("HinzPflicht.txt");
		InputStream heckPflichtResource = getClass().getResourceAsStream("HeckPflicht.txt");
		InputStream hennesPflichtResource = getClass().getResourceAsStream("HennesPflicht.txt");
		
		WahlPflichtModuleLoader courseLoader = new WahlPflichtModuleLoader(IOUtils.toString(resource, "UTF-8"));
		Prof breunig = new Prof("Breunig", courseLoader.loadCourseOfProf(IOUtils.toString(breunigPflichtResource, "UTF-8"))), 
				hinz = new Prof("Hinz", courseLoader.loadCourseOfProf(IOUtils.toString(hinzPflichtResource, "UTF-8"))), 
				heck = new Prof("Heck", courseLoader.loadCourseOfProf(IOUtils.toString(heckPflichtResource, "UTF-8"))), 
				hennes = new Prof("Hennes", courseLoader.loadCourseOfProf(IOUtils.toString(hennesPflichtResource, "UTF-8")));
		
		/* load the ui */
		List<Prof> allProfs = Arrays.asList(breunig, hinz, heck, hennes);
		IModel<Prof> profLeft = Model.of(breunig), profRight = Model.of(hinz);
		ModulButtonPanel panel1 = new ModulButtonPanel("buttonPanel1", profLeft, profRight,  allProfs, courseLoader);
		ModulButtonPanel panel2 = new ModulButtonPanel("buttonPanel2", profRight, profLeft, allProfs, courseLoader);
		
		InfoPanel infoPanel = new InfoPanel("infoPanel", new TransformationModel2<Prof, Prof, List<Prof>>(profLeft, profRight, Arrays::asList), allProfs);
		add(panel1, panel2, infoPanel);
	}
	
{'fraction_non_alphanumeric': 0.12214848610535048, 'fraction_numerical': 0.006221484861053505, 'mean_word_length': 6.8042071197411005, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '2768028', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1563, 'n_words': 271}