Input:
import java.sql.SQLException;
import java.util.Optional;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import org.flywaydb.core.Flyway;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.*;
import org.springframework.retry.RetryContext;
import org.springframework.retry.backoff.NoBackOffPolicy;
import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.retry.support.RetryTemplate;
import com.netflix.conductor.postgres.dao.PostgresExecutionDAO;
import com.netflix.conductor.postgres.dao.PostgresIndexDAO;
import com.netflix.conductor.postgres.dao.PostgresMetadataDAO;
import com.netflix.conductor.postgres.dao.PostgresQueueDAO;
import com.fasterxml.jackson.databind.ObjectMapper;

Context:
persistence/postgres-persistence/src/main/java/com/netflix/conductor/postgres/config/PostgresConfiguration.java
/*
 *

 * Licensed 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 com.netflix.conductor.postgres.config;

@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(PostgresProperties.class)
@ConditionalOnProperty(name = "conductor.db.type", havingValue = "postgres")
// Import the DataSourceAutoConfiguration when postgres database is selected.
// By default, the datasource configuration is excluded in the main module.
@Import(DataSourceAutoConfiguration.class)
public class PostgresConfiguration {

    DataSource dataSource;

    private final PostgresProperties properties;

    public PostgresConfiguration(DataSource dataSource, PostgresProperties properties) {
        this.dataSource = dataSource;
        this.properties = properties;
    }

    @Bean(initMethod = "migrate")
    @PostConstruct
    public Flyway flywayForPrimaryDb() {
        return Flyway.configure()
                .locations("classpath:db/migration_postgres")
                .schemas(properties.getSchema())
                .dataSource(dataSource)
                .baselineOnMigrate(true)
                .load();
    }

    @Bean
    @DependsOn({"flywayForPrimaryDb"})
    public PostgresMetadataDAO postgresMetadataDAO(
            @Qualifier("postgresRetryTemplate") RetryTemplate retryTemplate,
            ObjectMapper objectMapper,
            PostgresProperties properties) {
        return new PostgresMetadataDAO(retryTemplate, objectMapper, dataSource, properties);
    }

    @Bean
    @DependsOn({"flywayForPrimaryDb"})
    public PostgresExecutionDAO postgresExecutionDAO(
            @Qualifier("postgresRetryTemplate") RetryTemplate retryTemplate,
            ObjectMapper objectMapper) {
        return new PostgresExecutionDAO(retryTemplate, objectMapper, dataSource);
    }

    @Bean
    @DependsOn({"flywayForPrimaryDb"})
    public PostgresQueueDAO postgresQueueDAO(
            @Qualifier("postgresRetryTemplate") RetryTemplate retryTemplate,
            ObjectMapper objectMapper) {

persistence/postgres-persistence/src/main/java/com/netflix/conductor/postgres/dao/PostgresQueueDAO.java
public class PostgresQueueDAO extends PostgresBaseDAO implements QueueDAO {

    private static final Long UNACK_SCHEDULE_MS = 60_000L;

    private final ScheduledExecutorService scheduledExecutorService;

    public PostgresQueueDAO(
            RetryTemplate retryTemplate, ObjectMapper objectMapper, DataSource dataSource) {
        super(retryTemplate, objectMapper, dataSource);

        this.scheduledExecutorService =
                Executors.newSingleThreadScheduledExecutor(
                        ExecutorsUtil.newNamedThreadFactory("postgres-queue-"));
        this.scheduledExecutorService.scheduleAtFixedRate(
                this::processAllUnacks,
                UNACK_SCHEDULE_MS,
                UNACK_SCHEDULE_MS,
                TimeUnit.MILLISECONDS);
        logger.debug("{} is ready to serve", PostgresQueueDAO.class.getName());
    }

    @PreDestroy
    public void destroy() {
        try {
            this.scheduledExecutorService.shutdown();
            if (scheduledExecutorService.awaitTermination(30, TimeUnit.SECONDS)) {
                logger.debug("tasks completed, shutting down");
            } else {
                logger.warn("Forcing shutdown after waiting for 30 seconds");
                scheduledExecutorService.shutdownNow();
            }
        } catch (InterruptedException ie) {
            logger.warn(
                    "Shutdown interrupted, invoking shutdownNow on scheduledExecutorService for processAllUnacks",
                    ie);
            scheduledExecutorService.shutdownNow();
            Thread.currentThread().interrupt();
        }
    }

    @Override
    public void push(String queueName, String messageId, long offsetTimeInSecond) {
        push(queueName, messageId, 0, offsetTimeInSecond);
    }

    @Override
    public void push(String queueName, String messageId, int priority, long offsetTimeInSecond) {
        withTransaction(
                tx -> pushMessage(tx, queueName, messageId, null, priority, offsetTimeInSecond));
    }

    @Override
    public void push(String queueName, List<Message> messages) {
        withTransaction(
                tx ->
                        messages.forEach(
                                message ->
                                        pushMessage(
                                                tx,
                                                queueName,
                                                message.getId(),
                                                message.getPayload(),
                                                message.getPriority(),
                                                0)));
    }

    @Override
    public boolean pushIfNotExists(String queueName, String messageId, long offsetTimeInSecond) {
        return pushIfNotExists(queueName, messageId, 0, offsetTimeInSecond);
    }

    @Override
    public boolean pushIfNotExists(
            String queueName, String messageId, int priority, long offsetTimeInSecond) {
        return getWithRetriedTransactions(
                tx -> {
                    if (!existsMessage(tx, queueName, messageId)) {
                        pushMessage(tx, queueName, messageId, null, priority, offsetTimeInSecond);
                        return true;
                    }
                    return false;
                });
    }

    @Override
    public List<String> pop(String queueName, int count, int timeout) {
        return pollMessages(queueName, count, timeout).stream()
                .map(Message::getId)
                .collect(Collectors.toList());
    }

    @Override
    public List<Message> pollMessages(String queueName, int count, int timeout) {
        if (timeout < 1) {
            List<Message> messages =
                    getWithTransactionWithOutErrorPropagation(
                            tx -> popMessages(tx, queueName, count, timeout));
            if (messages == null) {
                return new ArrayList<>();
            }
            return messages;
        }

        long start = System.currentTimeMillis();
        final List<Message> messages = new ArrayList<>();

        while (true) {
            List<Message> messagesSlice =
                    getWithTransactionWithOutErrorPropagation(
                            tx -> popMessages(tx, queueName, count - messages.size(), timeout));
            if (messagesSlice == null) {
                logger.warn(
                        "Unable to poll {} messages from {} due to tx conflict, only {} popped",
                        count,
                        queueName,
                        messages.size());
                // conflict could have happened, returned messages popped so far
                return messages;
            }

            messages.addAll(messagesSlice);
            if (messages.size() >= count || ((System.currentTimeMillis() - start) > timeout)) {
                return messages;
            }
            Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
        }
    }

    @Override
    public void remove(String queueName, String messageId) {
        withTransaction(tx -> removeMessage(tx, queueName, messageId));
    }

    @Override
    public int getSize(String queueName) {
        final String GET_QUEUE_SIZE = "SELECT COUNT(*) FROM queue_message WHERE queue_name = ?";
        return queryWithTransaction(
                GET_QUEUE_SIZE, q -> ((Long) q.addParameter(queueName).executeCount()).intValue());
    }

    @Override
    public boolean ack(String queueName, String messageId) {
        return getWithRetriedTransactions(tx -> removeMessage(tx, queueName, messageId));
    }

    @Override
    public boolean setUnackTimeout(String queueName, String messageId, long unackTimeout) {
        long updatedOffsetTimeInSecond = unackTimeout / 1000;

        final String UPDATE_UNACK_TIMEOUT =
                "UPDATE queue_message SET offset_time_seconds = ?, deliver_on = (current_timestamp + (? ||' seconds')::interval) WHERE queue_name = ? AND message_id = ?";

        return queryWithTransaction(
                        UPDATE_UNACK_TIMEOUT,
                        q ->
                                q.addParameter(updatedOffsetTimeInSecond)
                                        .addParameter(updatedOffsetTimeInSecond)
                                        .addParameter(queueName)
                                        .addParameter(messageId)
                                        .executeUpdate())
                == 1;
    }

    @Override
    public void flush(String queueName) {
        final String FLUSH_QUEUE = "DELETE FROM queue_message WHERE queue_name = ?";
        executeWithTransaction(FLUSH_QUEUE, q -> q.addParameter(queueName).executeDelete());
    }

    @Override
    public Map<String, Long> queuesDetail() {
        final String GET_QUEUES_DETAIL =
                "SELECT queue_name, (SELECT count(*) FROM queue_message WHERE popped = false AND queue_name = q.queue_name) AS size FROM queue q FOR SHARE SKIP LOCKED";
        return queryWithTransaction(
                GET_QUEUES_DETAIL,
                q ->
                        q.executeAndFetch(
                                rs -> {
                                    Map<String, Long> detail = Maps.newHashMap();
                                    while (rs.next()) {
                                        String queueName = rs.getString("queue_name");
                                        Long size = rs.getLong("size");
                                        detail.put(queueName, size);
                                    }
                                    return detail;
                                }));
    }

    @Override
    public Map<String, Map<String, Map<String, Long>>> queuesDetailVerbose() {
        // @formatter:off
        final String GET_QUEUES_DETAIL_VERBOSE =
                "SELECT queue_name, \n"
                        + "       (SELECT count(*) FROM queue_message WHERE popped = false AND queue_name = q.queue_name) AS size,\n"
                        + "       (SELECT count(*) FROM queue_message WHERE popped = true AND queue_name = q.queue_name) AS uacked \n"
                        + "FROM queue q FOR SHARE SKIP LOCKED";
        // @formatter:on

        return queryWithTransaction(
                GET_QUEUES_DETAIL_VERBOSE,
                q ->
                        q.executeAndFetch(
                                rs -> {
                                    Map<String, Map<String, Map<String, Long>>> result =
                                            Maps.newHashMap();
                                    while (rs.next()) {
                                        String queueName = rs.getString("queue_name");
                                        Long size = rs.getLong("size");
                                        Long queueUnacked = rs.getLong("uacked");
                                        result.put(
                                                queueName,
                                                ImmutableMap.of(
                                                        "a",
                                                        ImmutableMap
                                                                .of( // sharding not implemented,
                                                                        // returning only
                                                                        // one shard with all the
                                                                        // info
                                                                        "size",
                                                                        size,
                                                                        "uacked",
                                                                        queueUnacked)));
                                    }
                                    return result;
                                }));
    }

    /**
     * Un-pop all un-acknowledged messages for all queues.
     *
     * @since 1.11.6
     */
    public void processAllUnacks() {
        logger.trace("processAllUnacks started");

        getWithRetriedTransactions(
                tx -> {
                    String LOCK_TASKS =
                            "SELECT queue_name, message_id FROM queue_message WHERE popped = true AND (deliver_on + (60 ||' seconds')::interval)  <  current_timestamp limit 1000 FOR UPDATE SKIP LOCKED";

                    List<QueueMessage> messages =
                            query(
                                    tx,
                                    LOCK_TASKS,
                                    p ->
                                            p.executeAndFetch(
                                                    rs -> {
                                                        List<QueueMessage> results =
                                                                new ArrayList<QueueMessage>();
                                                        while (rs.next()) {
                                                            QueueMessage qm = new QueueMessage();
                                                            qm.queueName =
                                                                    rs.getString("queue_name");
                                                            qm.messageId =
                                                                    rs.getString("message_id");
                                                            results.add(qm);
                                                        }
                                                        return results;
                                                    }));

                    if (messages.size() == 0) {
                        return 0;
                    }

                    Map<String, List<String>> queueMessageMap = new HashMap<String, List<String>>();
                    for (QueueMessage qm : messages) {
                        if (!queueMessageMap.containsKey(qm.queueName)) {
                            queueMessageMap.put(qm.queueName, new ArrayList<String>());
                        }
                        queueMessageMap.get(qm.queueName).add(qm.messageId);
                    }

                    int totalUnacked = 0;
                    for (String queueName : queueMessageMap.keySet()) {
                        Integer unacked = 0;
                        ;
                        try {
                            final List<String> msgIds = queueMessageMap.get(queueName);
                            final String UPDATE_POPPED =
                                    String.format(
                                            "UPDATE queue_message SET popped = false WHERE queue_name = ? and message_id IN (%s)",
                                            Query.generateInBindings(msgIds.size()));

                            unacked =
                                    query(
                                            tx,
                                            UPDATE_POPPED,
                                            q ->
                                                    q.addParameter(queueName)
                                                            .addParameters(msgIds)
                                                            .executeUpdate());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        totalUnacked += unacked;
                        logger.debug("Unacked {} messages from all queues", unacked);
                    }

                    if (totalUnacked > 0) {
                        logger.debug("Unacked {} messages from all queues", totalUnacked);
                    }
                    return totalUnacked;
                });
    }

    @Override
    public void processUnacks(String queueName) {
        final String PROCESS_UNACKS =
                "UPDATE queue_message SET popped = false WHERE queue_name = ? AND popped = true AND (current_timestamp - (60 ||' seconds')::interval)  > deliver_on";
        executeWithTransaction(PROCESS_UNACKS, q -> q.addParameter(queueName).executeUpdate());
    }

    @Override
    public boolean resetOffsetTime(String queueName, String messageId) {
        long offsetTimeInSecond = 0; // Reset to 0
        final String SET_OFFSET_TIME =
                "UPDATE queue_message SET offset_time_seconds = ?, deliver_on = (current_timestamp + (? ||' seconds')::interval) \n"
                        + "WHERE queue_name = ? AND message_id = ?";

        return queryWithTransaction(
                SET_OFFSET_TIME,
                q ->
                        q.addParameter(offsetTimeInSecond)
                                        .addParameter(offsetTimeInSecond)
                                        .addParameter(queueName)
                                        .addParameter(messageId)
                                        .executeUpdate()
                                == 1);
    }

    private boolean existsMessage(Connection connection, String queueName, String messageId) {
        final String EXISTS_MESSAGE =
                "SELECT EXISTS(SELECT 1 FROM queue_message WHERE queue_name = ? AND message_id = ?) FOR SHARE";
        return query(
                connection,
                EXISTS_MESSAGE,
                q -> q.addParameter(queueName).addParameter(messageId).exists());
    }

    private void pushMessage(
            Connection connection,
            String queueName,
            String messageId,
            String payload,
            Integer priority,
            long offsetTimeInSecond) {

        createQueueIfNotExists(connection, queueName);

        String UPDATE_MESSAGE =
                "UPDATE queue_message SET payload=?, deliver_on=(current_timestamp + (? ||' seconds')::interval) WHERE queue_name = ? AND message_id = ?";
        int rowsUpdated =
                query(
                        connection,
                        UPDATE_MESSAGE,
                        q ->
                                q.addParameter(payload)
                                        .addParameter(offsetTimeInSecond)
                                        .addParameter(queueName)
                                        .addParameter(messageId)
                                        .executeUpdate());

        if (rowsUpdated == 0) {
            String PUSH_MESSAGE =
                    "INSERT INTO queue_message (deliver_on, queue_name, message_id, priority, offset_time_seconds, payload) VALUES ((current_timestamp + (? ||' seconds')::interval), ?,?,?,?,?) ON CONFLICT (queue_name,message_id) DO UPDATE SET payload=excluded.payload, deliver_on=excluded.deliver_on";
            execute(
                    connection,
                    PUSH_MESSAGE,
                    q ->
                            q.addParameter(offsetTimeInSecond)
                                    .addParameter(queueName)
                                    .addParameter(messageId)
                                    .addParameter(priority)
                                    .addParameter(offsetTimeInSecond)
                                    .addParameter(payload)
                                    .executeUpdate());
        }
    }

    private boolean removeMessage(Connection connection, String queueName, String messageId) {
        final String REMOVE_MESSAGE =
                "DELETE FROM queue_message WHERE queue_name = ? AND message_id = ?";
        return query(
                connection,
                REMOVE_MESSAGE,
                q -> q.addParameter(queueName).addParameter(messageId).executeDelete());
    }

    private List<Message> peekMessages(Connection connection, String queueName, int count) {
        if (count < 1) {
            return Collections.emptyList();
        }

        final String PEEK_MESSAGES =
                "SELECT message_id, priority, payload FROM queue_message WHERE queue_name = ? AND popped = false AND deliver_on <= (current_timestamp + (1000 ||' microseconds')::interval) ORDER BY priority DESC, deliver_on, created_on LIMIT ? FOR UPDATE SKIP LOCKED";

        return query(
                connection,
                PEEK_MESSAGES,
                p ->
                        p.addParameter(queueName)
                                .addParameter(count)
                                .executeAndFetch(
                                        rs -> {
                                            List<Message> results = new ArrayList<>();
                                            while (rs.next()) {
                                                Message m = new Message();
                                                m.setId(rs.getString("message_id"));
                                                m.setPriority(rs.getInt("priority"));
                                                m.setPayload(rs.getString("payload"));
                                                results.add(m);
                                            }
                                            return results;
                                        }));
    }

    private List<Message> popMessages(
            Connection connection, String queueName, int count, int timeout) {
        List<Message> messages = peekMessages(connection, queueName, count);

        if (messages.isEmpty()) {
            return messages;
        }

        List<Message> poppedMessages = new ArrayList<>();
        for (Message message : messages) {
            final String POP_MESSAGE =
                    "UPDATE queue_message SET popped = true WHERE queue_name = ? AND message_id = ? AND popped = false";
            int result =
                    query(
                            connection,
                            POP_MESSAGE,
                            q ->
                                    q.addParameter(queueName)
                                            .addParameter(message.getId())
                                            .executeUpdate());

            if (result == 1) {
                poppedMessages.add(message);
            }
        }
        return poppedMessages;
    }

    @Override
    public boolean containsMessage(String queueName, String messageId) {
        return getWithRetriedTransactions(tx -> existsMessage(tx, queueName, messageId));
    }

    private void createQueueIfNotExists(Connection connection, String queueName) {
        logger.trace("Creating new queue '{}'", queueName);
        final String EXISTS_QUEUE =
                "SELECT EXISTS(SELECT 1 FROM queue WHERE queue_name = ?) FOR SHARE";
        boolean exists = query(connection, EXISTS_QUEUE, q -> q.addParameter(queueName).exists());
        if (!exists) {
            final String CREATE_QUEUE =
                    "INSERT INTO queue (queue_name) VALUES (?) ON CONFLICT (queue_name) DO NOTHING";
            execute(connection, CREATE_QUEUE, q -> q.addParameter(queueName).executeUpdate());
        }
    }

    private class QueueMessage {
        public String queueName;
        public String messageId;
    }
}

