Upgrade to Java 8 source and target baseline

This commit is contained in:
John Blum
2017-04-21 23:19:01 -07:00
parent 887f024551
commit 83e5d6f2a7
3 changed files with 14 additions and 10 deletions

View File

@@ -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 {

View File

@@ -68,6 +68,10 @@ public class UserRepositoryUserDetailsService implements UserDetailsService {
return AuthorityUtils.createAuthorityList("ROLE_USER");
}
public String getName() {
return getUsername();
}
public String getUsername() {
return getEmail();
}

View File

@@ -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()));
}
}