|
1 | 1 | /*
|
2 |
| - * Copyright 2014-2016 the original author or authors. |
| 2 | + * Copyright 2014-2022 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
16 | 16 |
|
17 | 17 | package org.springframework.session.data.mongo;
|
18 | 18 |
|
19 |
| -import org.springframework.lang.Nullable; |
20 |
| -import org.springframework.session.Session; |
21 |
| - |
22 | 19 | import java.time.Duration;
|
23 | 20 | import java.time.Instant;
|
24 |
| -import java.util.*; |
| 21 | +import java.util.Date; |
| 22 | +import java.util.HashMap; |
| 23 | +import java.util.Map; |
| 24 | +import java.util.Objects; |
| 25 | +import java.util.Set; |
| 26 | +import java.util.UUID; |
25 | 27 | import java.util.stream.Collectors;
|
26 | 28 |
|
| 29 | +import org.springframework.lang.Nullable; |
| 30 | +import org.springframework.session.Session; |
| 31 | + |
27 | 32 | /**
|
28 | 33 | * Session object providing additional information about the datetime of expiration.
|
29 | 34 | *
|
|
34 | 39 | public class MongoSession implements Session {
|
35 | 40 |
|
36 | 41 | /**
|
37 |
| - * Mongo doesn't support {@literal dot} in field names. We replace it with a unicode character from the Private Use Area. |
| 42 | + * Mongo doesn't support {@literal dot} in field names. We replace it with a unicode |
| 43 | + * character from the Private Use Area. |
38 | 44 | * <p>
|
39 |
| - * NOTE: This was originally stored in unicode format. Delomboking the code caused it to get converted to another encoding, |
40 |
| - * which isn't supported on all systems, so we migrated back to unicode. The same character is being represented ensuring |
41 |
| - * binary compatibility. |
| 45 | + * NOTE: This was originally stored in unicode format. Delomboking the code caused it |
| 46 | + * to get converted to another encoding, which isn't supported on all systems, so we |
| 47 | + * migrated back to unicode. The same character is being represented ensuring binary |
| 48 | + * compatibility. |
42 | 49 | *
|
43 |
| - * @see https://www.compart.com/en/unicode/U+F607 |
| 50 | + * See https://www.compart.com/en/unicode/U+F607 |
44 | 51 | */
|
45 | 52 | private static final char DOT_COVER_CHAR = '\uF607';
|
46 | 53 |
|
@@ -106,7 +113,8 @@ public void setAttribute(String attributeName, Object attributeValue) {
|
106 | 113 |
|
107 | 114 | if (attributeValue == null) {
|
108 | 115 | removeAttribute(coverDot(attributeName));
|
109 |
| - } else { |
| 116 | + } |
| 117 | + else { |
110 | 118 | this.attrs.put(coverDot(attributeName), attributeValue);
|
111 | 119 | }
|
112 | 120 | }
|
|
0 commit comments