/*
 * 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;
		
	}
}

@@ -837,19 +837,35 @@
 Instance
+AndOtherInstance
  %7B%0A
-
 %09@Suppre
@@ -951,16 +951,83 @@
 wMyField
+, MutableBySettingFieldOnThisInstanceAndOtherInstance otherInstance
 ) %7B%0A%09%09th
@@ -1051,16 +1051,46 @@
 yField;%0A
+%09%09otherInstance.myField = 42;%0A
 %09%09%0A%09%7D%0A%7D%0A

Update benchmark for setting fields of this type.