<commit_before>package org.monospark.spongematchers.type;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;

import org.monospark.spongematchers.matcher.SpongeMatcher;
import org.monospark.spongematchers.matcher.complex.MapMatcher;
import org.monospark.spongematchers.parser.SpongeMatcherParseException;
import org.monospark.spongematchers.parser.element.MapElement;
import org.monospark.spongematchers.parser.element.StringElement;

import com.google.common.collect.Sets;

public final class UndefinedMapType extends MatcherType<Map<String,Object>> {

    private Set<MatcherType<?>> types;
    
    private UndefinedMapType(Set<MatcherType<?>> types) {
        super("map");
        this.types = types;
    }

    @Override
    public boolean canMatch(Object o) {
        if (!(o instanceof Map)) {
            return false;
        }
        
        Map<?,?> map = (Map<?, ?>) o;
        for (Entry<?,?> entry : map.entrySet()) {
            if (!(entry.getKey() instanceof String)) {
                return false;
            }
            
            Object value = entry.getValue();
            for (MatcherType<?> type : types) {
                if (type.canMatch(value)) {
                    continue;
                }
            }<commit_msg>Fix a bug in the UndefinedMapType's canMatch method<commit_after>package org.monospark.spongematchers.type;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;

import org.monospark.spongematchers.matcher.SpongeMatcher;
import org.monospark.spongematchers.matcher.complex.MapMatcher;
import org.monospark.spongematchers.parser.SpongeMatcherParseException;
import org.monospark.spongematchers.parser.element.MapElement;
import org.monospark.spongematchers.parser.element.StringElement;

import com.google.common.collect.Sets;

public final class UndefinedMapType extends MatcherType<Map<String,Object>> {

    private Set<MatcherType<?>> types;
    
    private UndefinedMapType(Set<MatcherType<?>> types) {
        super("map");
        this.types = types;
    }

    @Override
    public boolean canMatch(Object o) {
        if (!(o instanceof Map)) {
            return false;
        }
        
        Map<?,?> map = (Map<?, ?>) o;
        out: for (Entry<?,?> entry : map.entrySet()) {
            if (!(entry.getKey() instanceof String)) {
                return false;
            }
            
            Object value = entry.getValue();
            for (MatcherType<?> type : types) {
                if (type.canMatch(value)) {
                    continue out;
                }
            }
{'fraction_non_alphanumeric': 0.11508085746521249, 'fraction_numerical': 0.0, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6036579', 'n_tokens_mistral': 789, 'n_tokens_neox': 762, 'n_words': 153}