Skip to content

Commit 708a5ec

Browse files
committed
Cleanup code style.
1 parent 9deb58c commit 708a5ec

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/com/radiadesign/catalina/session/RedisSessionManager.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static SessionPersistPolicy fromName(String name) {
6060
protected String password = null;
6161
protected int timeout = Protocol.DEFAULT_TIMEOUT;
6262
protected String sentinelMaster = null;
63-
protected String sentinels = null;
6463
Set<String> sentinelSet = null;
6564

6665
protected Pool<Jedis> connectionPool;
@@ -158,7 +157,14 @@ public boolean getAlwaysSaveAfterRequest() {
158157
}
159158

160159
public String getSentinels() {
161-
return sentinels;
160+
StringBuilder sentinels = new StringBuilder();
161+
for (Iterator<String> iter = this.sentinelSet.iterator(); iter.hasNext();) {
162+
sentinels.append(iter.next());
163+
if (iter.hasNext()) {
164+
sentinels.append(",");
165+
}
166+
}
167+
return sentinels.toString();
162168
}
163169

164170
public void setSentinels(String sentinels) {
@@ -168,8 +174,6 @@ public void setSentinels(String sentinels) {
168174

169175
String[] sentinelArray = getSentinels().split(",");
170176
this.sentinelSet = new HashSet<String>(Arrays.asList(sentinelArray));
171-
172-
this.sentinels = sentinels;
173177
}
174178

175179
public Set<String> getSentinelSet() {

0 commit comments

Comments
 (0)