From f54d8b3c5271b398b03d49beee0cff83338f7fc6 Mon Sep 17 00:00:00 2001 From: Till Date: Fri, 3 Jan 2025 20:17:32 +0100 Subject: [PATCH] make argument check log more generic --- .../de/tilman_neumann/jml/factor/pollardRho/PollardRho31.java | 2 +- .../tilman_neumann/jml/factor/pollardRho/PollardRhoBrent31.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRho31.java b/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRho31.java index 56682e57..771114e2 100644 --- a/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRho31.java +++ b/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRho31.java @@ -45,7 +45,7 @@ public String getName() { @Override public BigInteger findSingleFactor(BigInteger N) { if (N.bitLength() > 31) { // this check should be negligible in terms of performance - throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but PollardRho31 only supports arguments <= 31 bit"); + throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but " + getName() + " only supports arguments <= 31 bit"); } int factorInt = findSingleFactor(N.intValue()); return BigInteger.valueOf(factorInt); diff --git a/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRhoBrent31.java b/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRhoBrent31.java index fcffd6f6..1a56405a 100644 --- a/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRhoBrent31.java +++ b/src/main/java/de/tilman_neumann/jml/factor/pollardRho/PollardRhoBrent31.java @@ -46,7 +46,7 @@ public String getName() { @Override public BigInteger findSingleFactor(BigInteger N) { if (N.bitLength() > 31) { // this check should be negligible in terms of performance - throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but PollardRho31 only supports arguments <= 31 bit"); + throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but " + getName() + " only supports arguments <= 31 bit"); } int factorInt = findSingleFactor(N.intValue()); return BigInteger.valueOf(factorInt);