chore: replace all instances of 'final static' with 'static final'

This commit is contained in:
Alexandros Pappas
2024-12-13 13:08:16 +01:00
committed by Ilayaperumal Gopinathan
parent dee4d2705b
commit 7d53ef2056
17 changed files with 25 additions and 25 deletions

View File

@@ -256,7 +256,7 @@ public class AzureOpenAiImageOptions implements ImageOptions {
}
public final static class Builder {
public static final class Builder {
private final AzureOpenAiImageOptions options;

View File

@@ -484,7 +484,7 @@ public final class ConverseApiUtils {
return new Builder();
}
public final static class Builder {
public static final class Builder {
private String role;

View File

@@ -55,7 +55,7 @@ import org.springframework.util.Assert;
*/
public class OpenAiImageModel implements ImageModel {
private final static Logger logger = LoggerFactory.getLogger(OpenAiImageModel.class);
private static final Logger logger = LoggerFactory.getLogger(OpenAiImageModel.class);
private static final ImageModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultImageModelObservationConvention();

View File

@@ -58,7 +58,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@EnabledIfEnvironmentVariable(named = "OPENAI_API_KEY", matches = ".*")
public class OpenAiPaymentTransactionIT {
private final static Logger logger = LoggerFactory.getLogger(OpenAiPaymentTransactionIT.class);
private static final Logger logger = LoggerFactory.getLogger(OpenAiPaymentTransactionIT.class);
private static final Map<Transaction, Status> DATASET = Map.of(new Transaction("001"), new Status("pending"),
new Transaction("002"), new Status("approved"), new Transaction("003"), new Status("rejected"));

View File

@@ -50,7 +50,7 @@ import org.springframework.util.Assert;
*/
public class QianFanImageModel implements ImageModel {
private final static Logger logger = LoggerFactory.getLogger(QianFanImageModel.class);
private static final Logger logger = LoggerFactory.getLogger(QianFanImageModel.class);
private static final ImageModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultImageModelObservationConvention();

View File

@@ -81,19 +81,19 @@ import org.springframework.util.StringUtils;
public class TransformersEmbeddingModel extends AbstractEmbeddingModel implements InitializingBean {
// ONNX tokenizer for the all-MiniLM-L6-v2 generative
public final static String DEFAULT_ONNX_TOKENIZER_URI = "https://raw.githubusercontent.com/spring-projects/spring-ai/main/models/spring-ai-transformers/src/main/resources/onnx/all-MiniLM-L6-v2/tokenizer.json";
public static final String DEFAULT_ONNX_TOKENIZER_URI = "https://raw.githubusercontent.com/spring-projects/spring-ai/main/models/spring-ai-transformers/src/main/resources/onnx/all-MiniLM-L6-v2/tokenizer.json";
// ONNX generative for all-MiniLM-L6-v2 pre-trained transformer:
// https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2
public final static String DEFAULT_ONNX_MODEL_URI = "https://github.com/spring-projects/spring-ai/raw/main/models/spring-ai-transformers/src/main/resources/onnx/all-MiniLM-L6-v2/model.onnx";
public static final String DEFAULT_ONNX_MODEL_URI = "https://github.com/spring-projects/spring-ai/raw/main/models/spring-ai-transformers/src/main/resources/onnx/all-MiniLM-L6-v2/model.onnx";
public final static String DEFAULT_MODEL_OUTPUT_NAME = "last_hidden_state";
public static final String DEFAULT_MODEL_OUTPUT_NAME = "last_hidden_state";
private static final Log logger = LogFactory.getLog(TransformersEmbeddingModel.class);
private static final EmbeddingModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultEmbeddingModelObservationConvention();
private final static int EMBEDDING_AXIS = 1;
private static final int EMBEDDING_AXIS = 1;
/**
* Specifies what parts of the {@link Document}'s content and metadata will be used

View File

@@ -57,7 +57,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@EnabledIfEnvironmentVariable(named = "VERTEX_AI_GEMINI_LOCATION", matches = ".*")
public class VertexAiGeminiPaymentTransactionIT {
private final static Logger logger = LoggerFactory.getLogger(VertexAiGeminiPaymentTransactionIT.class);
private static final Logger logger = LoggerFactory.getLogger(VertexAiGeminiPaymentTransactionIT.class);
private static final Map<Transaction, Status> DATASET = Map.of(new Transaction("001"), new Status("pending"),
new Transaction("002"), new Status("approved"), new Transaction("003"), new Status("rejected"));

View File

@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
*/
public class ZhiPuAiImageModel implements ImageModel {
private final static Logger logger = LoggerFactory.getLogger(ZhiPuAiImageModel.class);
private static final Logger logger = LoggerFactory.getLogger(ZhiPuAiImageModel.class);
public final RetryTemplate retryTemplate;

View File

@@ -42,9 +42,9 @@ import org.springframework.util.CollectionUtils;
*/
public class SafeGuardAdvisor implements CallAroundAdvisor, StreamAroundAdvisor {
private final static String DEFAULT_FAILURE_RESPONSE = "I'm unable to respond to that due to sensitive content. Could we rephrase or discuss something else?";
private static final String DEFAULT_FAILURE_RESPONSE = "I'm unable to respond to that due to sensitive content. Could we rephrase or discuss something else?";
private final static int DEFAULT_ORDER = 0;
private static final int DEFAULT_ORDER = 0;
private final String failureResponse;

View File

@@ -36,7 +36,7 @@ import org.springframework.ai.model.ResponseMetadata;
*/
public class ChatResponseMetadata extends AbstractResponseMetadata implements ResponseMetadata {
private final static Logger logger = LoggerFactory.getLogger(ChatResponseMetadata.class);
private static final Logger logger = LoggerFactory.getLogger(ChatResponseMetadata.class);
private String id = ""; // Set to blank to preserve backward compat with previous

View File

@@ -47,7 +47,7 @@ import org.springframework.util.CollectionUtils;
*/
public abstract class AbstractToolCallSupport {
protected final static boolean IS_RUNTIME_CALL = true;
protected static final boolean IS_RUNTIME_CALL = true;
/**
* The function callback register is used to resolve the function callbacks by name.

View File

@@ -45,7 +45,7 @@ import org.springframework.util.StringUtils;
*/
public class DefaultFunctionCallbackBuilder implements FunctionCallback.Builder {
private final static Logger logger = LoggerFactory.getLogger(DefaultFunctionCallbackBuilder.class);
private static final Logger logger = LoggerFactory.getLogger(DefaultFunctionCallbackBuilder.class);
@Override
public <I, O> FunctionInvokingSpec<I, O> function(String name, Function<I, O> function) {

View File

@@ -36,15 +36,15 @@ import org.springframework.util.Assert;
*/
public class TokenTextSplitter extends TextSplitter {
private final static int DEFAULT_CHUNK_SIZE = 800;
private static final int DEFAULT_CHUNK_SIZE = 800;
private final static int MIN_CHUNK_SIZE_CHARS = 350;
private static final int MIN_CHUNK_SIZE_CHARS = 350;
private final static int MIN_CHUNK_LENGTH_TO_EMBED = 5;
private static final int MIN_CHUNK_LENGTH_TO_EMBED = 5;
private final static int MAX_NUM_CHUNKS = 10000;
private static final int MAX_NUM_CHUNKS = 10000;
private final static boolean KEEP_SEPARATOR = true;
private static final boolean KEEP_SEPARATOR = true;
private final EncodingRegistry registry = Encodings.newLazyEncodingRegistry();

View File

@@ -32,7 +32,7 @@ import org.springframework.util.Assert;
*/
public final class FilterHelper {
private final static Map<ExpressionType, ExpressionType> TYPE_NEGATION_MAP = Map.of(ExpressionType.AND,
private static final Map<ExpressionType, ExpressionType> TYPE_NEGATION_MAP = Map.of(ExpressionType.AND,
ExpressionType.OR, ExpressionType.OR, ExpressionType.AND, ExpressionType.EQ, ExpressionType.NE,
ExpressionType.NE, ExpressionType.EQ, ExpressionType.GT, ExpressionType.LTE, ExpressionType.GTE,
ExpressionType.LT, ExpressionType.LT, ExpressionType.GTE, ExpressionType.LTE, ExpressionType.GT,

View File

@@ -102,7 +102,7 @@ NOTE: For more information go to https://dataplatform.cloud.ibm.com/docs/content
----
public class MyClass {
private final static String MODEL = "google/flan-ul2";
private static final String MODEL = "google/flan-ul2";
private final WatsonxAiChatModel chatModel;
@Autowired

View File

@@ -62,7 +62,7 @@ import org.springframework.util.StringUtils;
AzureOpenAiAudioTranscriptionProperties.class })
public class AzureOpenAiAutoConfiguration {
private final static String APPLICATION_ID = "spring-ai";
private static final String APPLICATION_ID = "spring-ai";
@Bean
@ConditionalOnMissingBean // ({ OpenAIClient.class, TokenCredential.class })

View File

@@ -50,7 +50,7 @@ import org.springframework.context.annotation.Bean;
@ConditionalOnProperty(prefix = "spring.ai.vectorstore.azure", value = { "url", "api-key", "index-name" })
public class AzureVectorStoreAutoConfiguration {
private final static String APPLICATION_ID = "spring-ai";
private static final String APPLICATION_ID = "spring-ai";
@Bean
@ConditionalOnMissingBean