mattcasters opened a new issue, #8804:
URL: https://github.com/apache/hop/issues/8804

   ### Apache Hop version?
   
   2.20.0-SNAPSHOT (main, 2026-10-08)
   
   ### Java version?
   
   21 (Temurin on the GitHub `ubuntu-latest` runner)
   
   ### Operating system
   
   Linux
   
   ### What happened?
   
   The "Run SWTBot UI tests under Xvfb" step prints the same error once per 
context action, with a full stack trace. One hop or transform context menu is 
enough to log it for every action. `HopGuiPipelineGraphClickContractTest` opens 
many menus, so the step log grows to tens or hundreds of megabytes and hides 
the real failure.
   
   Seen on the ui-tests job of 
https://github.com/apache/hop/actions/runs/37742323607 (2026-10-08). That log 
was about 192MB. Surefire's failure on that run was a different test. This 
error is what filled the log:
   
   ```
   GUI - ERROR: Error filtering out action 
pipeline-graph-hop-10700-set-partitioning with filter 
java.lang.String.filterHopActions
   GUI - org.apache.hop.core.exception.HopException:
   GUI - Error filtering out action with ID 
pipeline-graph-hop-10700-set-partitioning against filter 
java.lang.String.filterHopActions
   GUI - Cannot invoke "Object.getClass()" because "guiPlugin" is null
   GUI -     at 
org.apache.hop.ui.hopgui.context.BaseGuiContextHandler.evaluateActionFilter(BaseGuiContextHandler.java:179)
   GUI -     at 
org.apache.hop.ui.hopgui.context.BaseGuiContextHandler.getPluginActions(BaseGuiContextHandler.java:72)
   GUI -     at 
org.apache.hop.ui.hopgui.file.pipeline.context.HopGuiPipelineHopContext.getSupportedActions(HopGuiPipelineHopContext.java:70)
   GUI -     at 
org.apache.hop.ui.hopgui.context.GuiContextUtil.handleActionSelection(GuiContextUtil.java:177)
   GUI -     at 
org.apache.hop.ui.hopgui.file.pipeline.HopGuiPipelineGraph.openContextDialog(HopGuiPipelineGraph.java:1944)
   GUI - Caused by: java.lang.NullPointerException: Cannot invoke 
"Object.getClass()" because "guiPlugin" is null
   GUI -     at 
org.apache.hop.ui.hopgui.context.BaseGuiContextHandler.evaluateActionFilter(BaseGuiContextHandler.java:172)
   ```
   
   The same stack is logged for `filterTransformActions` and for every other 
action id (`pipeline-graph-transform-10000-edit`, 
`pipeline-graph-hop-10700-set-partitioning`, and the rest). `getPluginActions` 
catches the exception, logs it, and keeps the action, so the SWTBot click tests 
still pass.
   
   **Why the filter is called `java.lang.String`**
   
   `GuiRegistry.addGuiActionFilter` stores the id as 
`guiPluginClassName.getClass().getName() + "." + method.getName()`. 
`guiPluginClassName` is already the class name. `getClass()` on that string is 
`java.lang.String`, so every filter id is `java.lang.String.<method>`. 
`addGuiToolbarItemFilter` does the same thing. The id is only used in this log 
line. The class name stored on the filter is the real plugin class.
   
   **Why `guiPlugin` is null**
   
   `BaseGuiContextHandler.getFilterObject` loads that class and calls 
`getInstance()`. For the hop and transform filters the class is 
`HopGuiPipelineGraph`. `HopGuiPipelineGraph.getInstance()` returns 
`HopGui.getActivePipelineGraph()`, which is null unless the active explorer 
file handler is a pipeline graph.
   
   The SWTBot click tests construct a `HopGuiPipelineGraph` on a shell and 
dispatch mouse events to it. That graph is not the active file handler, so 
`getInstance()` returns null. `evaluateActionFilter` then calls 
`guiPlugin.getClass()`.
   
   `HopGuiWorkflowGraph.getInstance()` has the same shape, so workflow context 
menus in those tests do this too.
   
   `GuiActionLambdaBuilder.createLambda` also takes the plugin from 
`getInstance()` and ignores the graph passed in as the refresher. The filter 
path is what floods the log, because it invokes the plugin immediately. A 
selected action would hit the same null later.
   
   **What to change**
   
   - Set the filter id to `guiPluginClassName + "." + method.getName()` in both 
`addGuiActionFilter` and `addGuiToolbarItemFilter`.
   - Run a filter on the graph the context already holds (`getPipelineGraph()` 
/ `getWorkflowGraph()`) when that graph is the filter class. Keep 
`getInstance()` for plugins that are not the graph (testing, drill-down, and so 
on).
   - Build the action lambda on that same graph when the refresher is the 
plugin class.
   - Do not call `getClass()` on a null plugin.
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: Hop Gui, Component: Integration Testing
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to