Fix issue 132 and refactor entry point detection logic. #133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This change addresses Issue #132, which reported that
codeanalyzer
fails to detect certain JakartaEE methods (e.g.,doPost(...)
) as valid entrypoints even though the surrounding class is correctly recognized as an entrypoint class.The root cause was a flawed heuristic in the
isEntrypointMethod(...)
implementation that required both:"Override"
.Since methods like
doPost(...)
overrideHttpServlet
methods but may not explicitly include the@Override
annotation (which is optional in Java), the AND condition resulted in false negatives.This PR removes the faulty annotation check and ensures servlet entrypoints are correctly discovered.
Additionally, this change refactors discovery logic to leverage a new
EntrypointFinderFactory
, improving modularity and extensibility for multi-framework support.How Has This Been Tested?
codeanalyzer
against a JakartaEE sample application withHttpServlet
subclasses.doPost(...)
,doGet(...)
, and similar methods are now correctly marked as entrypoints.Breaking Changes
No breaking changes. This is a non-breaking behavioral fix that improves the correctness of entrypoint detection in JakartaEE applications.
Types of changes
Checklist
Additional context
EntrypointFinderFactory
now cleanly supports framework-specific entrypoint logic (e.g., Spring, JAX-RS, Jakarta).