代码规范Sonar报Raw types should not be used

Raw types should not be used

不应使用原始类型
Code smell
Major
java:S3740
Generic types shouldn’t be used raw (without type parameters) in variable declarations or return values. Doing so bypasses generic type checking, and defers the catch of unsafe code to runtime.

泛型类型不应在变量声明或返回值中使用原始类型(没有类型参数)。这样做会绕过泛型类型检查,并将不安全代码的捕获延迟到运行时。
Noncompliant Code Example
List myList; // Noncompliant
Set mySet; // Noncompliant
Compliant Solution
List myList;
Set mySet;

你可能感兴趣的:(java代码规范,大数据)