Repository navigation
fix(entrypoints): Jakarta finder marks lifecycle methods, not any method with a servlet parameter - #264
Merged
Conversation
… 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).
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #263.
What
JakartaEntrypointFinder.isEntrypointMethodmarked any method with anHttpServletRequest/HttpServletResponseparameter. It now marks a method only when it is a container-invoked lifecycle method —service,doGet/doPost/…,doFilter,init,destroy, theServletContext/HttpSession/ServletRequestlistener callbacks,onMessage— or carries an@OnMessage/@OnOpen/@OnClose/@OnErrorannotation, and its type passes the class rule (which now also recognisesFilterimplementors). 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
performTask,doConfigUpdate,requestDispatch, async handlers), 82 lifecycle methods gained (init(ServletConfig),destroy,doFilter, MDBonMessage(Message))view_dispatchesTradeServletAction.requestDispatch's site now closes on thewebUItable (17prov: ["table"]edges)entrypoint_report.frameworks_detectedThe action path
doGet → TradeServletAction.doX → requestDispatch(…, TradeConfig.getPage(N))now reaches the JSPs in the graph.Tests
JakartaEntrypointMethodsTest: a servlet'sdoGet/initmarked and itsshow(req, res, page)/render(req)helpers not; a lifecycle name on a non-entrypoint type not marked;@WebFilter.doFilter,ServletContextListener.contextInitialized,@ServerEndpoint@OnMessagemarked 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.unresolveddoes 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.