<commit_before>package de.uniba.dsg.soa;

import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateMidnight;
import org.joda.time.DateTime;
import org.joda.time.Interval;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;

@WebService(targetNamespace="http://uniba.de/dsg/soa/")
public class History {
	private List<Cancellor> cancellors;
	
	public History() {
		cancellors = new ArrayList<Cancellor>();
		
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1949, 9, 15).toDate(), new DateMidnight(1963, 10, 16).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1963, 10, 16).toDate(), new DateMidnight(1966, 12, 1).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1966, 12, 1).toDate(), new DateMidnight(1969, 10, 21).toDate()));
		cancellors.add(new Cancellor("<NAME>", "SPD", new DateMidnight(1969, 10, 21).toDate(), new DateMidnight(1974, 5, 7).toDate()));
		cancellors.add(new Cancellor("<NAME>", "SPD", new DateMidnight(1974, 5, 16).toDate(), new DateMidnight(1982, 10, 1).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1982, 10, 1).toDate(), new DateMidnight(1998, 10, 27).toDate()));
		cancellors.add(new Cancellor("<NAME>", "SPD", new DateMidnight(1998, 10, 27).toDate(), new DateMidnight(2005, 11, 22).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(2005, 11, 22).toDate(), new DateMidnight().toDate()));
	}
	
	@WebMethod
	@WebResult(name="cancellor")
	public List<Cancellor> getCancellors(@WebParam(name="from") Date from, @WebParam(name="to") Date to) throws IllegalArgumentException {
		if(from == null || to == null) {
			throw new IllegalArgumentException("Dates should not be null!");
		}
		
		ArrayList<Cancellor> active = new ArrayList<Cancellor>();
		Interval interval = new Interval(new DateTime(from), new DateTime(to));
		
		for(Cancellor c : cancellors) {
			if(interval.overlap(new Interval(new DateTime(c.getFrom()), new DateTime(c.getTo()))) != null) {
				active.add(c);
			}
		}
		return active;
	}
	
	@WebMethod(exclude=true)
	public List<Cancellor> getAll() {
		return cancellors;<commit_msg>Required WSDL method parameter<commit_after>package de.uniba.dsg.soa;

import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateMidnight;
import org.joda.time.DateTime;
import org.joda.time.Interval;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;

import javax.xml.bind.annotation.XmlElement;

@WebService(targetNamespace="http://uniba.de/dsg/soa/")
public class History {
	private List<Cancellor> cancellors;
	
	public History() {
		cancellors = new ArrayList<Cancellor>();
		
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1949, 9, 15).toDate(), new DateMidnight(1963, 10, 16).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1963, 10, 16).toDate(), new DateMidnight(1966, 12, 1).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1966, 12, 1).toDate(), new DateMidnight(1969, 10, 21).toDate()));
		cancellors.add(new Cancellor("<NAME>", "SPD", new DateMidnight(1969, 10, 21).toDate(), new DateMidnight(1974, 5, 7).toDate()));
		cancellors.add(new Cancellor("<NAME>", "SPD", new DateMidnight(1974, 5, 16).toDate(), new DateMidnight(1982, 10, 1).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(1982, 10, 1).toDate(), new DateMidnight(1998, 10, 27).toDate()));
		cancellors.add(new Cancellor("<NAME>", "SPD", new DateMidnight(1998, 10, 27).toDate(), new DateMidnight(2005, 11, 22).toDate()));
		cancellors.add(new Cancellor("<NAME>", "CDU", new DateMidnight(2005, 11, 22).toDate(), new DateMidnight().toDate()));
	}
	
	@WebMethod
	@WebResult(name="cancellor")
	public List<Cancellor> getCancellors(@WebParam(name="from") @XmlElement(required=true) Date from, @WebParam(name="to") @XmlElement(required=true) Date to) throws IllegalArgumentException {
		if(from == null || to == null) {
			throw new IllegalArgumentException("Dates should not be null!");
		}
		
		ArrayList<Cancellor> active = new ArrayList<Cancellor>();
		Interval interval = new Interval(new DateTime(from), new DateTime(to));
		
		for(Cancellor c : cancellors) {
			if(interval.overlap(new Interval(new DateTime(c.getFrom()), new DateTime(c.getTo()))) != null) {
				active.add(c);
			}
		}
		return active;
	}
	
	@WebMethod(exclude=true)
	public List<Cancellor> getAll() {
		return cancellors;
{'fraction_non_alphanumeric': 0.17484331100064837, 'fraction_numerical': 0.048411497730711045, 'mean_word_length': 5.959398496240602, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '3949489', 'n_tokens_mistral': 1896, 'n_tokens_neox': 1549, 'n_words': 350}