[BZ-1072629] fix compilation issue when using a class extending java.util.Date
[BZ-1078839] eveluate more specific cases first when expanding a DSL