Skip to content

fix(entrypoints): Jakarta finder marks lifecycle methods, not any method with a servlet parameter - #264

Merged
rahlk merged 1 commit into
mainfrom
fix/issue-263-jakarta-entrypoint-methods
Sep 11, 2026
Merged

rahlk merged 1 commit into
mainfrom
fix/issue-263-jakarta-entrypoint-methods

Conversation

@rahlk

@rahlk rahlk commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #263.

What

JakartaEntrypointFinder.isEntrypointMethod marked any method with an HttpServletRequest / HttpServletResponse parameter. It now marks a method only when it is a container-invoked lifecycle method — service, doGet/doPost/…, doFilter, init, destroy, the ServletContext/HttpSession/ServletRequest listener callbacks, onMessage — or carries an @OnMessage/@OnOpen/@OnClose/@OnError annotation, and its type passes the class rule (which now also recognises Filter implementors). A helper that merely takes servlet-typed parameters is ordinary code whose parameters are bound by its callers, so the interprocedural tiers (ConfigUses, ViewDispatches) stop refusing to bind them.

daytrader8, built jar vs released 3.3.1

3.3.1 this branch
entrypoint callables 135 196 — 21 helpers dropped (performTask, doConfigUpdate, requestDispatch, async handlers), 82 lifecycle methods gained (init(ServletConfig), destroy, doFilter, MDB onMessage(Message))
view_dispatches 37 54 — TradeServletAction.requestDispatch's site now closes on the webUI table (17 prov: ["table"] edges)
Cypher rows = JSON 37 = 37 54 = 54
entrypoint_report.frameworks_detected jakarta, jaxrs, spring unchanged

The action path doGet → TradeServletAction.doX → requestDispatch(…, TradeConfig.getPage(N)) now reaches the JSPs in the graph.

Tests

JakartaEntrypointMethodsTest: a servlet's doGet/init marked and its show(req, res, page) / render(req) helpers not; a lifecycle name on a non-entrypoint type not marked; @WebFilter.doFilter, ServletContextListener.contextInitialized, @ServerEndpoint @OnMessage marked and their helpers not. ViewDispatchDataflowTierTest's helper takes servlet-typed parameters again (its earlier workaround comment is gone). Full suite: 603 tests, only the Docker-only integration test unrun.

Not done from #263's goals

entrypoint_report.unresolved does not count the helpers the old rule used to mark: the finder interface has no access to the report, and the count would be a near-miss tally of a rule that was simply wrong. Left out rather than plumbed through.

… method with a servlet parameter (#263)

isEntrypointMethod now requires a servlet/filter/listener/WebSocket
lifecycle name (or an @OnMessage-family annotation) on a type the
class rule already recognises; Filter implementors count as such a
type. A helper such as DayTrader's requestDispatch(ctx, req, resp,
page) is ordinary code again, so the interprocedural tiers bind its
parameters from its callers: daytrader8 view_dispatches 37 -> 54,
entrypoint marks 135 -> 196 (21 helpers dropped, 82 init/destroy/
doFilter/onMessage lifecycle methods gained).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jakarta finder marks any method with an HttpServletRequest parameter as an entrypoint, which blocks parameter binding on DayTrader's real dispatch path

1 participant