Skip to content

fix(java/initialization): EnvironmentAndHubs.java doesn't compile (self-refs EnginePriming) - #220

Open
brianmacy wants to merge 1 commit into
mainfrom
fix-environmentandhubs-instancename
Open

fix(java/initialization): EnvironmentAndHubs.java doesn't compile (self-refs EnginePriming)#220
brianmacy wants to merge 1 commit into
mainfrom
fix-environmentandhubs-instancename

Conversation

@brianmacy

Copy link
Copy Markdown

Bug

java/snippets/initialization/EnvironmentAndHubs.java line 20 self-references a different class:

String instanceName = EnginePriming.class.getSimpleName();  // EnginePriming is neither imported nor defined here

javac against sz-sdk 4.3.4 fails: error: cannot find symbol ... class EnginePriming. It's a copy-paste artifact from the near-identical sibling EnginePriming.java.

Fix

One line: EnginePriming.classEnvironmentAndHubs.class. Sibling snippets (PurgeRepository, InitDefaultConfig, RegisterDataSources) already self-reference correctly.

Provenance

Reported via the Senzing MCP server (#mcp-logging, 2026-08-27) — generate_scaffold(language='java', workflow='initialize') delivers this snippet, so the malformed file reaches every consumer of that workflow until this lands.

…nstanceName

EnvironmentAndHubs.java line 20 self-referenced EnginePriming.class (a different
class, neither imported nor defined here), so it failed to compile:
  error: cannot find symbol  EnginePriming.class.getSimpleName()
A copy-paste artifact from the sibling EnginePriming.java. Fixed to
EnvironmentAndHubs.class.getSimpleName(). Reported via the Senzing MCP server
(#mcp-logging, 2026-08-27), verified against sz-sdk 4.3.4.
@brianmacy
brianmacy requested a review from a team as a code owner August 28, 2026 14:19
@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review

Review Summary

Change: java/snippets/initialization/EnvironmentAndHubs.java:20 — fixes a copy-paste bug where instanceName was derived from EnginePriming.class.getSimpleName() instead of EnvironmentAndHubs.class.getSimpleName().

Checklist

  • Code Quality: ✅ Correct fix, matches the pattern used consistently in sibling files (EnginePriming.java:20, PurgeRepository.java:51, each using their own class name). No style, naming, or DRY issues.
  • Defects: ✅ This is the defect fix — the instance name is purely descriptive/informational (used in logging), so the bug had no functional impact beyond misleading log output, but the fix is correct.
  • Testing: N/A — one-line string correction in an educational snippet; no new logic requiring tests.
  • Documentation: N/A — no README/API/CHANGELOG impact.
  • Security: ✅ No credentials, no input validation concerns, no license files, nothing sensitive.
  • CLAUDE.md: Not modified by this diff; existing project config is already generic and not local-environment-specific.

No issues found — this is a clean, minimal, correct fix.

Automated code review analyzing defects and coding standards

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.

2 participants