<commit_before>/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.component.irc;

import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.apache.camel.RuntimeCamelException;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
import org.apache.camel.spi.UriPath;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
import org.apache.camel.util.jsse.SSLContextParameters;
import org.schwering.irc.lib.ssl.SSLDefaultTrustManager;
import org.schwering.irc.lib.ssl.SSLTrustManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@UriParams
public class IrcConfiguration implements Cloneable {
    private static final Logger LOG = LoggerFactory.getLogger(IrcConfiguration.class);

    private boolean usingSSL;
    private List<IrcChannel> channels = new ArrayList<IrcChannel>();

    @UriPath @Metadata(required = "true")
    private String hostname;
    @UriPath
    private int port;
    private int[] ports = {6667, 6668, 6669};
    @UriParam(label = "security", secret = true)
    private String password;
    @UriParam
    private String nickname;
    @UriParam
    private String realname;
    @UriParam(label = "security", secret = true)
    private String username;
    @UriParam(label = "security")
    private SSLTrustManager trustManager = new SSLDefaultTrustManager();
    @UriParam(defaultValue = "true")
    @Deprecated
    private boolean persistent = true;
    @UriParam(defaultValue = "true", label = "advanced")
    private boolean colors = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onNick = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onQuit = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onJoin = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onKick = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onMode = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onPart = true;
    @UriParam(label = "filter")
    private boolean onReply;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onTopic = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onPrivmsg = true;
    @UriParam(defaultValue = "true")
    private boolean autoRejoin = true;
    @UriParam
    private boolean namesOnJoin;
    @UriParam(label = "security")
    private SSLContextParameters sslContextParameters;
    @UriParam(label = "security", secret = true)
    private String nickPassword;

    public IrcConfiguration() {
    }

    public IrcConfiguration(String hostname, String nickname, String displayname, List<IrcChannel> channels) {
        this(hostname, null, null, nickname, displayname, channels);
    }

    public IrcConfiguration(String hostname, String username, String password, String nickname, String displayname, List<IrcChannel> channels) {
        this.channels = channels;
        this.hostname = hostname;
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.realname = displayname;
    }

    public IrcConfiguration copy() {
        try {
            return (IrcConfiguration) clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeCamelException(e);
        }
    }

    public String getCacheKey() {
        return hostname + ":" + nickname;
    }

    /*
     * Return space separated list of channel names without pwd
     */
    public String getListOfChannels() {
        String retval = "";
        for (IrcChannel channel : channels) {
            retval += (retval.isEmpty() ? "" : " ") + channel.getName();
        }
        return retval;
    }
<commit_msg>Fix the problem of using '+' and '+=' operators to concatenate strings in a loop.<commit_after>/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.component.irc;

import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.apache.camel.RuntimeCamelException;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
import org.apache.camel.spi.UriPath;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.URISupport;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
import org.apache.camel.util.jsse.SSLContextParameters;
import org.schwering.irc.lib.ssl.SSLDefaultTrustManager;
import org.schwering.irc.lib.ssl.SSLTrustManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@UriParams
public class IrcConfiguration implements Cloneable {
    private static final Logger LOG = LoggerFactory.getLogger(IrcConfiguration.class);

    private boolean usingSSL;
    private List<IrcChannel> channels = new ArrayList<IrcChannel>();

    @UriPath @Metadata(required = "true")
    private String hostname;
    @UriPath
    private int port;
    private int[] ports = {6667, 6668, 6669};
    @UriParam(label = "security", secret = true)
    private String password;
    @UriParam
    private String nickname;
    @UriParam
    private String realname;
    @UriParam(label = "security", secret = true)
    private String username;
    @UriParam(label = "security")
    private SSLTrustManager trustManager = new SSLDefaultTrustManager();
    @UriParam(defaultValue = "true")
    @Deprecated
    private boolean persistent = true;
    @UriParam(defaultValue = "true", label = "advanced")
    private boolean colors = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onNick = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onQuit = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onJoin = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onKick = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onMode = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onPart = true;
    @UriParam(label = "filter")
    private boolean onReply;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onTopic = true;
    @UriParam(defaultValue = "true", label = "filter")
    private boolean onPrivmsg = true;
    @UriParam(defaultValue = "true")
    private boolean autoRejoin = true;
    @UriParam
    private boolean namesOnJoin;
    @UriParam(label = "security")
    private SSLContextParameters sslContextParameters;
    @UriParam(label = "security", secret = true)
    private String nickPassword;

    public IrcConfiguration() {
    }

    public IrcConfiguration(String hostname, String nickname, String displayname, List<IrcChannel> channels) {
        this(hostname, null, null, nickname, displayname, channels);
    }

    public IrcConfiguration(String hostname, String username, String password, String nickname, String displayname, List<IrcChannel> channels) {
        this.channels = channels;
        this.hostname = hostname;
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.realname = displayname;
    }

    public IrcConfiguration copy() {
        try {
            return (IrcConfiguration) clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeCamelException(e);
        }
    }

    public String getCacheKey() {
        return hostname + ":" + nickname;
    }

    /*
     * Return space separated list of channel names without pwd
     */
    public String getListOfChannels() {
        StringBuilder retval = new StringBuilder();
        for (IrcChannel channel : channels) {
            retval.append(retval.length() == 0 ? "" : " ").append(channel.getName());
        }
        return retval.toString();
    }

{'fraction_non_alphanumeric': 0.09772450223486388, 'fraction_numerical': 0.0037586347013409183, 'mean_word_length': 3.61340206185567, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3637895', 'n_tokens_mistral': 2748, 'n_tokens_neox': 2695, 'n_words': 838}