java/gust/backend/runtime/Logging.java
Provide the parametrized type for this generic. Open
Open
public static Logger logger(Class cls) { return LoggerFactory.getLogger(cls.getName());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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<String> myList; Set<? extends Number> mySet;
'{' at column 42 should have line break after. Open
Open
public static Logger logger(Class cls) { return LoggerFactory.getLogger(cls.getName());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for the placement of left curly braces('{'
) for code blocks.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.