List<Question> questions = new ArrayList<Question>();
questions.addAll(getAllQuestions()); //returns a set of Questions
Collections.sort(questions, new BeanComparator("questionId")); //org.apache.commons.beanutils.BeanComparator
Java 1.5 では、「new BeanComparator("questionId")」が unchecked 警告を生成することを除いて、上記は正常に機能します。私は警告が好きではありません。BeanComparator にタイプを提供する方法はありますか、または使用する必要があります@SuppressWarnings("unchecked")
か?