Answer: return new PostgresQueueDAO(retryTemplate, objectMapper, dataSource);

<think>
The method postgresQueueDAO is a Spring @Bean that should create and return a PostgresQueueDAO instance. Looking at the similar bean methods above, they each return a new DAO constructed with the provided retryTemplate, objectMapper, and the dataSource field of the configuration class. Therefore the next line should be the return statement constructing the PostgresQueueDAO with those arguments.
</think>
return new PostgresQueueDAO(retryTemplate, objectMapper, dataSource);


Input:
import com.ispirer.sw.types.PictureType;
import com.ispirer.sw.types.StructureModel;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.util.List;

Context:
IspirerFramework/com/ispirer/sw/strings/StringUtil.java
/*
	© 2021, Ispirer Systems OÜ. All rights reserved.
	NOTICE OF LICENSE
	This file\library is Ispirer Reusable Code (“IRC”) and you are granted a non-exclusive, worldwide, perpetual, irrevocable and fully paid up license to use, modify, adapt, sublicense and otherwise exploit this IRC as provided below and under the terms of Ispirer Systems OÜ. Reusable Code License Agreement (“License”), which can be found in supplementary LICENSE.txt file. By using this IRC, you acknowledge that you have read the License and agree with its terms as well as with the fact that IRC is the property of and belongs to Ispirer Systems OÜ only.
	IF YOU ARE NOT AGREE WITH THE TERMS OF THE LICENSE, PLEASE, STOP USING THIS IRC IMMEDIATELY!
	PLEASE, NOTE, THAT IRC IS DISTRIBUTED “AS IS” AND WITHOUT ANY WARRANTY. IN NO EVENT WILL ISPIRER BE LIABLE FOR ANY DAMAGES, CLAIMS OR COSTS WHATSOEVER OR ANY CONSEQUENTIAL, INDIRECT, INCIDENTAL DAMAGES, OR ANY LOST PROFITS OR LOST SAVINGS.
	Redistributions of this IRC must retain the above copyright notice and a list of significant changes made to this IRC with indication of its author(s) and date of changes.
	If you need more information, or you think that the License has been violated, please let us know by e-mail: legal.department@ispirer.com
*/
package com.ispirer.sw.strings;

public class StringUtil {

	/**
	 * replases searchString to replacement in the str first time
	 *
	 * @param str
	 * @param searchString
	 * @param replacement
	 * @return result of replacing
	 */
	public static String replaceLeading(String str, String searchString, String replacement) {
		if (str.indexOf(searchString) == 0) {
			String newStr = "";
			while (str.indexOf(searchString) == 0) {
				newStr += str.substring(0, searchString.length());
				str = str.substring(searchString.length(), str.length());
			}
			newStr = newStr.replaceAll(searchString, replacement);
			return newStr + str;
		}
		return str;
	}

	public static Integer tallyingLeading(String str, String searchString) {
		Integer res = 0;
		while (str.indexOf(searchString) == 0) {
			res++;
			str = str.substring(searchString.length());
		}
		return res;
	}

