[JBIDE-18062] java.lang.ClassCastException in maven sourcelookup

replaced check for nul with instance of, so check covers both cases:
- null filtration
- class cast problem