Skip to content

CustomCacheKeyGenerator key generator not hashing class or method names or params #14165

Open
apache/grails-cache
#101
@brucehyslop

Description

@brucehyslop

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;
        } 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions