grails-cache icon indicating copy to clipboard operation
grails-cache copied to clipboard

CustomCacheKeyGenerator key generator not hashing class or method names or params

Open brucehyslop opened this issue 4 years ago • 0 comments

The compilation of CustomCacheKeyGenerator.groovy CacheKey.hashCode() and TemporaryGrailsCacheKey.hashCode() implementation into bytecode ignores the targetClassName, targetMethodName & simpleKey

decompiled bytecode:

        public int hashCode() {
            int prime = 31;
            int result = 1;
            int var3 = prime * result;
            boolean var10000;
            if (this.simpleKey == null) {
                var10000 = false;
            } else {
                this.simpleKey.hashCode();
            }

            int var4 = prime * var3;
            if (this.targetClassName == null) {
                var10000 = false;
            } else {
                this.targetClassName.hashCode();
            }

            int var5 = prime * var4;
            if (this.targetMethodName == null) {
                var10000 = false;
            } else {
                this.targetMethodName.hashCode();
            }

            int var6 = prime * var5 + this.targetObjectHashCode;
            return var6;
        } 

brucehyslop avatar Nov 19 '21 05:11 brucehyslop