Skip to content

Add Java-idiomatic camelCase aliases for core geometry helpers#28

Closed
Copilot wants to merge 2 commits intomasterfrom
copilot/refactor-to-java-idiomatic
Closed

Add Java-idiomatic camelCase aliases for core geometry helpers#28
Copilot wants to merge 2 commits intomasterfrom
copilot/refactor-to-java-idiomatic

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

This port intentionally retained many C#-style public APIs; this change starts smoothing that edge by exposing Java-idiomatic method names in core geometry types while preserving existing behavior. The update is intentionally narrow and backward-compatible.

  • Core API ergonomics (non-breaking aliases)

    • Added camelCase aliases in Rect64:
      • asPath, isEmpty, isValid, midPoint, contains(...), intersects(...)
    • Added camelCase aliases in RectD:
      • asPath, isEmpty, midPoint, contains(...), intersects(...)
    • Added camelCase alias in PointD:
      • negate
  • Compatibility model

    • Existing PascalCase methods remain unchanged and continue to be the canonical implementations.
    • New camelCase methods delegate directly to the existing methods to avoid behavioral drift.
  • Documentation alignment

    • Updated README “Port Info” note to clarify:
      • Clipper static methods remain PascalCase
      • core geometry types now expose Java-style camelCase aliases.
  • Focused coverage for alias parity

    • Added TestJavaIdiomaticAliases to assert that each new alias returns the same result as its PascalCase counterpart.
Rect64 rect = new Rect64(0, 0, 10, 10);

// Existing API
boolean a = rect.IsEmpty();

// Java-idiomatic alias (same behavior)
boolean b = rect.isEmpty();

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: micycle1 <9304234+micycle1@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor project to enhance Java idiomatic usage Add Java-idiomatic camelCase aliases for core geometry helpers Mar 3, 2026
@micycle1 micycle1 closed this Mar 3, 2026
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