diff options
author | Alexander Alexeev | 2016-11-30 15:10:15 +0700 |
---|---|---|
committer | Alexander Alexeev | 2016-11-30 15:10:15 +0700 |
commit | 1d837a835c04078ec66325e9fb9de21ac401874e (patch) | |
tree | 428217d2c617b9caf2eb6d42a7716789881d0937 /juick-www/src/main/java/com/juick/www/VKontakteLogin.java | |
parent | b45c000ed478f2407288aab1532425288f998689 (diff) |
prevent string concatenation for disabled loggers
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/VKontakteLogin.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/VKontakteLogin.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java index 55dfd202..6b1d4571 100644 --- a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java +++ b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java @@ -20,7 +20,8 @@ package com.juick.www; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; import com.juick.server.UserQueries; -import com.juick.www.vk.*; +import com.juick.www.vk.Token; +import com.juick.www.vk.UsersResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.EmptyResultDataAccessException; @@ -35,7 +36,6 @@ import java.net.URLEncoder; import java.util.UUID; /** - * * @author Ugnich Anton */ public class VKontakteLogin { @@ -50,6 +50,7 @@ public class VKontakteLogin { mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT); } + private final ObjectMapper mapper; protected void doGet(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -73,13 +74,11 @@ public class VKontakteLogin { token = json.getAccessToken(); vkID = json.getUserId(); if (token == null || vkID == 0) { - logger.error("VK TOKEN EMPTY: " + tokenjson); + logger.error("VK TOKEN EMPTY: {}", tokenjson); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } - - String graph = Utils.fetchURL("https://api.vk.com/method/users.get?uids=" + vkID + "&fields=screen_name&access_token=" + token); if (graph == null || graph.isEmpty()) { logger.error("VK GRAPH ERROR"); |