Adding an import for java.util.List - #2007
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds an unconditional import of java.util.List to the Jersey 3 API mustache template. The reviewer notes that hardcoding this import can lead to unused import warnings or static analysis failures in generated classes that do not use lists, and suggests importing it conditionally or using the generator's imports loop.
| import java.io.IOException; | ||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import java.util.List; |
There was a problem hiding this comment.
Hardcoding import java.util.List; in the template will cause every generated API class to include this import. For API classes that do not use any lists in their parameters or return types, this will result in an "unused import" compiler warning or static analysis (e.g., Checkstyle) failure.
Ideally, the generator's {{#imports}} loop should automatically handle importing java.util.List when it is required. If that is not working, please verify if there is a generator-specific conditional flag (such as {{#hasListParams}} or similar) that can be used to import it conditionally, rather than importing it unconditionally for all classes.
|



Description
Fixed issue
symbol not foundforList.Adds an unconditional import of java.util.List to the Jersey 3 API mustache template.
Tested scenarios
Fixed issue: