Skip to content

Adding an import for java.util.List - #2007

Merged
poojah-adyen merged 1 commit into
mainfrom
fix-import-list
Jul 16, 2026
Merged

Adding an import for java.util.List#2007
poojah-adyen merged 1 commit into
mainfrom
fix-import-list

Conversation

@poojah-adyen

@poojah-adyen poojah-adyen commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description
Fixed issue symbol not found for List.
Adds an unconditional import of java.util.List to the Jersey 3 API mustache template.

Tested scenarios

Fixed issue:

@poojah-adyen
poojah-adyen requested a review from a team as a code owner July 16, 2026 14:13

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@sonarqubecloud

Copy link
Copy Markdown

@poojah-adyen poojah-adyen added the Fix Indicates a bug fix label Jul 16, 2026
@poojah-adyen
poojah-adyen added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit d74a627 Jul 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Indicates a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants