@@ -87,19 +87,16 @@ public List<User> filterUsers(String filter) {
87
87
if (d == null || !d .containsKey ("username" )) continue ;
88
88
User u = new User ();
89
89
u .setUsername (d .get ("username" ).toString ());
90
- if (d .containsKey ("realname" )) {
91
- if (d .get ("realname" ) != null ) {
92
- u .setRealname (d .get ("realname" ).toString ());
93
- }
94
- }
95
- if (d .containsKey ("thumbnail" )) {
96
- if (d .get ("thumbnail" ) != null ) {
97
- u .setThumbnail (d .get ("thumbnail" ).toString ());
98
- }
99
- }
100
- //System.out.println(u);
101
- users .add (u );
102
- }
90
+
91
+ if (d .containsKey ("realname" ) && d .get ("realname" ) != null ) {
92
+ u .setRealname (d .get ("realname" ).toString ());
93
+ }
94
+ if (d .containsKey ("thumbnail" ) && d .get ("thumbnail" ) != null ) {
95
+ u .setThumbnail (d .get ("thumbnail" ).toString ());
96
+ }
97
+
98
+ users .add (u );
99
+ }
103
100
return users ;
104
101
}
105
102
@@ -190,11 +187,17 @@ private Document createMergedProfile(String username, JsonNode profileNode) {
190
187
public UserProfile getProfile (String username ) {
191
188
Document query = new Document ("user.username" , username );
192
189
Document result = profiles .find (query ).first ();
193
- if (result == null ) return null ;
190
+ if (result == null ) {
191
+ return null ;
192
+ }
194
193
Document dbUser = result .get ("user" , Document .class );
195
194
User user = new User ().withUsername (dbUser .get ("username" ).toString ());
196
- if (dbUser .get ("realname" ) != null ) user .setRealname (dbUser .get ("realname" ).toString ());
197
- if (dbUser .get ("thumbnail" ) != null ) user .setThumbnail (dbUser .get ("thumbnail" ).toString ());
195
+ if (dbUser .get ("realname" ) != null ) {
196
+ user .setRealname (dbUser .get ("realname" ).toString ());
197
+ }
198
+ if (dbUser .get ("thumbnail" ) != null ) {
199
+ user .setThumbnail (dbUser .get ("thumbnail" ).toString ());
200
+ }
198
201
199
202
UserProfile up = new UserProfile ().withUser (user );
200
203
Document profile = result .get ("profile" , Document .class );
0 commit comments