	/**
	 * fills List variable by String value
	 *
	 * @param array to fill
	 * @param str   to fill by
	 * @return filled list
	 */
	public static List<?> initializeArray(List<?> array, String str) {
		Object firstel = array.get(0);
		int sizeOneVariable = 0;
		if (firstel instanceof StructureModel) {
			sizeOneVariable = ((StructureModel) firstel).getSize();
		} else if (firstel instanceof PictureType) {
			sizeOneVariable = ((PictureType<?>) firstel).getSize();
		}

		if (str.length() < sizeOneVariable * array.size()) {
			str = str + StringUtils.repeat(" ", sizeOneVariable * array.size() - str.length());
		}
		for (int i = 0; i < array.size(); i++) {
			if (firstel instanceof StructureModel) {
				((StructureModel) array.get(i))
						.setData(str.substring(i * sizeOneVariable, (i + 1) * sizeOneVariable).toCharArray());
			} else if (firstel instanceof PictureType) {
				((PictureType<?>) array.get(i)).setValue(str.substring(i * sizeOneVariable, (i + 1) * sizeOneVariable));
			}
		}
		return array;
	}

	public static List<Object> initializeArray(List<Object> array, String str, int size) {
		Object firstel = array.get(0);
		if (str.length() < size * array.size()) {
			str = str + StringUtils.repeat(" ", size * array.size() - str.length());
		}
		for (int i = 0; i < array.size(); i++) {
			if (firstel instanceof String) {
				array.set(i, str.substring(i * size, (i + 1) * size));
			} else if (firstel instanceof Integer) {
				array.set(i, Integer.parseInt(str.substring(i * size, (i + 1) * size)));
			} else if (firstel instanceof BigDecimal) {
				array.set(i, new BigDecimal(str.substring(i * size, (i + 1) * size)));
			} else if (firstel instanceof Long) {
				array.set(i, Long.parseLong(str.substring(i * size, (i + 1) * size)));
			}
		}
		return array;
	}

	/**
	 * fills array by DefaultValue
	 *
	 * @param array to fill
	 * @param str   DefaultValue object
	 * @return
	 */
	public static List<?> initializeArray(List<?> array, PictureType.DefaultValue str) {
		Object firstel = array.get(0);
		for (int i = 0; i < array.size(); i++) {
			if (firstel instanceof StructureModel) {

IspirerFramework/com/ispirer/sw/types/StructureModel.java
public abstract class StructureModel {

	protected List<StructureModel> redefobjs = new ArrayList<>();
	protected List<StructureModel> prevReds = new ArrayList<>();
	protected Boolean isRed = false;

	protected void initRedefineObjs(StructureModel... objs) {
		if (objs.length > 0) {
			redefobjs.addAll(Arrays.asList(objs));
			if (objs[0] != null) {
				objs[0].setPrevRed(this);
				isRed = true;
				setData(objs[0].toString().toCharArray());
				isRed = false;
			}
		}
	}

	private void setPrevRed(StructureModel prevRed) {
		this.prevReds.add(prevRed);
	}

	protected String getArrayString(List<?> models) {
		String result = "";
		for (Object model : models) {
			result = result.concat(model.toString());
		}
		return result;
	}

	protected String getArrayString(List<?> models, Integer index) {
		String result = "";
		for (int i = 0; i < index; i++) {
			result = result.concat(models.get(i).toString());
		}
		return result;
	}

	protected String repeat(String par, int size) {
		return StringUtils.repeat(par, size);
	}

	/**
	 * creates array of strings from array of chars. it collect chars to strings
	 * using length in size array
	 *
	 * @param data  char array to collect into strings
	 * @param sizes sizes of resulting strings
	 * @return
	 */
	public String[] getStringValues(char[] data, int[] sizes) {
		String[] result = new String[sizes.length];
		for (int i = 0; i < sizes.length; i++) {
			StringBuilder tmp = new StringBuilder();
			for (int j = 0; j < ((data.length < sizes[i]) ? data.length : sizes[i]) && data.length > 0; j++) {
				tmp.append(data[j]);
			}
			data = new String(data, ((data.length < sizes[i]) ? data.length : sizes[i]),
					data.length - ((data.length < sizes[i]) ? data.length : sizes[i])).toCharArray();
			result[i] = sizes[i] > tmp.length() ? tmp.toString() + StringUtils.repeat(" ", sizes[i] - tmp.length())
					: tmp.toString();
		}
		return result;
	}

	/**
	 * creates correct array of bytes Cuts useless or add usefull bytes
	 *
	 * @param data byte array to correct
	 * @return corrected byte array
	 */
	public byte[] getFullArray(byte[] data) {
		byte[] result = new byte[getSize()];
		for (int i = 0; i < result.length; i++) {
			result[i] = data.length > i ? data[i] : 32;
		}
		return result;
	}

	/**
	 * creates array from string. splits string by size
	 *
	 * @param data
	 * @param size
	 * @return array of splitted strings
	 */
	public String[] getArrayValues(String data, int size) {
		String[] result = new String[size];
		int pieceLength = data.length() / size;
		int offset = 0;
		for (int i = 0; i < size; i++) {
			result[i] = data.substring(offset, pieceLength * (i + 1));
			offset += pieceLength;
		}
		return result;
	}

	protected void redefine() {
		// if (prevReds != null && !prevReds.getRed()) {
		if (prevReds.size() > 0) {
			for (StructureModel obj : prevReds) {
				if (!obj.getRed()) {
					redefine(obj);
				}
			}
		}
		if (redefobjs.size() > 0) {
			if (redefobjs.get(0) != null) {
				if (!redefobjs.get(0).getRed()) {
					redefine(redefobjs.get(0));
				}
			}
			for (int i = 1; i < redefobjs.size(); i++) {
				if (redefobjs.get(i) != null) {
					if (!redefobjs.get(i).getRed()) {
						redefobjs.get(i).redefine();
					}
				}
			}
		}
	}

	protected void redefineDef(PictureType.DefaultValue defaultValue) {
//        if (prevReds != null && !prevReds.getRed()) {
//            redefineDef(prevReds, defaultValue);
//            return;
//        }
		if (prevReds.size() > 0) {
			for (StructureModel obj : prevReds) {
				if (obj != null && !obj.getRed()) {
					redefineDef(obj, defaultValue);
				}
			}
		}
		for (StructureModel obj : redefobjs) {
			redefineDef(obj, defaultValue);
		}
	}

	void redefineDef(StructureModel obj, PictureType.DefaultValue defaultValue) {
		setRed(true);
		obj.setDefaultValue(defaultValue);
		setRed(false);
	}

	protected void redefine(StructureModel obj) {
		if (obj.getRed()) {
			return;
		}
		String data = "";
		if ((obj.toString().length() >= this.toString().toCharArray().length) && !(this instanceof IntField)) {
			data = this.toString() + obj.toString().substring(this.toString().toCharArray().length);
		} else {
			data = this.toString();
		}
		if (obj instanceof StrField
				&& (this instanceof IntField || this instanceof LongField || this instanceof BigDecimalField)) {
			setRed(true);
			if (this instanceof IntField) {
				obj.setData(((IntField) this).value);
			} else if (this instanceof LongField) {
				obj.setData(((LongField) this).value);
			} else {
				obj.setData(((BigDecimalField) this).value);

			}
			setRed(false);
		} else {
			setRed(true);
			obj.setData(data.toCharArray());
			setRed(false);

		}
	}

	/**
	 * set data from PT variable
	 *
	 * @param var PT variable
	 */
	public void setData(PictureType<?> var) {
		if (var.hasDefVal && (var.compareTo(Spaces) == 0 || var.compareTo(HighValues) == 0
				|| var.compareTo(LowValues) == 0 || var.compareTo(Zeroes) == 0)) {
			setDefaultValue(var.getDefValue());
			return;
		}
		setData(var.toString().toCharArray());
		redefine();
	}

	public abstract String toString();

	public abstract void setData(char[] data);

	public abstract void setData(String[] data);

	public abstract int getSize();

	public abstract void initialize();

	public abstract byte[] toFile();

	public abstract void setDataFromFile(byte[] bytes);

	public abstract void setDefaultValue(PictureType.DefaultValue value);

	// next methods implements compareTo licics with different types
	/**
	 * implements compareTo logic with DefaultValue
	 *
	 * @param value DefaultValue to compare
	 * @return result of comparison
	 */
	public int compareTo(PictureType.DefaultValue value) {
		switch (value) {
		case Spaces:
		case HighValues:
			return toString().replaceAll("[+-.,/ ]", "").equals("") ? 0 : 1;
		case Zeroes:
			try {
				return new BigInteger(toString().replaceAll("[ +-.,]", "").trim()).compareTo(new BigInteger("0"));
			} catch (NumberFormatException e) {
				return -1;
			}

		case LowValues:
			return toString().equals("") ? 0 : 1;
		case Quotes:
			return toString().compareTo(StringUtils.repeat("\"", getSize()));
		}
		return 0;
	}

	/**
	 * implements compareTo logic with PT
	 *
	 * @param value PT variable
	 * @return result of comparison
	 */
	public int compareTo(PictureType<?> value) {
		return value.compareTo(this) * -1;
	}

	/**
	 * implements compareTo logic with other structure
	 *
	 * @param value structure variable
	 * @return result of comparison
	 */
	public int compareTo(StructureModel value) {
		return compareTo(value.toString());
	}

	/**
	 * implements compareTo logic with int variable
	 *
	 * @param value int variable
	 * @return result of comparison
	 */
	public int compareTo(int value) {
		int res = toString().trim().compareTo(String.valueOf(value));
		if (res > 0) {
			return 1;
		} else if (res < 0) {
			return -1;
		} else {
			return 0;
		}
	}

	/**
	 * implements compareTo logic with String variable
	 *
	 * @param value String variable
	 * @return result of comparison
	 */
	public int compareTo(String value) {
		int res = toString().trim().compareTo(value);
		if (res > 0) {
			return 1;
		} else if (res < 0) {
			return -1;
		} else {
			return 0;
		}
	}

	protected StructureModel[] extendArray(StructureModel[] array, StructureModel... addElements) {
		ArrayList<StructureModel> redList;
		redList = new ArrayList<>(Arrays.asList(array));
		if (!redList.isEmpty()) {
			redList.remove(0);
		}
		for (StructureModel element : addElements) {
			redList.add(0, element);
		}
		return redList.toArray(array);
	}

	private Boolean getRed() {
		return isRed;
	}

	private void setRed(Boolean red) {
		isRed = red;
	}
}

Answer: ((StructureModel) array.get(i)).setDefaultValue(str);

<think>
The method initializeArray(List<?> array, PictureType.DefaultValue str) is meant to fill a list with a default value. The code already retrieved the first element to determine the type and started a loop. The next step is handling the case where the elements are StructureModel instances, which have a setDefaultValue method that accepts a PictureType.DefaultValue. Therefore the next line should set the default value for each StructureModel element in the list.
</think>
((StructureModel) array.get(i)).setDefaultValue(str);


Input:
import io.github.f4pl0.companydata.CompanyData;
import io.github.f4pl0.config.ConfigInjector;
import io.github.f4pl0.config.IEXCloudConfig;
import io.github.f4pl0.equitiesmarketdata.EquitiesMarketData;
import io.github.f4pl0.historicaldata.HistoricalData;
import io.github.f4pl0.reference.Reference;

Context:
src/main/java/io/github/f4pl0/IEXCloudClient.java
package io.github.f4pl0;

/**
 * The IEXCloudClient is the main entry point for the IEX Cloud API.
 * You will need to set the publishable token before building the client.
 */
public class IEXCloudClient {
    public final EquitiesMarketData equitiesMarketData;
    private final Reference reference;
    private final CompanyData companyData;
    private final HistoricalData historicalData;

    /**
     * Create a new IEXCloudClient.
     * @param config
     */
    private IEXCloudClient(IEXCloudConfig config) {
        ConfigInjector.injectIEXConfiguration(IEXHttpClient.getInstance(), config);
        equitiesMarketData = new EquitiesMarketData();
        reference = new Reference();
        companyData = new CompanyData();
        historicalData = new HistoricalData();
    }

    public Reference fetchReferenceData() {
        return this.reference;
    }

    public CompanyData fetchCompanyData() {
        return this.companyData;
    }

    public HistoricalData fetchHistoricalData() {
        return this.historicalData;
    }

    /**
     * Builder for the IEXCloudClient.
     * You will need to set the publishable token before building the client.
     */
    public static class IEXCloudClientBuilder {
        private String publishableToken;
        private String secretToken;
        private String baseEndpoint = "https://api.iex.cloud/v1";

        /**
         * Set the publishable token for the IEXCloudClient.
         * @param publishableToken The IEX Cloud publishable token.
         * @return The IEXCloudClientBuilder object.
         */
        public IEXCloudClientBuilder setPublishableToken(String publishableToken) {
            this.publishableToken = publishableToken;
            return this;
        }

        /**
         * Set the secret token for the IEXCloudClient.
         * @param secretToken The IEX Cloud secret token.
         * @return The IEXCloudClientBuilder object.
         */
        public IEXCloudClientBuilder setSecretToken(String secretToken) {
            this.secretToken = secretToken;
            return this;
        }

        /**
         * Set the base endpoint for the IEXCloudClient.
         * @param baseEndpoint The IEX Cloud base endpoint.
         * @return The IEXCloudClientBuilder object.
         */
        public IEXCloudClientBuilder setBaseEndpoint(String baseEndpoint) {
            this.baseEndpoint = baseEndpoint;
            return this;
        }

        /**
         * Build the IEXCloudClient object.
         * @return The IEXCloudClient object.
         * @throws IllegalArgumentException If the publishable token is not set.
         */
        public IEXCloudClient build() {
            // Validate the builder
            if (publishableToken == null || publishableToken.isEmpty()) {
                throw new IllegalArgumentException("Publishable token must be set");
            }

            IEXCloudConfig config = new IEXCloudConfig();
            config.setPublishableToken(publishableToken);
            config.setSecretToken(secretToken);
            config.setBaseEndpoint(baseEndpoint);

src/main/java/io/github/f4pl0/historicaldata/HistoricalData.java
public class HistoricalData {
    private final IEXHttpClient httpClient = IEXHttpClient.getInstance();
    private final ObjectMapper mapper = new ObjectMapper();

    /**
     * Historical Equity Prices
     *
     *

     *     Returns daily, end of day split adjusted, dividend + split adjusted, and unadjusted equity prices since 2005
     *     for the U.S. and over 100 international exchanges.
     *

     *
     * @see IEX Cloud API
     * @param symbol The stock symbol.
     * @param range The date range.
     * @param limit The number of results to return. Defaults to 1. Ignored if range is {@link DateRange#YEAR_TO_DATE}.
     * @throws IOException If the request fails.
     * @return A list of {@link IEXHistoricalEquityPrice} objects.
     */
    public List<IEXHistoricalEquityPrice> historicalEquityPrices(
            @NonNull String symbol,
            @NonNull DateRange range,
            int limit
            ) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        String requestUri = "/data/core/historical_prices/" + encodedSymbol;

        if (range == DateRange.YEAR_TO_DATE) {
            requestUri += "?range=" + range.toString();
        } else if (limit < 1) {
            requestUri += "?range=1" + range.toString();
        } else {
            requestUri += "?range=" + limit + range.toString();
        }

        CloseableHttpResponse response = httpClient.execute(requestUri);

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXHistoricalEquityPrice.class));
    }

    // TODO: Add technical indicators endpoint
}

src/main/java/io/github/f4pl0/equitiesmarketdata/EquitiesMarketData.java
public class EquitiesMarketData {
    private final IEXHttpClient httpClient = IEXHttpClient.getInstance();
    private final ObjectMapper mapper = new ObjectMapper();

    /**
     * IEX Depth of Book (DEEP)
     *
     *

     *     DEEP is used to receive real-time depth of book quotations direct from IEX. The depth of book quotations
     *     received via DEEP provide an aggregated size of resting displayed orders at a price and side, and do not
     *     indicate the size or number of individual orders at any price level. Non-displayed orders and non-displayed
     *     portions of reserve orders are not represented in DEEP.
     *

     *
     *

     *     DEEP also provides last trade price and size information. Trades resulting from either displayed or
     *     non-displayed orders matching on IEX will be reported. Routed executions will not be reported.
     *

     *
     * @see IEX Cloud API
     * @param symbol The stock symbol to get the DEEP data for.
     * @return The DEEP data for the given stock symbol.
     * @throws IOException If the request fails.
     */
    public IEXDEEP getDEEP(@NonNull String symbol) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute("/data/core/iex_deep/" + encodedSymbol);

        List<IEXDEEP> data = mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXDEEP.class));

        return data.get(0);
    }

    /**
     * IEX Depth of Book (DEEP)
     *
     *

     *     DEEP is used to receive real-time depth of book quotations direct from IEX. The depth of book quotations
     *     received via DEEP provide an aggregated size of resting displayed orders at a price and side, and do not
     *     indicate the size or number of individual orders at any price level. Non-displayed orders and non-displayed
     *     portions of reserve orders are not represented in DEEP.
     *

     *
     *

     *     DEEP also provides last trade price and size information. Trades resulting from either displayed or
     *     non-displayed orders matching on IEX will be reported. Routed executions will not be reported.
     *

     *
     * @see IEX Cloud API
     * @param symbols The stock symbols to get the DEEP data for.
     * @return The DEEP data for the given stock symbols.
     * @throws IOException If the request fails.
     */
    public List<IEXDEEP> getDEEP(@NonNull String[] symbols) throws IOException {
        List<String> encodedSymbols = new ArrayList<>(symbols.length);
        for (String symbol : symbols) {
            encodedSymbols.add(URLEncoder.encode(symbol, StandardCharsets.UTF_8));
        }
        String joinedSymbols = String.join(",", encodedSymbols);
        CloseableHttpResponse response = httpClient.execute("/data/core/iex_deep/" + joinedSymbols);

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXDEEP.class));
    }

    /**
     * Intraday Equity Prices
     *
     *

     *     Aggregated intraday prices in n-minute buckets for the current day, where n is 10 minutes or 30 minutes,
     *     depending on the range you specify.
     *

     *
     * @see IEX Cloud API
     * @param symbol The stock symbol to get the intraday prices for.
     * @return The intraday prices for the given stock symbol.
     * @throws IOException If the request fails.
     */
    public List<IEXIntradayEquityPrice> getIntradayPrices(@NonNull String symbol) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute("/data/core/intraday-prices/" + encodedSymbol);

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXIntradayEquityPrice.class));
    }
    // TODO: Add intraday prices for multiple symbols. and support for the range parameter.
    // TODO: Finish the rest of the endpoints.

}

src/main/java/io/github/f4pl0/config/ConfigInjector.java
public class ConfigInjector {

    @SneakyThrows(IllegalAccessException.class)
    public static void injectIEXConfiguration(Object instance, IEXCloudConfig config) {
        Class<?> clazz = instance.getClass();

        for (Field field : clazz.getDeclaredFields()) {
            if (field.isAnnotationPresent(IEXConfiguration.class)) {
                field.setAccessible(true);
                field.set(instance, config);
            }
        }
    }
}

src/main/java/io/github/f4pl0/config/IEXCloudConfig.java
@Data
public class IEXCloudConfig {
    private String publishableToken;
    private String secretToken;
    private String baseEndpoint;
}

src/main/java/io/github/f4pl0/companydata/CompanyData.java
public class CompanyData {
    private final IEXHttpClient httpClient = IEXHttpClient.getInstance();
    private final ObjectMapper mapper = new ObjectMapper();

    /**
     * Company Information
     *
     *
Latest snapshot of public company information such as address, number of employees, CEO, and description.

     *
     * @see IEX Cloud API
     * @param symbol Company symbol.
     * @throws IOException If the request fails.
     * @return A {@link io.github.f4pl0.companydata.data.IEXCompanyData} object.
     */
    public IEXCompanyData companyData(@NonNull String symbol) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute("/data/core/company/" + encodedSymbol);

        List<IEXCompanyData> data = mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXCompanyData.class));

        return data.get(0);
    }

    /**
     * Company Information
     *
     *
Latest snapshot of public company information such as address, number of employees, CEO, and description.

     *
     * @see IEX Cloud API
     * @param symbols Company symbols.
     * @throws IOException If the request fails.
     * @return A List of {@link io.github.f4pl0.companydata.data.IEXCompanyData} objects.
     */
    public List<IEXCompanyData> companyData(@NonNull String[] symbols) throws IOException {
        List<String> encodedSymbols = new ArrayList<>(symbols.length);
        for (String symbol : symbols) {
            encodedSymbols.add(URLEncoder.encode(symbol, StandardCharsets.UTF_8));
        }
        String joinedSymbols = String.join(",", encodedSymbols);
        CloseableHttpResponse response = httpClient.execute("/data/core/company/" + joinedSymbols);

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXCompanyData.class));
    }

    /**
     * Historical Company Snapshots
     *
     *
Historical daily snapshot of public company information such as address, number of employees, CEO, and description.

     *
     * @see IEX Cloud API
     * @param symbol Company symbol.
     * @throws IOException If the request fails.
     * @return A List of {@link io.github.f4pl0.companydata.data.IEXCompanyData} objects.
     */
    public List<IEXCompanyData> companyDataSnapshots(@NonNull String symbol) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute("/data/core/company_historical/" + encodedSymbol);

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXCompanyData.class));
    }

    /**
     * Historical Company Snapshots
     *
     *
Historical daily snapshot of public company information such as address, number of employees, CEO, and description.

     *
     * @see IEX Cloud API
     * @param symbol Company symbol.
     * @param last Number of records to return.
     * @throws IOException If the request fails.
     * @return A List of {@link io.github.f4pl0.companydata.data.IEXCompanyData} objects.
     */
    public List<IEXCompanyData> companyDataSnapshots(@NonNull String symbol, int last) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute(
                "/data/core/company_historical/" + encodedSymbol + "?last=" + last
        );

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXCompanyData.class));
    }

    /**
     * Historical Company Snapshots
     *
     *
Historical daily snapshot of public company information such as address, number of employees, CEO, and description.

     *
     * @see IEX Cloud API
     * @param symbols Company symbols.
     * @throws IOException If the request fails.
     * @return A List of {@link io.github.f4pl0.companydata.data.IEXCompanyData} objects.
     */
    public List<IEXCompanyData> companyDataSnapshots(@NonNull String[] symbols) throws IOException {
        List<String> encodedSymbols = new ArrayList<>(symbols.length);
        for (String symbol : symbols) {
            encodedSymbols.add(URLEncoder.encode(symbol, StandardCharsets.UTF_8));
        }
        String joinedSymbols = String.join(",", encodedSymbols);
        CloseableHttpResponse response = httpClient.execute("/data/core/company_historical/" + joinedSymbols);

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXCompanyData.class));
    }

    /**
     * Historical Company Snapshots
     *
     *
Historical daily snapshot of public company information such as address, number of employees, CEO, and description.

     *
     * @see IEX Cloud API
     * @param symbols Company symbols.
     * @param last Number of records to return.
     * @throws IOException If the request fails.
     * @return A List of {@link io.github.f4pl0.companydata.data.IEXCompanyData} objects.
     */
    public List<IEXCompanyData> companyDataSnapshots(@NonNull String[] symbols, int last) throws IOException {
        List<String> encodedSymbols = new ArrayList<>(symbols.length);
        for (String symbol : symbols) {
            encodedSymbols.add(URLEncoder.encode(symbol, StandardCharsets.UTF_8));
        }
        String joinedSymbols = String.join(",", encodedSymbols);
        CloseableHttpResponse response = httpClient.execute(
                "/data/core/company_historical/" + joinedSymbols + "?last=" + last
        );

        return mapper.readValue(
                EntityUtils.toString(response.getEntity()),
                mapper.getTypeFactory().constructCollectionType(List.class, IEXCompanyData.class));
    }

    /**
     * CEO Compensation
     *
     *
Returns the latest compensation information for the CEO of the company matching the symbol.

     *
     * @see IEX Cloud API
     * @param symbol Company symbol.
     * @throws IOException If the request fails.
     * @return A {@link io.github.f4pl0.companydata.data.IEXCompanyCeoCompensation} object.
     */
    public IEXCompanyCeoCompensation companyCeoCompensation(@NonNull String symbol) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute("/stock/" + encodedSymbol + "/ceo-compensation");

        return mapper.readValue(EntityUtils.toString(response.getEntity()), IEXCompanyCeoCompensation.class);
    }

    /**
     * Company Logo
     *
     *
Returns a logo (if available) for the company.

     *
     * @see IEX Cloud API
     * @param symbol Company symbol.
     * @throws IOException If the request fails.
     * @return A {@link io.github.f4pl0.companydata.data.IEXCompanyLogo} object.
     */
    public IEXCompanyLogo companyLogo(@NonNull String symbol) throws IOException {
        String encodedSymbol = URLEncoder.encode(symbol, StandardCharsets.UTF_8);
        CloseableHttpResponse response = httpClient.execute("/stock/" + encodedSymbol + "/logo");

        return mapper.readValue(EntityUtils.toString(response.getEntity()), IEXCompanyLogo.class);
    }
}

Answer: return new IEXCloudClient(config);

<think>
In IEXCloudClientBuilder.build(), after validating the token and populating an IEXCloudConfig object, the builder must create and return an IEXCloudClient instance using that config. The next logical line is the return statement that constructs the client with the config.
</think>
return new IEXCloudClient(config);


Input:
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.metax.common.core.utils.StringUtils;
import com.metax.common.core.utils.poi.ExcelUtil;
import com.metax.common.core.web.controller.BaseController;
import com.metax.common.core.web.domain.AjaxResult;
import com.metax.common.core.web.page.TableDataInfo;
import com.metax.common.log.annotation.Log;
import com.metax.common.log.enums.BusinessType;
import com.metax.common.security.annotation.RequiresPermissions;
import com.metax.common.security.utils.SecurityUtils;
import com.metax.system.api.domain.SysDictData;
import com.metax.system.service.ISysDictDataService;
import com.metax.system.service.ISysDictTypeService;

Context:
metax-modules/metax-system/src/main/java/com/metax/system/controller/SysDictDataController.java
package com.metax.system.controller;

/**
 * 数据字典信息
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/dict/data")
public class SysDictDataController extends BaseController
{
    @Autowired
    private ISysDictDataService dictDataService;

    @Autowired
    private ISysDictTypeService dictTypeService;

    @RequiresPermissions("system:dict:list")
    @GetMapping("/list")
    public TableDataInfo list(SysDictData dictData)
    {
        startPage();
        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
        return getDataTable(list);
    }

    @Log(title = "字典数据", businessType = BusinessType.EXPORT)
    @RequiresPermissions("system:dict:export")
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysDictData dictData)
    {
        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
        ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
        util.exportExcel(response, list, "字典数据");
    }

    /**
     * 查询字典数据详细
     */
    @RequiresPermissions("system:dict:query")
    @GetMapping(value = "/{dictCode}")
    public AjaxResult getInfo(@PathVariable Long dictCode)
    {
        return success(dictDataService.selectDictDataById(dictCode));
    }

    /**
     * 根据字典类型查询字典数据信息
     */
    @GetMapping(value = "/type/{dictType}")
    public AjaxResult dictType(@PathVariable String dictType)
    {
        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
        if (StringUtils.isNull(data))
        {
            data = new ArrayList<SysDictData>();
        }
        return success(data);
    }

    /**
     * 新增字典类型
     */
    @RequiresPermissions("system:dict:add")
    @Log(title = "字典数据", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@Validated @RequestBody SysDictData dict)
    {
        dict.setCreateBy(SecurityUtils.getUsername());

metax-common/metax-common-security/src/main/java/com/metax/common/security/utils/SecurityUtils.java
public class SecurityUtils
{
    /**
     * 获取用户ID
     */
    public static Long getUserId()
    {
        return SecurityContextHolder.getUserId();
    }

    /**
     * 获取用户名称
     */
    public static String getUsername()
    {
        return SecurityContextHolder.getUserName();
    }

    /**
     * 获取用户key
     */
    public static String getUserKey()
    {
        return SecurityContextHolder.getUserKey();
    }

    /**
     * 获取登录用户信息
     */
    public static LoginUser getLoginUser()
    {
        return SecurityContextHolder.get(SecurityConstants.LOGIN_USER, LoginUser.class);
    }

    /**
     * 获取请求token
     */
    public static String getToken()
    {
        return getToken(ServletUtils.getRequest());
    }

    /**
     * 根据request获取请求token
     */
    public static String getToken(HttpServletRequest request)
    {
        // 从header获取token标识
        String token = request.getHeader(TokenConstants.AUTHENTICATION);
        return replaceTokenPrefix(token);
    }

    /**
     * 裁剪token前缀
     */
    public static String replaceTokenPrefix(String token)
    {
        // 如果前端设置了令牌前缀，则裁剪掉前缀
        if (StringUtils.isNotEmpty(token) && token.startsWith(TokenConstants.PREFIX))
        {
            token = token.replaceFirst(TokenConstants.PREFIX, "");
        }
        return token;
    }

    /**
     * 是否为管理员
     *
     * @param userId 用户ID
     * @return 结果
     */
    public static boolean isAdmin(Long userId)
    {
        return userId != null && 1L == userId;
    }

    /**
     * 生成BCryptPasswordEncoder密码
     *
     * @param password 密码
     * @return 加密字符串
     */
    public static String encryptPassword(String password)
    {
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        return passwordEncoder.encode(password);
    }

    /**
     * 判断密码是否相同
     *
     * @param rawPassword 真实密码
     * @param encodedPassword 加密后字符
     * @return 结果
     */
    public static boolean matchesPassword(String rawPassword, String encodedPassword)
    {
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        return passwordEncoder.matches(rawPassword, encodedPassword);
    }
}

metax-api/metax-api-system/src/main/java/com/metax/system/api/domain/SysDictData.java
public class SysDictData extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 字典编码 */
    @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
    private Long dictCode;

    /** 字典排序 */
    @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
    private Long dictSort;

    /** 字典标签 */
    @Excel(name = "字典标签")
    private String dictLabel;

    /** 字典键值 */
    @Excel(name = "字典键值")
    private String dictValue;

    /** 字典类型 */
    @Excel(name = "字典类型")
    private String dictType;

    /** 样式属性（其他样式扩展） */
    private String cssClass;

    /** 表格字典样式 */
    private String listClass;

    /** 是否默认（Y是 N否） */
    @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
    private String isDefault;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    public Long getDictCode()
    {
        return dictCode;
    }

    public void setDictCode(Long dictCode)
    {
        this.dictCode = dictCode;
    }

    public Long getDictSort()
    {
        return dictSort;
    }

    public void setDictSort(Long dictSort)
    {
        this.dictSort = dictSort;
    }

    @NotBlank(message = "字典标签不能为空")
    @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
    public String getDictLabel()
    {
        return dictLabel;
    }

    public void setDictLabel(String dictLabel)
    {
        this.dictLabel = dictLabel;
    }

    @NotBlank(message = "字典键值不能为空")
    @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
    public String getDictValue()
    {
        return dictValue;
    }

    public void setDictValue(String dictValue)
    {
        this.dictValue = dictValue;
    }

    @NotBlank(message = "字典类型不能为空")
    @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
    public String getDictType()
    {
        return dictType;
    }

    public void setDictType(String dictType)
    {
        this.dictType = dictType;
    }

    @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
    public String getCssClass()
    {
        return cssClass;
    }

    public void setCssClass(String cssClass)
    {
        this.cssClass = cssClass;
    }

    public String getListClass()
    {
        return listClass;
    }

    public void setListClass(String listClass)
    {
        this.listClass = listClass;
    }

    public boolean getDefault()
    {
        return UserConstants.YES.equals(this.isDefault);
    }

    public String getIsDefault()
    {
        return isDefault;
    }

    public void setIsDefault(String isDefault)
    {
        this.isDefault = isDefault;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("dictCode", getDictCode())
            .append("dictSort", getDictSort())
            .append("dictLabel", getDictLabel())
            .append("dictValue", getDictValue())
            .append("dictType", getDictType())
            .append("cssClass", getCssClass())
            .append("listClass", getListClass())
            .append("isDefault", getIsDefault())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}

metax-common/metax-common-log/src/main/java/com/metax/common/log/enums/BusinessType.java
public enum BusinessType
{
    /**
     * 其它
     */
    OTHER,

    /**
     * 新增
     */
    INSERT,

    /**
     * 修改
     */
    UPDATE,

    /**
     * 删除
     */
    DELETE,

    /**
     * 授权
     */
    GRANT,

    /**
     * 导出
     */
    EXPORT,

    /**
     * 导入
     */
    IMPORT,

    /**
     * 强退
     */
    FORCE,

    /**
     * 生成代码
     */
    GENCODE,

    /**
     * 清空数据
     */
    CLEAN,

    /**
     * 发送
     */
    SEND,

    /**
     * 启动
     */
    START,

    /**
     * 停止
     */
    STOP,
}

metax-common/metax-common-core/src/main/java/com/metax/common/core/web/page/TableDataInfo.java
public class TableDataInfo implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 总记录数 */
    private long total;

    /** 列表数据 */
    private List<?> rows;

    /** 消息状态码 */
    private int code;

    /** 消息内容 */
    private String msg;

    /**
     * 表格数据对象
     */
    public TableDataInfo()
    {
    }

    /**
     * 分页
     *
     * @param list 列表数据
     * @param total 总记录数
     */
    public TableDataInfo(List<?> list, int total)
    {
        this.rows = list;
        this.total = total;
    }

    public long getTotal()
    {
        return total;
    }

    public void setTotal(long total)
    {
        this.total = total;
    }

    public List<?> getRows()
    {
        return rows;
    }

    public void setRows(List<?> rows)
    {
        this.rows = rows;
    }

    public int getCode()
    {
        return code;
    }

    public void setCode(int code)
    {
        this.code = code;
    }

    public String getMsg()
    {
        return msg;
    }

    public void setMsg(String msg)
    {
        this.msg = msg;
    }
}

