truncate lines for java