Simplify code. Remove redundant casts and checks.

From sources/javadoc:
hudson.model.AbstractProject#getTrigger(Class<T> clazz)
* Gets the specific trigger, or null if the propert is not configured for this job.
Sorry what do you mean under "commit"?  ```new ParametersAction(values)``` are all input variables. sha1 is also here.