Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public String getValue() {

}

public final static class Builder {
public static final class Builder {

private final AzureOpenAiImageOptions options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public static Builder builder() {
return new Builder();
}

public final static class Builder {
public static final class Builder {

private String role;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*/
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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
@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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*/
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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
@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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
*/
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*/
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public ChatOptions build() {
return this.options;
}

private final static class DefaultChatOptions implements ChatOptions {
private static final class DefaultChatOptions implements ChatOptions {

private String model;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static Builder builder() {
return new Builder();
}

public final static class Builder {
public static final class Builder {

private List<DocumentRetriever> documentRetrievers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
*/
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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
@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
Expand Down
Loading