<commit_before>package pl.grzeslowski.jsupla.server.serializers;

import pl.grzeslowski.jsupla.protocol.Proto;
import pl.grzeslowski.jsupla.protocol.structs.sd.SuplaRegisterDeviceResult;
import pl.grzeslowski.jsupla.server.entities.responses.Response;
import pl.grzeslowski.jsupla.server.entities.responses.register_device.RegisterDeviceResponse;

import static java.lang.String.format;

public class SerializersFactoryImpl implements SerializersFactory {
    private final Serializer<RegisterDeviceResponse, SuplaRegisterDeviceResult> registerDeviceResponseSerializer = new RegisterDeviceResponseSerializer();

    @SuppressWarnings("unchecked")
    @Override
    public <Rsp extends Response> Serializer<Rsp, ? extends Proto> getSerializerForResponse(Rsp response) {
        if (response instanceof RegisterDeviceResponse) {
            return (Serializer<Rsp, ? extends Proto>) registerDeviceResponseSerializer;
        }

        throw new IllegalArgumentException(format("Can't find serializer for class %s!", response.getClass().getSimpleName()));
    }
}<commit_msg>`Method type name 'Rq' must match pattern '(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)'.	7  Method type name 'Rsp' must match pattern '(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)'.`<commit_after>package pl.grzeslowski.jsupla.server.serializers;

import pl.grzeslowski.jsupla.protocol.Proto;
import pl.grzeslowski.jsupla.protocol.structs.sd.SuplaRegisterDeviceResult;
import pl.grzeslowski.jsupla.server.entities.responses.Response;
import pl.grzeslowski.jsupla.server.entities.responses.register_device.RegisterDeviceResponse;

import static java.lang.String.format;

public class SerializersFactoryImpl implements SerializersFactory {
    private final Serializer<RegisterDeviceResponse, SuplaRegisterDeviceResult> registerDeviceResponseSerializer = new RegisterDeviceResponseSerializer();

    @SuppressWarnings("unchecked")
    @Override
    public <ResponseT extends Response> Serializer<ResponseT, ? extends Proto> getSerializerForResponse(ResponseT response) {
        if (response instanceof RegisterDeviceResponse) {
            return (Serializer<ResponseT, ? extends Proto>) registerDeviceResponseSerializer;
        }

        throw new IllegalArgumentException(format("Can't find serializer for class %s!", response.getClass().getSimpleName()));
    }
}
{'fraction_non_alphanumeric': 0.10643776824034334, 'fraction_numerical': 0.0038626609442060085, 'mean_word_length': 5.815789473684211, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7325431', 'n_tokens_mistral': 677, 'n_tokens_neox': 674, 'n_words': 124}