Skip to content

Mark namespace classes as final with private constructors#13

Merged
Garciat merged 2 commits into
mainfrom
copilot/make-namespace-classes-final
Dec 14, 2025
Merged

Mark namespace classes as final with private constructors#13
Garciat merged 2 commits into
mainfrom
copilot/make-namespace-classes-final

Conversation

Copilot AI commented Dec 14, 2025

Copy link
Copy Markdown
Contributor

Several implementation classes serving as static method containers were missing proper namespace class protections.

Changes

Modified 7 classes to prevent instantiation and inheritance:

  • TypeClasses - Main API entry point
  • ConstructorLookup - Witness rule discovery
  • OverlappingInstances - Instance overlap resolution
  • Unification - Type unification and substitution
  • WitnessInstantiation - Plan compilation and interpretation
  • WitnessResolution - Resolution logic
  • WitnessSummoning - High-level summoning orchestration

Each class now declared final with a private empty constructor, matching the existing pattern in Maps, Functions, and Lists utility classes.

public final class Unification {
  private Unification() {}
  
  public static Maybe<Map<ParsedType.Var, ParsedType>> unify(ParsedType t1, ParsedType t2) {
    // ...
  }
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https src/main/java/com/garciat/typeclasses/impl/WitnessResolution.java src/main/java/com/garciat/typeclasses/impl/WitnessRule.java src/main/java/com/garciat/typeclasses/impl/WitnessSummoning.java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Namespace classes: make them final and private constructor</issue_title>
<issue_description>There are several implementation classes that only serve as namespaces for static methods. They should be marked final and have private and empty constructors.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Garciat <118277+Garciat@users.noreply.github.com>
Copilot AI changed the title [WIP] Make namespace classes final with private constructors Mark namespace classes as final with private constructors Dec 14, 2025
Copilot AI requested a review from Garciat December 14, 2025 12:51
@codecov

codecov Bot commented Dec 14, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.04%. Comparing base (a20633c) to head (e099896).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #13      +/-   ##
============================================
+ Coverage     67.26%   68.04%   +0.77%     
  Complexity      234      234              
============================================
  Files            49       49              
  Lines           611      604       -7     
  Branches         46       46              
============================================
  Hits            411      411              
+ Misses          177      170       -7     
  Partials         23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Garciat Garciat marked this pull request as ready for review December 14, 2025 13:48
@Garciat Garciat merged commit de0c915 into main Dec 14, 2025
3 checks passed
@Garciat Garciat deleted the copilot/make-namespace-classes-final branch December 14, 2025 13:49
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.

Namespace classes: make them final and private constructor

2 participants