<commit_before>package org.axonframework.common.property;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import static org.axonframework.common.ReflectionUtils.fieldsOf;

/**
 * Implementation of PropertyAccessStrategy that scans class hierarchy to get public field named "property"
 */
public class DirectPropertyAccessStrategy extends PropertyAccessStrategy {

	@Override
	protected int getPriority() {
		return -2048;
	}

	@Override
	protected <T> Property<T> propertyFor(Class<? extends T> targetClass, String property) {
		Iterable<Field> fields = fieldsOf(targetClass);
		for(Field field : fields) {
			if (field.getName().equals(property) && ((field.getModifiers() & Modifier.PUBLIC) == Modifier.PUBLIC)) {
				return new DirectlyAccessedProperty<>(field, property);
			}
		}<commit_msg>In case that Messages have only public properties and no getters, we should be able to access values using public properties only.<commit_after>package org.axonframework.common.property;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import static org.axonframework.common.ReflectionUtils.fieldsOf;

/**
 * Implementation of PropertyAccessStrategy that scans class hierarchy to get public field named "property"
 */
public class DirectPropertyAccessStrategy extends PropertyAccessStrategy {

	@Override
	protected int getPriority() {
		return -2048;
	}

	@Override
	protected <T> Property<T> propertyFor(Class<? extends T> targetClass, String property) {
		Iterable<Field> fields = fieldsOf(targetClass);
		for(Field field : fields) {
			if (field.getName().equals(property) && (field.getModifiers() & Modifier.PUBLIC) == Modifier.PUBLIC) {
				return new DirectlyAccessedProperty<>(field, property);
			}
		}
{'fraction_non_alphanumeric': 0.10188895248998282, 'fraction_numerical': 0.0045792787635947334, 'mean_word_length': 5.450184501845018, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '144075', 'n_tokens_mistral': 513, 'n_tokens_neox': 473, 'n_words': 137}