Fix compilation error

Remove unused import that makes compilation fail. Also replace
deprecated API Date.getYear by Calendar.get(Calendar.YEAR).