<commit_before>/**
 * Mar 14, 2014 File created by Ramiro.Serrato
 */
package org.maker_pattern;

import static org.maker_pattern.LivingBeingMaker.*;

import org.maker_pattern.animals.Animal;
import org.maker_pattern.animals.AnimalFamily;
import org.maker_pattern.animals.Cat;
import org.maker_pattern.animals.Dog;
import org.maker_pattern.animals.DogFamily;
import org.maker_pattern.plants.Plant;

/**
 * @author Ramiro.Serrato
 *
 */
public class LivingBeingHospital {
	
	/*** Singletons, look at the different ways for injecting dependencies ***/

	private Dog sparky = LivingBeingMaker.getDog(SPARKY_DOG); // By concrete class
	private Dog pinky = LivingBeingMaker.getDog(PINKY_DOG); // By concrete class
	
	private DogFamily sparkyFamily = LivingBeingMaker.getDogFamily(SPARKY_FAMILY);	// this is a wired bean 
	
	/*** Prototypes, (new instance every time) objects ***/
	
	private Animal labrador1 = LivingBeingMaker.getDog(LABRADOR); // by abstract class 
	private Animal labrador2 = LivingBeingMaker.getAnimal(LABRADOR); // by abstract class 
	private Animal siamese = LivingBeingMaker.getAnimal(SIAMESE);  // By abstract class
	private Plant myDaisy = LivingBeingMaker.getPlant(DAISY); // Using interface injection
	private Plant myCeiba = LivingBeingMaker.getPlant(CEIBA); // Using interface injection
	
	private void cureAnimal(Animal animal) {
		System.out.print("Curing animal...");
		animal.makeNoise();  // it hurts
	}
	
	private void curePlant(Plant plant) {
		System.out.print("Curing plant...");
		plant.grow(); // now it grows
	}
	
	private void attendLabradorDogBirth(DogFamily dogFamily) {
		System.out.print("Attending dog birth...");
		Dog newDog = LivingBeingMaker.getDog(LABRADOR);
		dogFamily.newMember(newDog);
	}
	
	private void attendSiameseCatBirth(AnimalFamily<Cat> catFamily) {
		System.out.print("Attending cat birth...");		
		Cat newCat = LivingBeingMaker.getCat(SIAMESE);
		catFamily.newMember(newCat);
	}
	
	private void cureAnimals() {
		cureAnimal(siamese);
		cureAnimal(labrador1);
		cureAnimal(labrador2);
	}
	
	private void curePlants() {
		curePlant(myDaisy);
		curePlant(myCeiba);
	}
	
	public void doHospitalDay() {
		cureAnimals();
		curePlants();	
		attendLabradorDogBirth(sparkyFamily);
	}
	
	public static void main(String[] args) {
		LivingBeingHospital generalHospital = new LivingBeingHospital();
		generalHospital.doHospitalDay();
	}
}<commit_msg>Renamed method in LivingBeingHospital class<commit_after>/**
 * Mar 14, 2014 File created by Ramiro.Serrato
 */
package org.maker_pattern;

import static org.maker_pattern.LivingBeingMaker.*;

import org.maker_pattern.animals.Animal;
import org.maker_pattern.animals.AnimalFamily;
import org.maker_pattern.animals.Cat;
import org.maker_pattern.animals.Dog;
import org.maker_pattern.animals.DogFamily;
import org.maker_pattern.plants.Plant;

/**
 * @author Ramiro.Serrato
 *
 */
public class LivingBeingHospital {
	
	/*** Singletons, look at the different ways for injecting dependencies ***/

	private Dog sparky = LivingBeingMaker.getDog(SPARKY_DOG); // By concrete class
	private Dog pinky = LivingBeingMaker.getDog(PINKY_DOG); // By concrete class
	
	private DogFamily sparkyFamily = LivingBeingMaker.getDogFamily(SPARKY_FAMILY);	// this is a wired bean 
	
	/*** Prototypes, (new instance every time) objects ***/
	
	private Animal labrador1 = LivingBeingMaker.getDog(LABRADOR); // by abstract class 
	private Animal labrador2 = LivingBeingMaker.getAnimal(LABRADOR); // by abstract class 
	private Animal siamese = LivingBeingMaker.getAnimal(SIAMESE);  // By abstract class
	private Plant myDaisy = LivingBeingMaker.getPlant(DAISY); // Using interface injection
	private Plant myCeiba = LivingBeingMaker.getPlant(CEIBA); // Using interface injection
	
	private void cureAnimal(Animal animal) {
		System.out.print("Curing animal...");
		animal.makeNoise();  // it hurts
	}
	
	private void curePlant(Plant plant) {
		System.out.print("Curing plant...");
		plant.grow(); // now it grows
	}
	
	private void attendLabradorDogBirth(DogFamily dogFamily) {
		System.out.print("Attending dog birth...");
		Dog newDog = LivingBeingMaker.getDog(LABRADOR);
		dogFamily.newMember(newDog);
	}
	
	private void attendSiameseCatBirth(AnimalFamily<Cat> catFamily) {
		System.out.print("Attending cat birth...");		
		Cat newCat = LivingBeingMaker.getCat(SIAMESE);
		catFamily.newMember(newCat);
	}
	
	private void cureAnimals() {
		cureAnimal(siamese);
		cureAnimal(labrador1);
		cureAnimal(labrador2);
	}
	
	private void curePlants() {
		curePlant(myDaisy);
		curePlant(myCeiba);
	}
	
	public void runHospitalDay() {
		cureAnimals();
		curePlants();	
		attendLabradorDogBirth(sparkyFamily);
	}
	
	public static void main(String[] args) {
		LivingBeingHospital generalHospital = new LivingBeingHospital();
		generalHospital.runHospitalDay();
	}
}
{'fraction_non_alphanumeric': 0.11060480530240265, 'fraction_numerical': 0.004142502071251036, 'mean_word_length': 4.81107099879663, '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': '4151950', 'n_tokens_mistral': 1781, 'n_tokens_neox': 1549, 'n_words': 346}