Update DDF.java

Add judgement of input parameter and correct a mistake