mattcasters opened a new pull request, #7358:
URL: https://github.com/apache/hop/pull/7358

   # Hardening Caching File Execution Info Location (Issue #7342)
   
   This report outlines the implemented changes to resolve [GitHub Issue 
#7342](https://github.com/apache/hop/issues/7342).
   
   ---
   
   ## Overview of the Bug
   * **Problem:** Under non-UI execution environments, the execution 
information retriever (such as the `Get System Info` pipeline transform 
calculating the date range based on previous execution status) calls locatio
   n retrieval with a `null` selector.
   * **Symptom:** `CachingFileExecutionInfoLocation.retrieveIds(...)` assumed a 
non-null selector, resulting in a `NullPointerException` (specifically on 
`selector.startDateFilter()`, `selector.isSelected(Execution)`,
    etc.) and failing the transform.
   
   ---
   
   ## Implemented Fixes
   
   ### 1. Created a Default "Select All" Null Selector
   * **Change:** Added a static final empty selector implementation 
`IExecutionSelector.ALL` inside 
[IExecutionSelector.java](file:///home/matt/git/mattcasters/hop/engine/src/main/java/org/apache/hop/execution/IExecut
   ionSelector.java).
   * **Behavior:** `IExecutionSelector.ALL` returns `true` for all `isSelected` 
checks (matching everything), and returns default `false` or `null` for 
individual filters.
   
   ### 2. Base Location hardening
   * **Change:** Updated 
[BaseCachingExecutionInfoLocation.java](file:///home/matt/git/mattcasters/hop/engine/src/main/java/org/apache/hop/execution/caching/BaseCachingExecutionInfoLocation.java):
     * Replaced the passing of `null` with `IExecutionSelector.ALL` inside 
`getExecutionIds(...)`.
     * Hardened `findExecutionIDs(IExecutionSelector selector)` by introducing 
a null check: `final IExecutionSelector activeSelector = selector == null ? 
IExecutionSelector.ALL : selector;`.
   
   ### 3. Caching File Location null-safety
   * **Change:** Updated 
[CachingFileExecutionInfoLocation.java](file:///home/matt/git/mattcasters/hop/engine/src/main/java/org/apache/hop/execution/caching/CachingFileExecutionInfoLocation.java):
     * Hardened `retrieveIds(...)` by adding a null-safety fallback: `final 
IExecutionSelector activeSelector = selector == null ? IExecutionSelector.ALL : 
selector;`.
     * All downstream selector checks now safely run against `activeSelector`.
   


-- 
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