Skip to content

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

Merged
brianmacy merged 1 commit into
mainfrom
fix-environmentandhubs-instancename
Aug 31, 2026
Merged

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

Conversation

@brianmacy

Copy link
Copy Markdown
Contributor

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.

@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

…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 force-pushed the fix-environmentandhubs-instancename branch from 06feef8 to deb8fbd Compare August 31, 2026 17:24
@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review

Review Summary

Change: java/snippets/initialization/EnvironmentAndHubs.java:20 — fixes instanceName to use EnvironmentAndHubs.class.getSimpleName() instead of the copy-pasted EnginePriming.class.getSimpleName().

Code Quality

  • ✅ Style/naming/idioms: consistent with the rest of the file.
  • ✅ No commented-out code.
  • ✅ Meaningful variable names.
  • ✅ DRY: n/a (single-line fix).
  • ✅ Defects: this is the defect fix — confirmed correct. Checked sibling snippets (PurgeRepository.java:51, EnginePriming.java:20) and both follow the <ClassName>.class.getSimpleName() convention, so this change now matches the established pattern instead of misidentifying itself as EnginePriming in Senzing engine logs/diagnostics.
  • ✅ CLAUDE.md: no changes to project config in this diff.

Testing

  • N/A — one-line string fix with no new logic, branches, or edge cases. No tests exist for these example snippets elsewhere in the repo either, consistent with the "educational example" nature of the code.

Documentation

  • ✅ No README/API doc/CHANGELOG.md updates needed for this fix.
  • N/A markdown formatting — no .md files touched.

Security

  • ✅ No hardcoded credentials.
  • ✅ No input validation concerns (static class name string).
  • ✅ No error handling changes.
  • ✅ No sensitive data in logs.
  • ✅ No .lic files or AQAAAD-prefixed strings present in this diff.

Verdict: Correct, minimal, well-scoped fix. No issues found.

Automated code review analyzing defects and coding standards

@brianmacy
brianmacy enabled auto-merge (squash) August 31, 2026 17:25
@brianmacy
brianmacy merged commit de6b82b into main Aug 31, 2026
62 checks passed
@brianmacy
brianmacy deleted the fix-environmentandhubs-instancename branch August 31, 2026 17:33
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