@Override
        public boolean equals(Object o) {
            if (o == this) return true;
            if ( ! (o instanceof Field)) return false;
            var other = (Field)o;
            if ( ! other.name.equals(this.name)) return false;
            if ( other.type != this.type) return false;
            return true;
        }
Use this, not name() to retrieve the string value of this.
container-search/src/main/java/com/yahoo/search/schema/DocumentSummary.java