To keep truly platform independent when using Java you should always consider using
System.getProperty("line.separator");
instead of \r, \n or the combination of both.
String NewText = matcher.replaceAll("-- $0 *by migration" + System.getProperty("line.separator") + "Second_String");