Skip to content

Commit

Permalink
#770: Rearrange fields and extract default to string to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamas Balog committed Mar 24, 2019
1 parent 6840cd8 commit 17f97f1
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@ public abstract class AbstractLocatorHandler<T> implements InvocationHandler, Lo
private static final Method TO_STRING = getMethod(Object.class, "toString");
private static final Method EQUALS = getMethod(Object.class, "equals", Object.class);
private static final Method HASH_CODE = getMethod(Object.class, "hashCode");
private static final String DEFAULT_LAZY_ELEMENT_TO_STRING = "Lazy Element";

private static final int MAX_RETRY = 5;
private static final int HASH_CODE_SEED = 2048;

private final List<ProxyElementListener> listeners = new ArrayList<>();

protected final ElementLocator locator;

protected HookChainBuilder hookChainBuilder;
protected List<HookDefinition<?>> hookDefinitions;

private final List<ProxyElementListener> listeners = new ArrayList<>();
protected List<FluentHook> hooks;

protected T proxy;
protected final ElementLocator locator;
protected T result;

protected List<FluentHook> hooks;
Expand Down Expand Up @@ -280,7 +283,15 @@ private Object invoke(Method method, Object[] args) throws Throwable {
// Unwrap the underlying exception
throw e.getCause();
}
return returnValue;
}

/**
* Get string representation of not already found element.
*
* @return string representation of not already found element
*/
protected String getLazyToString() {
return DEFAULT_LAZY_ELEMENT_TO_STRING;
}
//CHECKSTYLE.ON: IllegalThrows

Expand Down

0 comments on commit 17f97f1

Please sign in to comment.