Skip to content

Commit 1c48021

Browse files
DATAREDIS-1030 - Polishing.
Update Javadoc and remove superfluous afterPropertiesSet call. Original Pull Request: #473
1 parent 85669e6 commit 1c48021

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/main/java/org/springframework/data/redis/core/script/DefaultRedisScript.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public class DefaultRedisScript<T> implements RedisScript<T>, InitializingBean {
4646
/**
4747
* Creates a new {@link DefaultRedisScript}
4848
*/
49-
public DefaultRedisScript() {
50-
}
49+
public DefaultRedisScript() {}
5150

5251
/**
5352
* Creates a new {@link DefaultRedisScript}
@@ -117,9 +116,9 @@ public String getScriptAsString() {
117116

118117
/**
119118
* @param resultType The script result type. Should be one of Long, Boolean, List, or deserialized value type. Can be
120-
* null if the script returns a throw-away status (i.e "OK")
119+
* {@literal null} if the script returns a throw-away status (i.e "OK")
121120
*/
122-
public void setResultType(Class<T> resultType) {
121+
public void setResultType(@Nullable Class<T> resultType) {
123122
this.resultType = resultType;
124123
}
125124

src/main/java/org/springframework/data/redis/core/script/RedisScript.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ static <T> RedisScript of(String script, Class<T> resultType) {
8484
}
8585

8686
/**
87-
* Creates new {@link RedisScript} from {@link Resource}.
87+
* Creates new {@link RedisScript} (with throw away result) from the given {@link Resource}.
8888
*
8989
* @param resource must not be {@literal null}.
9090
* @return new instance of {@link RedisScript}.
91+
* @throws IllegalArgumentException if the required argument is {@literal null}.
9192
* @since 2.2
9293
*/
9394
static <T> RedisScript<T> of(Resource resource) {
@@ -96,7 +97,6 @@ static <T> RedisScript<T> of(Resource resource) {
9697

9798
DefaultRedisScript<T> script = new DefaultRedisScript<>();
9899
script.setLocation(resource);
99-
script.afterPropertiesSet();
100100

101101
return script;
102102
}
@@ -107,6 +107,7 @@ static <T> RedisScript<T> of(Resource resource) {
107107
* @param resource must not be {@literal null}.
108108
* @param resultType must not be {@literal null}.
109109
* @return new instance of {@link RedisScript}.
110+
* @throws IllegalArgumentException if any required argument is {@literal null}.
110111
* @since 2.2
111112
*/
112113
static <T> RedisScript<T> of(Resource resource, Class<T> resultType) {
@@ -117,7 +118,6 @@ static <T> RedisScript<T> of(Resource resource, Class<T> resultType) {
117118
DefaultRedisScript<T> script = new DefaultRedisScript<>();
118119
script.setResultType(resultType);
119120
script.setLocation(resource);
120-
script.afterPropertiesSet();
121121

122122
return script;
123123
}

0 commit comments

Comments
 (0)