<commit_before>package tech.harmonysoft.oss.traute.javac.text;

import org.jetbrains.annotations.NotNull;
import tech.harmonysoft.oss.traute.javac.instrumentation.method.ReturnToInstrumentInfo;

public class DefaultReturnExceptionTextGenerator implements ExceptionTextGenerator<ReturnToInstrumentInfo> {

    @NotNull
    @Override
    public String generate(@NotNull ReturnToInstrumentInfo context) {
        return String.format("Detected an attempt to return null from a method marked by %s",
                             context.getNotNullAnnotation()
        );
    }
}<commit_msg>Issue #69: Show method name in the failed 'return' check<commit_after>package tech.harmonysoft.oss.traute.javac.text;

import org.jetbrains.annotations.NotNull;
import tech.harmonysoft.oss.traute.javac.instrumentation.method.ReturnToInstrumentInfo;

public class DefaultReturnExceptionTextGenerator implements ExceptionTextGenerator<ReturnToInstrumentInfo> {

    @NotNull
    @Override
    public String generate(@NotNull ReturnToInstrumentInfo context) {
        return String.format("Detected an attempt to return null from a method marked by %s (%s())",
                             context.getNotNullAnnotation(), context.getQualifiedMethodName());
    }
}
{'fraction_non_alphanumeric': 0.07939053728949479, 'fraction_numerical': 0.0016038492381716118, 'mean_word_length': 4.243697478991597, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3115787', 'n_tokens_mistral': 326, 'n_tokens_neox': 316, 'n_words': 75}