From 5dc01127c073923824c2202db1f1c85ea502a074 Mon Sep 17 00:00:00 2001 From: Joe Schmetzer Date: Sun, 17 Nov 2024 13:48:20 +1100 Subject: [PATCH] Restore public constructors for compatibility (#428) Restore public constructors for compatibility CoreMatchers, MatcherAssert, and Matchers had private contructors added to fix javadoc warnings. Unfortunately, this can break existig users of the classes. Fixes #427 --- CHANGES.md | 4 +++- hamcrest/src/main/java/org/hamcrest/CoreMatchers.java | 5 ++++- hamcrest/src/main/java/org/hamcrest/MatcherAssert.java | 5 ++++- hamcrest/src/main/java/org/hamcrest/Matchers.java | 5 ++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 367812e1..851be4dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,7 +25,9 @@ these methods will need to be updated. The following methods are affected: ### Improvements -* Javadoc improvements and cleanup ([PR #420](https://github.com/hamcrest/JavaHamcrest/pull/420)) +* Javadoc improvements and cleanup ([PR #420](https://github.com/hamcrest/JavaHamcrest/pull/420), +[#427](https://github.com/hamcrest/JavaHamcrest/issues/427), +[PR #428](https://github.com/hamcrest/JavaHamcrest/pull/428)) * Derive version from git tags ([PR #419](https://github.com/hamcrest/JavaHamcrest/pull/419)) * Migrate all tests to JUnit Jupiter ([PR #424](https://github.com/hamcrest/JavaHamcrest/pull/424)) diff --git a/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java b/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java index 6dadcc52..f00a6e54 100644 --- a/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java +++ b/hamcrest/src/main/java/org/hamcrest/CoreMatchers.java @@ -13,7 +13,10 @@ @SuppressWarnings("UnusedDeclaration") public class CoreMatchers { - private CoreMatchers() { + /** + * Unused + */ + public CoreMatchers() { } /** diff --git a/hamcrest/src/main/java/org/hamcrest/MatcherAssert.java b/hamcrest/src/main/java/org/hamcrest/MatcherAssert.java index 574f4f61..29d3364e 100644 --- a/hamcrest/src/main/java/org/hamcrest/MatcherAssert.java +++ b/hamcrest/src/main/java/org/hamcrest/MatcherAssert.java @@ -6,7 +6,10 @@ */ public class MatcherAssert { - private MatcherAssert() { + /** + * Unused. + */ + public MatcherAssert() { } /** diff --git a/hamcrest/src/main/java/org/hamcrest/Matchers.java b/hamcrest/src/main/java/org/hamcrest/Matchers.java index 714777c2..dcc88366 100644 --- a/hamcrest/src/main/java/org/hamcrest/Matchers.java +++ b/hamcrest/src/main/java/org/hamcrest/Matchers.java @@ -22,7 +22,10 @@ @SuppressWarnings({"unused", "WeakerAccess"}) public class Matchers { - private Matchers() { + /** + * Unused + */ + public Matchers() { } /**