Skip to content

Align Java public class names with file names#13

Merged
Nullkernel merged 1 commit intomainfrom
codex/enforce-class-name-and-filename-matching
Apr 5, 2026
Merged

Align Java public class names with file names#13
Nullkernel merged 1 commit intomainfrom
codex/enforce-class-name-and-filename-matching

Conversation

@Nullkernel
Copy link
Copy Markdown
Owner

Motivation

  • Ensure each Java public class matches its .java file stem to follow Java language rules and avoid runtime/IDE/compilation issues.
  • Remove multiple files exposing public class Main which caused duplicate top-level public class names in the trees examples.
  • Keep repository consistent and make the codebase safer for compilation and packaging.

Description

  • Renamed public class identifiers across sorting and searching examples so the class name equals the filename (e.g., DS_*/old names were replaced with Radixsort, Heapsort, Bubblesort, Insertionsort, Selectionsort, Quicksort_Lomuto, Mergesort, Quicksort_Hoare, Shellsort, Binarysearch, Linearsearch, Interpolationsearch, Uniform_binarysearch, etc.).
  • Replaced public class Main in tree examples with AVLTree, BinaryTree, and BinarySearchTree respectively and updated in-file usages/constructors to the new names.
  • Avoided multiple top-level public classes per file by renaming an internal example helper to BinaryTreeStructure and adjusting the main usage so the single public BinaryTree class remains in BinaryTree.java.
  • Per-file edits ensure exactly one top-level public class and that its name equals the file stem for all modified .java files.

Testing

  • Ran a repository-wide regex scan (python - <<'PY' ... pub_pat = re.compile(r'public\s+class\s+...')) to confirm there are no remaining mismatches and the scan returned STATUS OK.
  • Ran the Java compile smoke test script (bash scripts/java_compile_smoke_test.sh) which compiled all Java files and reported success ("Java compile smoke test passed").

Codex Task

@Nullkernel Nullkernel merged commit e74babe into main Apr 5, 2026
1 check passed
@Nullkernel Nullkernel deleted the codex/enforce-class-name-and-filename-matching branch April 6, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant