Allow macos to have vhd/x as a supported file type#7990
Conversation
remove check if a mac to not add virtual machine extensions.
Change deprecated methods to supported methods
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughModified ImageDSProcessor to unconditionally enable virtual machine support detection (previously gated to non-macOS systems) and refactored password defaulting logic from StringUtils to Objects utility methods, while updating associated imports. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PMD (7.23.0)Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java[ERROR] Cannot load ruleset rulesets/java/basic.xml/SimplifiedTernary: Cannot resolve rule/ruleset reference 'rulesets/java/basic.xml/SimplifiedTernary'. Make sure the resource is a valid file or URL and is on the CLASSPATH. Use --debug (or a fine log level) to see the current classpath. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java (1)
580-588: Consider applying the same null-defaulting pattern here for consistency.Lines 215, 325, and 548 use
Objects.toString(password, this.password)to preserve the existing password when the parameter isnull. However, line 587 uses direct assignmentthis.password = password;, which would overwrite any existing password withnull.If this difference is intentional (e.g., this method should explicitly clear the password when
nullis passed), consider adding a comment to clarify. Otherwise, applying the same pattern would ensure consistent behavior across all entry points.♻️ Suggested change for consistency
public IngestStream processWithIngestStream(String deviceId, Path dataSourcePath, String password, Host host, IngestJobSettings settings, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) { // this method does not use the config panel this.deviceId = deviceId; this.imagePath = dataSourcePath.toString(); this.sectorSize = 0; this.timeZone = Calendar.getInstance().getTimeZone().getID(); this.host = host; - this.password = password; + this.password = Objects.toString(password, this.password); this.ignoreFatOrphanFiles = false;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java` around lines 580 - 588, The processWithIngestStream method currently assigns this.password = password which will overwrite an existing password with null; change it to use the same null-defaulting pattern used elsewhere (e.g., Objects.toString(password, this.password)) so that a null parameter preserves the existing this.password, or add a clarifying comment in processWithIngestStream if the intent is to explicitly clear the password; locate the password assignment in processWithIngestStream and update it to the Objects.toString(...) pattern (or comment the explicit-null behavior).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java`:
- Around line 580-588: The processWithIngestStream method currently assigns
this.password = password which will overwrite an existing password with null;
change it to use the same null-defaulting pattern used elsewhere (e.g.,
Objects.toString(password, this.password)) so that a null parameter preserves
the existing this.password, or add a clarifying comment in
processWithIngestStream if the intent is to explicitly clear the password;
locate the password assignment in processWithIngestStream and update it to the
Objects.toString(...) pattern (or comment the explicit-null behavior).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b3bc1427-bd4f-4a62-9b1f-1d2e4da2cc04
📒 Files selected for processing (1)
Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java
Summary by CodeRabbit
Improvements
Chores