<commit_before>package io.strimzi.controller.cluster.resources;

import io.fabric8.kubernetes.api.model.ObjectReference;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.openshift.api.model.BinaryBuildSource;
import io.fabric8.openshift.api.model.Build;
import io.fabric8.openshift.api.model.BuildConfig;
import io.fabric8.openshift.api.model.BuildConfigBuilder;
import io.fabric8.openshift.api.model.BuildConfigList;
import io.fabric8.openshift.api.model.BuildTriggerPolicy;
import io.fabric8.openshift.api.model.DoneableBuildConfig;
import io.fabric8.openshift.api.model.DoneableImageStream;
import io.fabric8.openshift.api.model.ImageChangeTrigger;
import io.fabric8.openshift.api.model.ImageLookupPolicyBuilder;
import io.fabric8.openshift.api.model.ImageStream;
import io.fabric8.openshift.api.model.ImageStreamBuilder;
import io.fabric8.openshift.api.model.ImageStreamList;
import io.fabric8.openshift.api.model.TagReference;
import io.fabric8.openshift.client.OpenShiftClient;
import io.fabric8.openshift.client.dsl.BuildConfigResource;
import io.strimzi.controller.cluster.operations.resource.AbstractOperations;
import io.strimzi.controller.cluster.operations.resource.BuildConfigOperations;
import io.strimzi.controller.cluster.operations.resource.ImageStreamOperations;
import io.vertx.core.json.JsonObject;

import java.util.Map;

/**
 * Represents S2I upgrade on top of the regular resource
 */
public class Source2Image {
    private final String name;
    private final String namespace;
    private final String sourceImage;
    private final String tag;
    private final String targetImage;
    protected Map<String, String> labels;

    // Annotations
    public static String ANNOTATION_S2I = "s2i";
    public static String ANNOTATION_RESOLVE_NAMES = "alpha.image.policy.openshift.io/resolve-names";

    // Keys to config JSON
    private static String KEY_SOURCE_IMAGE = "sourceImage";
    public static String KEY_ENABLED = "enabled";

    // Default values
    private static String DEFAULT_SOURCE_IMAGE = "strimzi/kafka-connect-s2i:latest";

    /**
     * Full constructor
     *
     * @param namespace     OpenShift project
     * @param name          Name od the Source2Image resources (should be the KafkaConnectResource name)
     * @param labels        Maps with labels
     * @param sourceImage   Name of the source Docker image
     */
    public Source2Image(String namespace, String name, Map<String, String> labels, String sourceImage) {
        this.name = name;
        this.namespace = namespace;
        this.labels = labels;
        this.sourceImage = sourceImage.substring(0, sourceImage.lastIndexOf(":"));
        this.tag = sourceImage.substring(sourceImage.lastIndexOf(":") + 1);
        this.targetImage = name;<commit_msg>Findbugs: These fields can be final<commit_after>package io.strimzi.controller.cluster.resources;

import io.fabric8.kubernetes.api.model.ObjectReference;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.openshift.api.model.BinaryBuildSource;
import io.fabric8.openshift.api.model.Build;
import io.fabric8.openshift.api.model.BuildConfig;
import io.fabric8.openshift.api.model.BuildConfigBuilder;
import io.fabric8.openshift.api.model.BuildConfigList;
import io.fabric8.openshift.api.model.BuildTriggerPolicy;
import io.fabric8.openshift.api.model.DoneableBuildConfig;
import io.fabric8.openshift.api.model.DoneableImageStream;
import io.fabric8.openshift.api.model.ImageChangeTrigger;
import io.fabric8.openshift.api.model.ImageLookupPolicyBuilder;
import io.fabric8.openshift.api.model.ImageStream;
import io.fabric8.openshift.api.model.ImageStreamBuilder;
import io.fabric8.openshift.api.model.ImageStreamList;
import io.fabric8.openshift.api.model.TagReference;
import io.fabric8.openshift.client.OpenShiftClient;
import io.fabric8.openshift.client.dsl.BuildConfigResource;
import io.strimzi.controller.cluster.operations.resource.AbstractOperations;
import io.strimzi.controller.cluster.operations.resource.BuildConfigOperations;
import io.strimzi.controller.cluster.operations.resource.ImageStreamOperations;
import io.vertx.core.json.JsonObject;

import java.util.Map;

/**
 * Represents S2I upgrade on top of the regular resource
 */
public class Source2Image {
    private final String name;
    private final String namespace;
    private final String sourceImage;
    private final String tag;
    private final String targetImage;
    protected Map<String, String> labels;

    // Annotations
    public static final String ANNOTATION_S2I = "s2i";
    public static final String ANNOTATION_RESOLVE_NAMES = "alpha.image.policy.openshift.io/resolve-names";

    // Keys to config JSON
    private static final String KEY_SOURCE_IMAGE = "sourceImage";
    public static final String KEY_ENABLED = "enabled";

    // Default values
    private static String DEFAULT_SOURCE_IMAGE = "strimzi/kafka-connect-s2i:latest";

    /**
     * Full constructor
     *
     * @param namespace     OpenShift project
     * @param name          Name od the Source2Image resources (should be the KafkaConnectResource name)
     * @param labels        Maps with labels
     * @param sourceImage   Name of the source Docker image
     */
    public Source2Image(String namespace, String name, Map<String, String> labels, String sourceImage) {
        this.name = name;
        this.namespace = namespace;
        this.labels = labels;
        this.sourceImage = sourceImage.substring(0, sourceImage.lastIndexOf(":"));
        this.tag = sourceImage.substring(sourceImage.lastIndexOf(":") + 1);
        this.targetImage = name;
{'fraction_non_alphanumeric': 0.092605758976182, 'fraction_numerical': 0.009598293636686812, 'mean_word_length': 4.338709677419355, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, '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': '7254426', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1608, 'n_words': 350}