/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in 
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.benchmarks.settermethod;

@SuppressWarnings("unused")
public class ImmutableButSetsPrivateFieldOfInstanceOfSelf {

	private int myField = 0;
	private ImmutableButSetsPrivateFieldOfInstanceOfSelf fieldOfSelfType = null;
	
	public ImmutableButSetsPrivateFieldOfInstanceOfSelf setPrivateFieldOnInstanceOfSelf() {
		ImmutableButSetsPrivateFieldOfInstanceOfSelf i = new ImmutableButSetsPrivateFieldOfInstanceOfSelf();
		this.hashCode();
		i.myField = 10;
		this.hashCode();
		i.myField = 11;
		return i;
	}
		
}

class MutableBySettingFieldOnThisInstance {
	@SuppressWarnings("unused")
	private int myField = 0;
	
	public void setMyField(int newMyField) {
		this.myField = newMyField;
		
	}
}

/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in 
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.benchmarks.settermethod;

@SuppressWarnings("unused")
public class ImmutableButSetsPrivateFieldOfInstanceOfSelf {

	private int myField = 0;
	private ImmutableButSetsPrivateFieldOfInstanceOfSelf fieldOfSelfType = null;
	
	public ImmutableButSetsPrivateFieldOfInstanceOfSelf setPrivateFieldOnInstanceOfSelf() {
		ImmutableButSetsPrivateFieldOfInstanceOfSelf i = new ImmutableButSetsPrivateFieldOfInstanceOfSelf();
		this.hashCode();
		i.myField = 10;
		this.hashCode();
		i.myField = 11;
		return i;
	}
		
}

class MutableBySettingFieldOnThisInstanceAndOtherInstance {
	@SuppressWarnings("unused")
	private int myField = 0;
	
	public void setMyField(int newMyField, MutableBySettingFieldOnThisInstanceAndOtherInstance otherInstance) {
		this.myField = newMyField;
		otherInstance.myField = 42;
		
	}
}

Update benchmark for setting fields of this type.
Update benchmark for setting fields of this type.

git-svn-id: ed609ce04ec9e3c0bc25e071e87814dd6d976548@269 c7a0535c-eda6-11de-83d8-6d5adf01d787
