Skip to content

fix: guard pluginXml (not its never-null entries list) in CompareFragment2#1385

Draft
joaodinissf wants to merge 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/comparefragment2-pluginxml-guard
Draft

fix: guard pluginXml (not its never-null entries list) in CompareFragment2#1385
joaodinissf wants to merge 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/comparefragment2-pluginxml-guard

Conversation

@joaodinissf
Copy link
Copy Markdown
Collaborator

CompareFragment2.generate() guarded if (projectConfig.eclipsePlugin.pluginXml.entries !== null). But PluginXmlAccess.entries is val List … = newArrayList — final and never null — so the guard is always true (never protects the intended null case) and dereferences pluginXml.entries inside the guard, NPEing when pluginXml itself is null.

Fixed to guard the container pluginXml, matching the adjacent manifest != null guard (line 67) and the superclass ResourceFactoryFragment2 (which this class extends).

Found by a repo-wide inconsistency sweep.

🤖 Generated with Claude Code

…ment2

generate() guarded `if (projectConfig.eclipsePlugin.pluginXml.entries !== null)`,
but `entries` is a final, never-null list, so the guard is always true and never
protects the null-pluginXml case it intends to — and it NPEs on `.entries` when
pluginXml itself is null. Guard the container `pluginXml`, matching the adjacent
manifest guard (line 67) and the superclass ResourceFactoryFragment2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant