Skip to content

Commit 6634fd4

Browse files
committed
Added package-info.java to every module package
1 parent e79cde2 commit 6634fd4

File tree

106 files changed

+390
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+390
-117
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package io.w4t3rcs.python.condition;
3+
4+
import org.jspecify.annotations.NullMarked;

cache/spring-boot-python-executor-cache-autoconfigure/src/main/java/io/w4t3rcs/python/config/PythonCacheAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.fasterxml.jackson.databind.ObjectMapper;
44
import io.w4t3rcs.python.cache.CacheKeyGenerator;
5-
import io.w4t3rcs.python.cache.impl.HashCacheKeyGenerator;
5+
import io.w4t3rcs.python.cache.HashCacheKeyGenerator;
66
import io.w4t3rcs.python.condition.ExecutorCacheLevelCondition;
77
import io.w4t3rcs.python.condition.FileCacheLevelCondition;
88
import io.w4t3rcs.python.condition.ProcessorCacheLevelCondition;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package io.w4t3rcs.python.config;
3+
4+
import org.jspecify.annotations.NullMarked;

cache/spring-boot-python-executor-cache/src/main/java/io/w4t3rcs/python/cache/CacheKeyGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.w4t3rcs.python.cache;
22

3-
import io.w4t3rcs.python.cache.impl.HashCacheKeyGenerator;
3+
import org.jspecify.annotations.Nullable;
44

55
/**
66
* Interface for generating cache keys with optional prefix and suffix.
@@ -46,7 +46,7 @@ default String generateKey(String body) {
4646
* @param suffix an optional suffix object to append to the key; may be null.
4747
* @return a non-null generated cache key string.
4848
*/
49-
default String generateKey(String body, Object suffix) {
49+
default String generateKey(String body, @Nullable Object suffix) {
5050
return this.generateKey(null, body, suffix);
5151
}
5252

@@ -57,7 +57,7 @@ default String generateKey(String body, Object suffix) {
5757
* @param body non-null string representing the main part of the key.
5858
* @return a non-null generated cache key string.
5959
*/
60-
default String generateKey(Object prefix, String body) {
60+
default String generateKey(@Nullable Object prefix, String body) {
6161
return this.generateKey(prefix, body, null);
6262
}
6363

@@ -73,5 +73,5 @@ default String generateKey(Object prefix, String body) {
7373
* @param suffix an optional suffix object to append to the key; may be null.
7474
* @return a non-null generated cache key string.
7575
*/
76-
String generateKey(Object prefix, String body, Object suffix);
76+
String generateKey(@Nullable Object prefix, String body, @Nullable Object suffix);
7777
}

cache/spring-boot-python-executor-cache/src/main/java/io/w4t3rcs/python/cache/impl/HashCacheKeyGenerator.java renamed to cache/spring-boot-python-executor-cache/src/main/java/io/w4t3rcs/python/cache/HashCacheKeyGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package io.w4t3rcs.python.cache.impl;
1+
package io.w4t3rcs.python.cache;
22

3-
import io.w4t3rcs.python.cache.CacheKeyGenerator;
43
import io.w4t3rcs.python.exception.CacheKeyGenerationException;
54
import io.w4t3rcs.python.executor.CachingPythonExecutor;
65
import io.w4t3rcs.python.file.CachingPythonFileReader;
76
import io.w4t3rcs.python.processor.CachingPythonProcessor;
87
import io.w4t3rcs.python.properties.PythonCacheProperties;
98
import io.w4t3rcs.python.resolver.CachingPythonResolverHolder;
109
import lombok.RequiredArgsConstructor;
10+
import org.jspecify.annotations.Nullable;
1111

1212
import java.security.MessageDigest;
1313
import java.util.Base64;
@@ -71,7 +71,7 @@ public class HashCacheKeyGenerator implements CacheKeyGenerator {
7171
* @throws CacheKeyGenerationException if hashing fails due to unsupported algorithm or encoding.
7272
*/
7373
@Override
74-
public String generateKey(Object prefix, String body, Object suffix) {
74+
public String generateKey(@Nullable Object prefix, String body, @Nullable Object suffix) {
7575
try {
7676
var keyProperties = cacheProperties.key();
7777
MessageDigest digest = MessageDigest.getInstance(keyProperties.hashAlgorithm());
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package io.w4t3rcs.python.cache;
3+
4+
import org.jspecify.annotations.NullMarked;

cache/spring-boot-python-executor-cache/src/main/java/io/w4t3rcs/python/exception/CacheKeyGenerationException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.w4t3rcs.python.exception;
22

33
import io.w4t3rcs.python.cache.CacheKeyGenerator;
4-
import io.w4t3rcs.python.cache.impl.HashCacheKeyGenerator;
4+
import io.w4t3rcs.python.cache.HashCacheKeyGenerator;
55

66
/**
77
* Runtime exception thrown when cache key generation fails.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package io.w4t3rcs.python.exception;
3+
4+
import org.jspecify.annotations.NullMarked;

cache/spring-boot-python-executor-cache/src/main/java/io/w4t3rcs/python/executor/CachingPythonExecutor.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package io.w4t3rcs.python.executor;
22

33
import io.w4t3rcs.python.cache.CacheKeyGenerator;
4-
import io.w4t3rcs.python.dto.PythonExecutionResponse;
54
import io.w4t3rcs.python.exception.PythonCacheException;
65
import io.w4t3rcs.python.properties.PythonCacheProperties;
6+
import io.w4t3rcs.python.response.PythonExecutionResponse;
77
import io.w4t3rcs.python.script.PythonScript;
8+
import org.jspecify.annotations.Nullable;
89
import org.springframework.cache.Cache;
910
import org.springframework.cache.CacheManager;
1011

12+
import java.util.Objects;
13+
1114
/**
1215
* {@link PythonExecutor} implementation that adds caching capabilities.
1316
* <p>
@@ -49,7 +52,7 @@ public class CachingPythonExecutor implements PythonExecutor {
4952
*/
5053
public CachingPythonExecutor(PythonCacheProperties cacheProperties, PythonExecutor pythonExecutor, CacheManager cacheManager, CacheKeyGenerator keyGenerator) {
5154
this.pythonExecutor = pythonExecutor;
52-
this.cache = cacheManager.getCache(cacheProperties.name().executor());
55+
this.cache = Objects.requireNonNull(cacheManager.getCache(cacheProperties.name().executor()));
5356
this.keyGenerator = keyGenerator;
5457
}
5558

@@ -66,13 +69,13 @@ public CachingPythonExecutor(PythonCacheProperties cacheProperties, PythonExecut
6669
*
6770
* @param <R> the expected body type
6871
* @param script non-null Python script to execute
69-
* @param resultClass non-null {@link Class} representing the expected body type
72+
* @param resultClass nullable {@link Class} representing the expected body type
7073
* @return the execution body, guaranteed non-null if the delegate returns non-null
7174
* @throws PythonCacheException if any caching or execution error occurs
7275
*/
7376
@Override
7477
@SuppressWarnings("unchecked")
75-
public <R> PythonExecutionResponse<R> execute(PythonScript script, Class<? extends R> resultClass) {
78+
public <R> PythonExecutionResponse<R> execute(PythonScript script, @Nullable Class<? extends R> resultClass) {
7679
try {
7780
String scriptBody = script.toString();
7881
String key = keyGenerator.generateKey(scriptBody, resultClass);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@NullMarked
2+
package io.w4t3rcs.python.executor;
3+
4+
import org.jspecify.annotations.NullMarked;

0 commit comments

Comments
 (0)