Clean shouldn't be necessary in JGit.  Its required in the C hook script because we are presented with the *original* buffer from the user, before its been cleaned up by the commit creation routine.  So there we need to drop lines leading with #, etc.  But within JGit that should all happen in the higher level UI before that UI invokes the ChangeIdUtil class.  (Or simply not need to happen at all.)