// SPDX-License-Identifier: BSD-2-Clause
package org.xbill.DNS.lookup;

/**
 * Thrown if the lookup results in too many CNAME and/or DNAME indirections. This would be the case
 * for example if two CNAME records point to each other.
 */
public class RedirectOverflowException extends LookupFailedException {
  /** @deprecated do not use, this class is meant for internal dnsjava usage only. */
  @Deprecated
  public RedirectOverflowException(String message) {
    super(message);
  }

  RedirectOverflowException(int maxRedirects) {
    super("Refusing to follow more than " + maxRedirects + " redirects");
  }
}

@@ -65,16 +65,39 @@
 ookup;%0A%0A
+import lombok.Getter;%0A%0A
 /**%0A * T
@@ -330,87 +330,135 @@
 %7B%0A  
-/** @deprecated do not use, this class is meant for internal dnsjava usage only
+@Getter private final int maxRedirects;%0A%0A  /** @deprecated Use %7B@link RedirectOverflowException#RedirectOverflowException(int)%7D
 . */
@@ -551,12 +551,41 @@
 ;%0A  
-%7D%0A%0A 
+  maxRedirects = 0;%0A  %7D%0A%0A  public
  Red
@@ -701,14 +701,52 @@
 ects%22);%0A
+    this.maxRedirects = maxRedirects;%0A
   %7D%0A%7D%0A

Make constructor public for unit testing by library users