Skip to content

Commit

Permalink
hazelcast#3767 Unnecessary object instantiation removed.
Browse files Browse the repository at this point in the history
Thanks to @cmuramoto for pointing this out!
  • Loading branch information
jerrinot committed Oct 7, 2014
1 parent 28b2a6e commit eff5c54
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
*/
public class InvalidateSessionAttributesEntryProcessor extends AbstractWebDataEntryProcessor<Object> {

private String sessionId;
private String sessionIdWithAttributeSeparator;

// Serialization Constructor
public InvalidateSessionAttributesEntryProcessor() {
}

public InvalidateSessionAttributesEntryProcessor(String sessionId) {
this.sessionId = sessionId;
this.sessionIdWithAttributeSeparator = sessionId + WebFilter.HAZELCAST_SESSION_ATTRIBUTE_SEPARATOR;
}

@Override
Expand All @@ -48,7 +48,7 @@ public Object process(Entry<String, Object> entry) {
Object key = entry.getKey();
if (key instanceof String) {
String k = (String) key;
if (k.startsWith(sessionId + WebFilter.HAZELCAST_SESSION_ATTRIBUTE_SEPARATOR)) {
if (k.startsWith(sessionIdWithAttributeSeparator)) {
entry.setValue(null);
}
}
Expand All @@ -57,11 +57,11 @@ public Object process(Entry<String, Object> entry) {

@Override
public void readData(ObjectDataInput in) throws IOException {
sessionId = in.readUTF();
sessionIdWithAttributeSeparator = in.readUTF();
}

@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(sessionId);
out.writeUTF(sessionIdWithAttributeSeparator);
}
}

0 comments on commit eff5c54

Please sign in to comment.