Upgrade to Java 8 source and target baseline
This commit is contained in:
@@ -11,8 +11,8 @@ apply from: IDE_GRADLE
|
||||
|
||||
group = 'org.springframework.session'
|
||||
|
||||
sourceCompatibility = 1.5
|
||||
targetCompatibility = 1.5
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
ext.springIoVersion = project.hasProperty('platformVersion') ? platformVersion : 'Cairo-BUILD-SNAPSHOT'
|
||||
|
||||
@@ -29,6 +29,7 @@ ext.jstlDependencies = [
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://repo.spring.io/libs-snapshot' }
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
|
||||
@@ -68,6 +68,10 @@ public class UserRepositoryUserDetailsService implements UserDetailsService {
|
||||
return AuthorityUtils.createAuthorityList("ROLE_USER");
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return getUsername();
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return getEmail();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
package sample.websocket;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Optional;
|
||||
|
||||
import sample.data.ActiveWebSocketUser;
|
||||
import sample.data.ActiveWebSocketUserRepository;
|
||||
@@ -42,14 +44,11 @@ public class WebSocketDisconnectHandler<S>
|
||||
if (id == null) {
|
||||
return;
|
||||
}
|
||||
ActiveWebSocketUser user = this.repository.findOne(id);
|
||||
if (user == null) {
|
||||
return;
|
||||
Optional<ActiveWebSocketUser> user = this.repository.findOne(id);
|
||||
if (user.isPresent()) {
|
||||
this.repository.delete(id);
|
||||
this.messagingTemplate.convertAndSend("/topic/friends/signout",
|
||||
Collections.singleton(user.map(ActiveWebSocketUser::getUsername)));
|
||||
}
|
||||
|
||||
this.repository.delete(id);
|
||||
this.messagingTemplate.convertAndSend("/topic/friends/signout",
|
||||
Arrays.asList(user.getUsername()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user