Skip to content

Commit 12f9c68

Browse files
authored
Name enhanced classes to eliminate collision risk (#238)
1 parent 0fc218a commit 12f9c68

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/nordstrom/automation/selenium/model/Enhanceable.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,12 @@ public <C extends T> C enhanceContainer(final C container) {
119119
matcher = matcher.or(hasMethodName(methodName));
120120
}
121121

122+
// get 8-digit hexadecimal hash code for the fully-qualified class name
123+
String hashCode = String.format("%08X", containerClass.getName().hashCode());
124+
122125
proxyType = (Class<C>) new ByteBuddy()
123126
.subclass(containerClass)
124-
.name(containerClass.getPackage().getName() + ".Enhanced" + containerClass.getSimpleName())
127+
.name(containerClass.getName() + "$$FoundationSynergy$$" + hashCode)
125128
.method(not(matcher))
126129
.intercept(MethodDelegation.to(ContainerMethodInterceptor.INSTANCE))
127130
.implement(Enhanced.class)

src/selenium3/java/com/nordstrom/automation/selenium/utility/RevisedCapabilityMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static Class<?> subclassSafariValidator(Class<?> validatorClass) {
104104
}
105105

106106
/**
107-
* This class implements to {@code apply()} method declared by the {@code Validator} interface. It also implements
107+
* This class implements the {@code apply()} method declared by the {@code Validator} interface. It also implements
108108
* methods to extract Safari-specific settings from specified capabilities maps.
109109
*/
110110
public static class SafariValidator {

0 commit comments

Comments
 (0)