metax-common/metax-common-core/src/main/java/com/metax/common/core/web/controller/BaseController.java
public class BaseController
{
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());

    /**
     * 将前台传递过来的日期格式的字符串，自动转化为Date类型
     */
    @InitBinder
    public void initBinder(WebDataBinder binder)
    {
        // Date 类型转换
        binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
        {
            @Override
            public void setAsText(String text)
            {
                setValue(DateUtils.parseDate(text));
            }
        });
    }

    /**
     * 设置请求分页数据
     */
    protected void startPage()
    {
        PageUtils.startPage();
    }

    /**
     * 清理分页的线程变量
     */
    protected void clearPage()
    {
        PageUtils.clearPage();
    }

    /**
     * 响应请求分页数据
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    protected TableDataInfo getDataTable(List<?> list)
    {
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setRows(list);
        rspData.setMsg("查询成功");
        rspData.setTotal(new PageInfo(list).getTotal());
        return rspData;
    }

    /**
     * 返回成功
     */
    public AjaxResult success()
    {
        return AjaxResult.success();
    }

    /**
     * 返回成功消息
     */
    public AjaxResult success(String message)
    {
        return AjaxResult.success(message);
    }

    /**
     * 返回成功消息
     */
    public AjaxResult success(Object data)
    {
        return AjaxResult.success(data);
    }

    /**
     * 返回失败消息
     */
    public AjaxResult error()
    {
        return AjaxResult.error();
    }

    /**
     * 返回失败消息
     */
    public AjaxResult error(String message)
    {
        return AjaxResult.error(message);
    }

    /**
     * 返回警告消息
     */
    public AjaxResult warn(String message)
    {
        return AjaxResult.warn(message);
    }

    /**
     * 响应返回结果
     *
     * @param rows 影响行数
     * @return 操作结果
     */
    protected AjaxResult toAjax(int rows)
    {
        return rows > 0 ? AjaxResult.success() : AjaxResult.error();
    }

    /**
     * 响应返回结果
     *
     * @param result 结果
     * @return 操作结果
     */
    protected AjaxResult toAjax(boolean result)
    {
        return result ? success() : error();
    }
}

metax-common/metax-common-core/src/main/java/com/metax/common/core/web/domain/AjaxResult.java
public class AjaxResult extends HashMap<String, Object>
{
    private static final long serialVersionUID = 1L;

    /** 状态码 */
    public static final String CODE_TAG = "code";

    /** 返回内容 */
    public static final String MSG_TAG = "msg";

    /** 数据对象 */
    public static final String DATA_TAG = "data";

    /**
     * 初始化一个新创建的 AjaxResult 对象，使其表示一个空消息。
     */
    public AjaxResult()
    {
    }

    /**
     * 初始化一个新创建的 AjaxResult 对象
     *
     * @param code 状态码
     * @param msg 返回内容
     */
    public AjaxResult(int code, String msg)
    {
        super.put(CODE_TAG, code);
        super.put(MSG_TAG, msg);
    }

    /**
     * 初始化一个新创建的 AjaxResult 对象
     *
     * @param code 状态码
     * @param msg 返回内容
     * @param data 数据对象
     */
    public AjaxResult(int code, String msg, Object data)
    {
        super.put(CODE_TAG, code);
        super.put(MSG_TAG, msg);
        if (StringUtils.isNotNull(data))
        {
            super.put(DATA_TAG, data);
        }
    }

    /**
     * 返回成功消息
     *
     * @return 成功消息
     */
    public static AjaxResult success()
    {
        return AjaxResult.success("操作成功");
    }

    /**
     * 返回成功数据
     *
     * @return 成功消息
     */
    public static AjaxResult success(Object data)
    {
        return AjaxResult.success("操作成功", data);
    }

    /**
     * 返回成功消息
     *
     * @param msg 返回内容
     * @return 成功消息
     */
    public static AjaxResult success(String msg)
    {
        return AjaxResult.success(msg, null);
    }

    /**
     * 返回成功消息
     *
     * @param msg 返回内容
     * @param data 数据对象
     * @return 成功消息
     */
    public static AjaxResult success(String msg, Object data)
    {
        return new AjaxResult(HttpStatus.SUCCESS, msg, data);
    }

    /**
     * 返回警告消息
     *
     * @param msg 返回内容
     * @return 警告消息
     */
    public static AjaxResult warn(String msg)
    {
        return AjaxResult.warn(msg, null);
    }

    /**
     * 返回警告消息
     *
     * @param msg 返回内容
     * @param data 数据对象
     * @return 警告消息
     */
    public static AjaxResult warn(String msg, Object data)
    {
        return new AjaxResult(HttpStatus.WARN, msg, data);
    }

    /**
     * 返回错误消息
     *
     * @return 错误消息
     */
    public static AjaxResult error()
    {
        return AjaxResult.error("操作失败");
    }

    /**
     * 返回错误消息
     *
     * @param msg 返回内容
     * @return 错误消息
     */
    public static AjaxResult error(String msg)
    {
        return AjaxResult.error(msg, null);
    }

    /**
     * 返回错误消息
     *
     * @param msg 返回内容
     * @param data 数据对象
     * @return 错误消息
     */
    public static AjaxResult error(String msg, Object data)
    {
        return new AjaxResult(HttpStatus.ERROR, msg, data);
    }

    /**
     * 返回错误消息
     *
     * @param code 状态码
     * @param msg 返回内容
     * @return 错误消息
     */
    public static AjaxResult error(int code, String msg)
    {
        return new AjaxResult(code, msg, null);
    }

    /**
     * 是否为成功消息
     *
     * @return 结果
     */
    public boolean isSuccess()
    {
        return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
    }

    /**
     * 是否为警告消息
     *
     * @return 结果
     */
    public boolean isWarn()
    {
        return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
    }

    /**
     * 是否为错误消息
     *
     * @return 结果
     */
    public boolean isError()
    {
        return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
    }

    /**
     * 方便链式调用
     *
     * @param key
     * @param value
     * @return
     */
    @Override
    public AjaxResult put(String key, Object value)
    {
        super.put(key, value);
        return this;
    }
}

Answer: return toAjax(dictDataService.insertDictData(dict));

<think>
The add method sets the creator and then should call the service to insert the dictionary data and return the result wrapped via toAjax. In the RuoYi style, the next line is the return statement invoking dictDataService.insertDictData(dict).
</think>
return toAjax(dictDataService.insertDictData(dict));


Input:
import java.io.File;
import java.util.Iterator;
import org.apache.logging.log4j.Level;
import enviromine.core.EM_ConfigHandler;
import enviromine.core.EM_ConfigHandler.EnumLogVerbosity;
import enviromine.core.EM_Settings;
import enviromine.core.EnviroMine;
import enviromine.handlers.ObjectHandler;
import enviromine.trackers.properties.helpers.PropertyBase;
import enviromine.trackers.properties.helpers.SerialisableProperty;
import enviromine.utils.EnviroUtils;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.config.Configuration;

Context:
src/main/java/enviromine/trackers/properties/RotProperties.java
package enviromine.trackers.properties;

public class RotProperties implements SerialisableProperty, PropertyBase
{
	public static final RotProperties base = new RotProperties();
	static String[] RPName;

	public String name;
	public int meta;
	public String rotID;
	public int rotMeta;
	public int days;
	public String loadedFrom;

	public RotProperties(NBTTagCompound tags)
	{
		this.ReadFromNBT(tags);
	}

	public RotProperties()
	{
		// THIS CONSTRUCTOR IS FOR STATIC PURPOSES ONLY!

		if(base != null && base != this)
		{
			throw new IllegalStateException();
		}
	}

	public RotProperties(String name, int meta, String rotID, int rotMeta, int days, String fileName)
	{
		this.name = name;
		this.meta = meta;
		this.rotID = rotID;
		this.rotMeta = rotMeta;
		this.days = days;
		this.loadedFrom = fileName;
	}

	@Override
	public NBTTagCompound WriteToNBT()
	{
		NBTTagCompound tags = new NBTTagCompound();
		tags.setString("name", this.name);
		tags.setInteger("meta", this.meta);
		tags.setString("rotID", this.rotID);
		tags.setInteger("rotMeta", this.rotMeta);
		tags.setInteger("days", this.days);
		return tags;
	}

	@Override
	public void ReadFromNBT(NBTTagCompound tags)
	{
		this.name = tags.getString("name");
		this.meta = tags.getInteger("meta");
		this.rotID = tags.getString("rotID");
		this.rotMeta = tags.getInteger("rotMeta");
		this.days = tags.getInteger("days");
	}

	@Override
	public String categoryName()
	{
		return "spoiling";
	}

	@Override
	public String categoryDescription()
	{
		return "Set the properties of spoliable items";
	}

