1

I'm having the same problem as the person who asked this question.

Specifically, the warning is

Type safety: A generic array of Object&Serializable&Comparable is created for a varargs parameter

on this line of code

Collections.addAll(row, name, units, Boolean.FALSE);
// types: List<Object>, String, Integer, Boolean

The solutions posted were lovely, but I was wondering if Eclipse provides another way. Can I change the compiler preferences to ignore that sort of type safety warning? If so, which one would I change?

EDIT: So far, I've tried all the ones in generic types and "Inexact type match for varargs" in Potential Programming Problems." Are there warnings Eclipse won't let me ignore or is there a different one I can turn off?

4

1 回答 1

3

在 Eclipse 中,您可以禁用任何警告,也可以在Project->Properties->Java Compiler->Errors / Warnings下启用一些默认禁用的警告:

禁用编译警告 Eclipse

于 2013-01-30T06:15:23.843 回答