code: private void changeRecInvMethod(ARecordDeclIR rec)
  	{
  		try
  		{
  			rec.getInvariant().apply(new RecInvTransformation(javaGen, rec));
  		} catch (org.overture.codegen.ir.analysis.AnalysisException e)
  		{
  			log.error("Could not transform the invariant method of a record");
  			e.printStackTrace();
  		}
  	}
docs: The record invariant method is generated such that it takes the record instance as an argument, e.g.
  inv_Rec(recToCheck). When I try to invoke it from the instance invariant clause as //@ invariant inv_Rec(this);
  it crashes on a stackoverflow where it keeps calling the invariant check. Adjusting the invariant method such
  that it instead takes the fields as arguments does, however, work. This is exactly what this method does. After
  calling this method a call to the invariant method from the invariant will take the following form: //@ public
  instance invariant inv_Rec(field1,field2);
  
  @param rec
  The record for which we will change the invariant method