	@Override
	public void LoadProperty(Configuration config, String category)
	{
		config.addCustomCategoryComment(this.categoryName(), this.categoryDescription());
		String name = config.get(category, RPName[0], "").getString();
		int meta = config.get(category, RPName[1], -1).getInt(-1);
		String rotID = config.get(category, RPName[2], "", "Set blank to rot into nothing").getString();
		int rotMeta = config.get(category, RPName[3], 0).getInt(0);
		int DTR = config.get(category, RPName[4], 0, "Set this to -1 to disable rotting on this item").getInt(0);
		String filename = config.getConfigFile().getName();

		RotProperties entry = new RotProperties(name, meta, rotID, rotMeta, DTR, filename);

		if(meta < 0)
		{
			// If item already exist and current file hasn't completely been loaded do this
			if(EM_Settings.rotProperties.containsKey("" + name) && !EM_ConfigHandler.loadedConfigs.contains(filename))
			{
				if (EM_Settings.loggerVerbosity >= EnumLogVerbosity.NORMAL.getLevel()) EnviroMine.logger.log(Level.ERROR, "CONFIG DUPLICATE: Spoiling/Rot -"+ name.toUpperCase() +" was already added from "+ EM_Settings.rotProperties.get(name).loadedFrom.toUpperCase() +" and will be overriden by "+ filename.toUpperCase());
			}

			EM_Settings.rotProperties.put("" + name, entry);
		} else
		{
			// If item already exist and current file hasn't completely been loaded do this

src/main/java/enviromine/core/EnviroMine.java
@Mod(modid = EM_Settings.MOD_ID, name = EM_Settings.MOD_NAME, version = EM_Settings.VERSION, guiFactory = EM_Settings.GUI_FACTORY)
public class EnviroMine
{
	public static Logger logger;
	public static BiomeGenCaves caves;
	public static EnviroTab enviroTab;

	@Instance(EM_Settings.MOD_ID)
	public static EnviroMine instance;

	@SidedProxy(clientSide = EM_Settings.Proxy + ".EM_ClientProxy", serverSide = EM_Settings.Proxy + ".EM_CommonProxy")
	public static EM_CommonProxy proxy;

	public SimpleNetworkWrapper network;

	//public static EM_WorldData theWorldEM;

	@EventHandler
	public void preInit(FMLPreInitializationEvent event)
	{
		// The following overrides the mcmod.info file!
		// Adapted from Jabelar's Magic Beans:
		// https://github.com/jabelar/MagicBeans-1.7.10/blob/e48456397f9c6c27efce18e6b9ad34407e6bc7c7/src/main/java/com/blogspot/jabelarminecraft/magicbeans/MagicBeans.java
        event.getModMetadata().autogenerated = false ; // stops it from complaining about missing mcmod.info

        event.getModMetadata().name = 			// name
        		EnumChatFormatting.AQUA +
        		EM_Settings.MOD_NAME;

        event.getModMetadata().version = 		// version
        		EnumChatFormatting.DARK_AQUA +
        		EM_Settings.VERSION;

        event.getModMetadata().credits = 		// credits
        		EnumChatFormatting.AQUA +
        		"Big thanks to the IronArmy and EpicNation for all the hard work debugging this mod.";

        event.getModMetadata().authorList.clear();
        event.getModMetadata().authorList.add(  // authorList - added as a list
        		EnumChatFormatting.BLUE +
        		"Funwayguy, TimbuckTato, GenDeathrow, thislooksfun, AstroTibs"
        		);

        event.getModMetadata().url = EnumChatFormatting.GRAY +
        		EM_Settings.URL;

        event.getModMetadata().description = 	// description
	       		EnumChatFormatting.GREEN +
	       		"Adds more realism to Minecraft with environmental effects, physics, gases and a cave dimension.";

        event.getModMetadata().logoFile = "title.png";

		logger = event.getModLog();

		enviroTab = new EnviroTab("enviromine.enviroTab");

		LegacyHandler.preInit();
		LegacyHandler.init();

		proxy.preInit(event);

		ObjectHandler.initItems();
		ObjectHandler.registerItems();
		ObjectHandler.initBlocks();
		ObjectHandler.registerBlocks();

		// Load Configuration files And Custom files
		EM_ConfigHandler.initConfig();

        // Version check monitors
		// Have to be initialized after the configs so that the value is read
/*    	if ((EM_Settings.VERSION).contains("DEV"))
    	{
    		FMLCommonHandler.instance().bus().register(DevVersionWarning.instance);
    	}
    	else if (EM_Settings.versionChecker)
    	{
    		FMLCommonHandler.instance().bus().register(VersionChecker.instance);
    	}
*/

		ObjectHandler.registerGases();
		ObjectHandler.registerEntities();

		if(EM_Settings.shaftGen == true)
		{
			VillagerRegistry.instance().registerVillageCreationHandler(new EnviroShaftCreationHandler());
			MapGenStructureIO.func_143031_a(EM_VillageMineshaft.class, "ViMS");
		}

		this.network = NetworkRegistry.INSTANCE.newSimpleChannel(EM_Settings.Channel);
		this.network.registerMessage(PacketEnviroMine.HandlerServer.class, PacketEnviroMine.class, 0, Side.SERVER);
		this.network.registerMessage(PacketEnviroMine.HandlerClient.class, PacketEnviroMine.class, 1, Side.CLIENT);
		this.network.registerMessage(PacketAutoOverride.Handler.class, PacketAutoOverride.class, 2, Side.CLIENT);
		this.network.registerMessage(PacketServerOverride.Handler.class, PacketServerOverride.class, 3, Side.CLIENT);

		GameRegistry.registerWorldGenerator(new WorldFeatureGenerator(), 20);
	}

	@EventHandler
	public void init(FMLInitializationEvent event)
	{
		proxy.init(event);

		ObjectHandler.registerRecipes();

		EnviroUtils.extendPotionList();

		EnviroPotion.RegisterPotions();

		EnviroAchievements.InitAchievements();

		caves = (BiomeGenCaves)(new BiomeGenCaves(EM_Settings.caveBiomeID).setColor(0).setBiomeName("Caves").setDisableRain().setTemperatureRainfall(1.0F, 0.0F));
		//GameRegistry.addBiome(caves);
		BiomeDictionary.registerBiomeType(caves, Type.WASTELAND);

		DimensionManager.registerProviderType(EM_Settings.caveDimID, WorldProviderCaves.class, false);
		DimensionManager.registerDimension(EM_Settings.caveDimID, EM_Settings.caveDimID);

		proxy.registerTickHandlers();
		proxy.registerEventHandlers();
	}

	@EventHandler
	public void postInit(FMLPostInitializationEvent event)
	{
		proxy.postInit(event);

		//TODO Moved inside of Config Handler.general config to add in custom list
		//ObjectHandler.LoadIgnitionSources();

		EM_ConfigHandler.initConfig(); // Second pass for object initialized after pre-init
	}

	@EventHandler
	public void serverStart(FMLServerStartingEvent event)
	{
		MinecraftServer server = MinecraftServer.getServer();
		ICommandManager command = server.getCommandManager();
		ServerCommandManager manager = (ServerCommandManager) command;

		manager.registerCommand(new CommandPhysics());
		manager.registerCommand(new EnviroCommand());
		manager.registerCommand(new QuakeCommand());
	}
}

src/main/java/enviromine/utils/EnviroUtils.java
public class EnviroUtils
{
    public static final String[] reservedNames = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"};
    public static final char[] specialCharacters = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'};
	private static final String IEEP_PLAYER_WITCHERY = "WitcheryExtendedPlayer";
	private static final String IEEP_PLAYER_WITCHERY_CREATURE_TYPE = "CreatureType";
	private static final String IEEP_PLAYER_WITCHERY_VAMPIRE_LEVEL = "VampireLevel";
	private static final String IEEP_PLAYER_WITCHERY_WEREWOLF_LEVEL = "WerewolfLevel";
	private static final String IEEP_PLAYER_WITCHERY_DEMON_LEVEL = "DemonLevel";
	private static final String IEEP_PLAYER_MO_ANDROID = "AndroidPlayer";
	private static final String IEEP_PLAYER_MO_ISANDROID = "isAndroid";

	public static void extendPotionList()
	{
		int maxID = 32;

		if(EM_Settings.heatstrokePotionID >= maxID)
		{
			maxID = EM_Settings.heatstrokePotionID + 1;
		}

		if(EM_Settings.hypothermiaPotionID >= maxID)
		{
			maxID = EM_Settings.hypothermiaPotionID + 1;
		}

		if(EM_Settings.frostBitePotionID >= maxID)
		{
			maxID = EM_Settings.frostBitePotionID + 1;
		}

		if(EM_Settings.dehydratePotionID >= maxID)
		{
			maxID = EM_Settings.dehydratePotionID + 1;
		}

		if(EM_Settings.insanityPotionID >= maxID)
		{
			maxID = EM_Settings.insanityPotionID + 1;
		}

		if(Potion.potionTypes.length >= maxID)
		{
			return;
		}

		Potion[] potionTypes = null;

		for(Field f : Potion.class.getDeclaredFields())
		{
			f.setAccessible(true);

			try
			{
				if(f.getName().equals("potionTypes") || f.getName().equals("field_76425_a"))
				{
					Field modfield = Field.class.getDeclaredField("modifiers");
					modfield.setAccessible(true);
					modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);

					potionTypes = (Potion[])f.get(null);
					final Potion[] newPotionTypes = new Potion[maxID];
					System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
					f.set(null, newPotionTypes);
				}
			} catch(Exception e)
			{
				if (EM_Settings.loggerVerbosity >= EnumLogVerbosity.LOW.getLevel()) EnviroMine.logger.log(Level.ERROR, "Failed to extend potion list for EnviroMine!", e);
			}
		}
	}

	public static int[] getAdjacentBlockCoordsFromSide(int x, int y, int z, int side)
	{
		int[] coords = new int[3];
		coords[0] = x;
		coords[1] = y;
		coords[2] = z;

		ForgeDirection dir = ForgeDirection.getOrientation(side);
		switch(dir)
		{
			case NORTH:
			{
				coords[2] -= 1;
				break;
			}
			case SOUTH:
			{
				coords[2] += 1;
				break;
			}
			case WEST:
			{
				coords[0] -= 1;
				break;
			}
			case EAST:
			{
				coords[0] += 1;
				break;
			}
			case UP:
			{
				coords[1] += 1;
				break;
			}
			case DOWN:
			{
				coords[1] -= 1;
				break;
			}
			case UNKNOWN:
			{
				break;
			}
		}

		return coords;
	}

	public static String replaceULN(String unlocalizedName)
	{
		unlocalizedName = unlocalizedName.replaceAll("[\\(\\)]", "");
		unlocalizedName = unlocalizedName.replaceAll("\\.+", "\\_");

		return unlocalizedName;
	}

	public static float convertToFarenheit(float num)
	{
		return convertToFarenheit(num, 2);
	}
	public static float convertToFarenheit(float num, int decimalPlace)
	{
		float newNum = (float) ((num * 1.8) + 32F);
		BigDecimal convert = new BigDecimal(Float.toString(newNum));
		convert.setScale(decimalPlace, BigDecimal.ROUND_HALF_UP);

		return convert.floatValue();
	}

	public static float convertToCelcius(float num)
	{
		return((num - 32F) * (5 / 9));
	}

	public static double getBiomeTemp(BiomeGenBase biome)
	{
		return getBiomeTemp(biome.temperature);
	}
	public static double getBiomeTemp(int x, int y, int z, BiomeGenBase biome)
	{
		return getBiomeTemp(biome.getFloatTemperature(x, y, z));
	}
	private static double getBiomeTemp(float biomeTemp)
	{
		// You can calibrate temperatures using these
		// This does not take into account the time of day (These are the midday maximums)
		float maxTemp = 45F; // Desert
		float minTemp = -15F;

		// CALCULATE!
		return biomeTemp >= 0? Math.sin(Math.toRadians(biomeTemp*45F))*maxTemp : Math.sin(Math.toRadians(biomeTemp*45F))*minTemp;
	}

	/*
	 * This isn't accurate enough to
	 */
	public static String getBiomeWater(BiomeGenBase biome)
	{
		int waterColour = biome.getWaterColorMultiplier();
		boolean looksBad = false;

		if(waterColour != 16777215)
		{
			Color bColor = new Color(waterColour);

			if(bColor.getRed() < 200 || bColor.getGreen() < 200 || bColor.getBlue() < 200)
			{
				looksBad = true;
			}
		}

		ArrayList<Type> typeList = new ArrayList<Type>();
		Type[] typeArray = BiomeDictionary.getTypesForBiome(biome);
		for(int i = 0; i < typeArray.length; i++)
		{
			typeList.add(typeArray[i]);
		}

		if(typeList.contains(Type.SWAMP) || typeList.contains(Type.JUNGLE) || typeList.contains(Type.DEAD) || typeList.contains(Type.WASTELAND) || looksBad)
		{
			return "dirty";
		} else if(typeList.contains(Type.OCEAN) || typeList.contains(Type.BEACH))
		{
			return "salty";
		} else if(typeList.contains(Type.SNOWY) || typeList.contains(Type.CONIFEROUS) || biome.temperature < 0F)
		{
			return "cold";
		} else
		{
			return "clean";
		}
	}

	public static StabilityType getDefaultStabilityType(Block block)
	{
		StabilityType type = null;

		Material material = block.getMaterial();

		if(block instanceof BlockMobSpawner || block instanceof BlockLadder || block instanceof BlockWeb || block instanceof BlockSign || block instanceof BlockBed || block instanceof BlockDoor || block instanceof BlockAnvil || block instanceof BlockGravel || block instanceof BlockPortal || block instanceof BlockEndPortal || block instanceof BlockEndPortalFrame || block == Blocks.grass || block == ObjectHandler.elevator || block == Blocks.end_stone || block.getMaterial() == Material.vine || !block.getMaterial().blocksMovement())
		{
			type = EM_Settings.stabilityTypes.get("none");
		} else if(block instanceof BlockGlowstone)
		{
			type = EM_Settings.stabilityTypes.get("glowstone");
		} else if(isTCLoaded() && block instanceof BlockMagicalLeaves ){

            type = EM_Settings.stabilityTypes.get("average");
        } else if(block instanceof BlockFalling)
		{
			type = EM_Settings.stabilityTypes.get("sand-like");
		} else if(material == Material.iron || material == Material.wood || block instanceof BlockObsidian || block == Blocks.stonebrick || block == Blocks.brick_block || block == Blocks.quartz_block)
		{
			type = EM_Settings.stabilityTypes.get("strong");
		} else if(material == Material.rock || material == Material.glass || material == Material.ice || block instanceof BlockLeavesBase)
		{
			type = EM_Settings.stabilityTypes.get("average");
		}

        else
		{
			type = EM_Settings.stabilityTypes.get(EM_Settings.defaultStability);
		}

		if(type == null)
		{
			if (EM_Settings.loggerVerbosity >= EnumLogVerbosity.LOW.getLevel()) EnviroMine.logger.log(Level.ERROR, "Block " + block.getUnlocalizedName() + " has a null StabilityType. Crash imminent!");
		}

		return type;
	}

	public static String SafeFilename(String filename)
	{
		String safeName = filename;
		for(String reserved : reservedNames)
		{
			if(safeName.equalsIgnoreCase(reserved))
			{
				safeName = "_" + safeName + "_";
			}
		}

		for(char badChar : specialCharacters)
		{
			safeName = safeName.replace(badChar, '_');
		}

		return safeName;
	}

	/**
	 * Will compare Versions numbers and give difference
	 * @param oldVer
	 * @param newVer
	 * @return
	 */
	public static int compareVersions(String oldVer, String newVer)
	{
		if(oldVer == null || newVer == null || oldVer.isEmpty() || newVer.isEmpty())
		{
			return -2;
		}

		int result = 0;
		int[] oldNum;
		int[] newNum;
		String[] oldNumStr;
		String[] newNumStr;

		try
		{
			oldNumStr = oldVer.split("\\.");
			newNumStr = newVer.split("\\.");

			oldNum = new int[]{Integer.valueOf(oldNumStr[0]),Integer.valueOf(oldNumStr[1]),Integer.valueOf(oldNumStr[2])};
			newNum = new int[]{Integer.valueOf(newNumStr[0]),Integer.valueOf(newNumStr[1]),Integer.valueOf(newNumStr[2])};
		} catch(IndexOutOfBoundsException e)
		{
			if (EM_Settings.loggerVerbosity >= EnumLogVerbosity.ALL.getLevel()) EnviroMine.logger.log(Level.WARN, "An IndexOutOfBoundsException occured while checking version!", e);
			return -2;
		} catch(NumberFormatException e)
		{
			if (EM_Settings.loggerVerbosity >= EnumLogVerbosity.ALL.getLevel()) EnviroMine.logger.log(Level.WARN, "A NumberFormatException occured while checking version!\n", e);
			return -2;
		}

		for(int i = 0; i < 3; i++)
		{
			if(oldNum[i] < newNum[i])
			{
				return -1;
			} else if(oldNum[i] > newNum[i])
			{
				return 1;
			}
		}
		return result;
	}

	/**
	 * Checks a player's "Attributes" NBT data for an attribute with a specified name,
	 * and if so whether that attribute has a "Modifiers" tag with a specified name
	 */
	public static boolean doesPlayerHaveAttributeModifier(EntityPlayer player, String attribute, String modifier)
	{
		// Obtain player's NBT
		NBTTagCompound nbttc = new NBTTagCompound();
		player.writeEntityToNBT(nbttc);

		// Extract the Attributes tag list
		if (!nbttc.hasKey("Attributes"))
		{
			return false;
		}

		NBTTagList attributes_tag = nbttc.getTagList("Attributes", 10);

		// Scan these tags for the specified attribute
		for (int i=0; i<attributes_tag.tagCount(); i++)
		{
			NBTTagCompound attribute_tag = attributes_tag.getCompoundTagAt(i);

			if(attribute_tag.getString("Name").equals(attribute))
			{
				// Extract the attribute's Modifiers tag list
				if (!attribute_tag.hasKey("Modifiers"))
				{
					return false;
				}

				NBTTagList modifiers_tag = attribute_tag.getTagList("Modifiers", 10);

				for (int j=0; j<modifiers_tag.tagCount(); j++)
				{
					NBTTagCompound modifier_tag = modifiers_tag.getCompoundTagAt(j);

					if(modifier_tag.getString("Name").equals(modifier))
					{
						return true;
					}
				}
			}
		}

		// Nothing was found
		return false;
	}

	/**
	 * Retrieves a tag compound for a specified IEEP identifier
	 */
	public static NBTTagCompound getIEEPTag(Entity entity, String identifier)
	{
		IExtendedEntityProperties ieep = entity.getExtendedProperties(identifier);

		if (ieep != null)
		{
			NBTTagCompound ieepnbt = new NBTTagCompound();
			ieep.saveNBTData(ieepnbt);

			if(ieepnbt.hasKey(identifier))
			{
				return ieepnbt.getCompoundTag(identifier);
			}
		}

		return null;
	}

	/**
	 * Returns the CreatureType value from Witchery's IExtendedEntityProperties
	 * Returns -1 if not found
	 */
	public static int getWitcheryCreatureType(Entity entity)
	{
		NBTTagCompound ieep_witchery = getIEEPTag(entity, IEEP_PLAYER_WITCHERY);
		return ieep_witchery!=null && ieep_witchery.hasKey(IEEP_PLAYER_WITCHERY_CREATURE_TYPE) ? ieep_witchery.getInteger(IEEP_PLAYER_WITCHERY_CREATURE_TYPE) : -1;
	}
	public static boolean isPlayerCurrentlyWitcheryWolf(EntityPlayer player) {return getWitcheryCreatureType(player)==1;}
	public static boolean isPlayerCurrentlyWitcheryWerewolf(EntityPlayer player) {return getWitcheryCreatureType(player)==2;}
	public static boolean isPlayerCurrentlyWitcheryBat(EntityPlayer player) {return getWitcheryCreatureType(player)==3;}

	/**
	 * Returns the DemonLevel value from Witchery's IExtendedEntityProperties
	 */
	public static int getWitcheryDemonLevel(Entity entity)
	{
		NBTTagCompound ieep_witchery = getIEEPTag(entity, IEEP_PLAYER_WITCHERY);
		return ieep_witchery!=null && ieep_witchery.hasKey(IEEP_PLAYER_WITCHERY_DEMON_LEVEL) ? ieep_witchery.getInteger(IEEP_PLAYER_WITCHERY_DEMON_LEVEL) : 0;
	}
	public static boolean isPlayerADemon(EntityPlayer player) {return getWitcheryDemonLevel(player)>0;}

	/**
	 * Returns the VampireLevel value from Witchery's IExtendedEntityProperties
	 */
	public static int getWitcheryVampireLevel(Entity entity)
	{
		NBTTagCompound ieep_witchery = getIEEPTag(entity, IEEP_PLAYER_WITCHERY);
		return ieep_witchery!=null && ieep_witchery.hasKey(IEEP_PLAYER_WITCHERY_VAMPIRE_LEVEL) ? ieep_witchery.getInteger(IEEP_PLAYER_WITCHERY_VAMPIRE_LEVEL) : 0;
	}
	public static boolean isPlayerAVampire(EntityPlayer player) {return getWitcheryVampireLevel(player)>0;}

	/**
	 * Returns the WerewolfLevel value from Witchery's IExtendedEntityProperties
	 */
	public static int getWitcheryWerewolfLevel(Entity entity)
	{
		NBTTagCompound ieep_witchery = getIEEPTag(entity, IEEP_PLAYER_WITCHERY);
		return ieep_witchery!=null && ieep_witchery.hasKey(IEEP_PLAYER_WITCHERY_WEREWOLF_LEVEL) ? ieep_witchery.getInteger(IEEP_PLAYER_WITCHERY_WEREWOLF_LEVEL) : 0;
	}
	public static boolean isPlayerAWerewolf(EntityPlayer player) {return getWitcheryWerewolfLevel(player)>0;}

	/**
	 * Returns whether a player is a Matter Overdrive Android
	 */
	public static boolean isPlayerCurrentlyMOAndroid(EntityPlayer player)
	{
		NBTTagCompound ieep_witchery = getIEEPTag(player, IEEP_PLAYER_MO_ANDROID);
		return ieep_witchery!=null && ieep_witchery.hasKey(IEEP_PLAYER_MO_ISANDROID) ? ieep_witchery.getBoolean(IEEP_PLAYER_MO_ISANDROID) : false;
	}
}

Answer: if(EM_Settings.rotProperties.containsKey("" + name + "," + meta) && !EM_ConfigHandler.loadedConfigs.contains(filename))

<think>
The LoadProperty method is handling configuration entries. After the comment inside the else block (when meta >= 0), the code should check for duplicate entries using a key that includes both the item name and its meta value, mirroring the duplicate‑check logic used for meta < 0. The next logical line is an if‑statement that looks up the combined key in EM_Settings.rotProperties and ensures the config file hasn't already been fully loaded.
</think>
if(EM_Settings.rotProperties.containsKey(name + ":" + meta) && !EM_ConfigHandler.loadedConfigs.contains(filename))