Last active
December 11, 2015 06:18
-
-
Save YannRobert/4557761 to your computer and use it in GitHub Desktop.
Patch proposal for linkedin/glu#196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/utils/org.linkedin.glu.utils/src/main/java/org/linkedin/glu/utils/core/DisabledFeatureProxy.java | |
+++ b/utils/org.linkedin.glu.utils/src/main/java/org/linkedin/glu/utils/core/DisabledFeatureProxy.java | |
@@ -39,6 +39,14 @@ public class DisabledFeatureProxy implements InvocationHandler | |
@Override | |
public Object invoke(Object o, Method method, Object[] objects) throws Throwable | |
{ | |
- throw new DisabledFeatureException(_feature); | |
+ final String methodName = method.getName(); | |
+ if (methodName.equals("hashCode") && method.getParameterTypes().length == 0) { | |
+ return o.hashCode(); | |
+ } else { | |
+ if (methodName.equals("equals") && method.getParameterTypes().length == 1) { | |
+ return o.equals(objects[0]); | |
+ } | |
+ throw new DisabledFeatureException(_feature); | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support for https://github.com/linkedin/glu/issues/196