Roberto Sánchez
2014-09-18 a4b1e4c32927208e92ca9895fa780e18051d3932
src/main/java/net/curisit/securis/utils/JsonUtils.java
....@@ -22,7 +22,7 @@
2222 */
2323 public class JsonUtils {
2424
25
- private static final Logger log = LogManager.getLogger(JsonUtils.class);
25
+ private static final Logger LOG = LogManager.getLogger(JsonUtils.class);
2626
2727 final private static ObjectMapper MAPPER = new ObjectMapper();
2828
....@@ -58,12 +58,12 @@
5858 }
5959 return MAPPER.readValue(json, type);
6060 } catch (JsonParseException e) {
61
- log.error("Error parsing JSON string to obejct: {}", json, e);
61
+ LOG.error("Error parsing JSON string to obejct: {}", json, e);
6262 if (json.length() > 60)
6363 json = json.substring(0, 50) + "...";
6464 throw new SeCurisException("Error parsing JSON string to object: " + json, e);
6565 } catch (IOException e) {
66
- log.error("Error parsing JSON string to object: {}", json, e);
66
+ LOG.error("Error parsing JSON string to object: {}", json, e);
6767 if (json.length() > 60)
6868 json = json.substring(0, 50) + "...";
6969 throw new SeCurisException("Error parsing JSON string to object: " + json, e);
....@@ -85,10 +85,10 @@
8585 }
8686 return MAPPER.writeValueAsString(obj);
8787 } catch (JsonProcessingException e) {
88
- log.error("Error formating JSON from object: {}", obj, e);
88
+ LOG.error("Error formating JSON from object: {}", obj, e);
8989 throw new SeCurisException("Error formating JSON from object: " + obj, e);
9090 } catch (IOException e) {
91
- log.error("Error formating JSON from object: {}", obj, e);
91
+ LOG.error("Error formating JSON from object: {}", obj, e);
9292 throw new SeCurisException("Error formating JSON from object: " + obj, e);
9393 }
9494 }
....@@ -111,10 +111,10 @@
111111 MAPPER.disable(SerializationConfig.Feature.INDENT_OUTPUT);
112112 return json;
113113 } catch (JsonProcessingException e) {
114
- log.error("Error formating JSON from object: {}", obj, e);
114
+ LOG.error("Error formating JSON from object: {}", obj, e);
115115 throw new SeCurisException("Error formating JSON from object: " + obj, e);
116116 } catch (IOException e) {
117
- log.error("Error formating JSON from object: {}", obj, e);
117
+ LOG.error("Error formating JSON from object: {}", obj, e);
118118 throw new SeCurisException("Error formating JSON from object: " + obj, e);
119119 }
120120 }
....@@ -137,10 +137,10 @@
137137 }
138138 return MAPPER.readValue(json, Map.class);
139139 } catch (JsonParseException e) {
140
- log.error("Error parsing JSON string to map: {}", json, e);
140
+ LOG.error("Error parsing JSON string to map: {}", json, e);
141141 throw e;
142142 } catch (IOException e) {
143
- log.error("Error parsing JSON string to map: {}", json, e);
143
+ LOG.error("Error parsing JSON string to map: {}", json, e);
144144 }
145145 return null;
146146 }
....@@ -160,9 +160,9 @@
160160 }
161161 return MAPPER.writeValueAsString(map);
162162 } catch (JsonProcessingException e) {
163
- log.error("Error formating JSON from map: {}", map, e);
163
+ LOG.error("Error formating JSON from map: {}", map, e);
164164 } catch (IOException e) {
165
- log.error("Error formating JSON from map: {}", map, e);
165
+ LOG.error("Error formating JSON from map: {}", map, e);
166166 }
167167
168168 return null;
....@@ -182,10 +182,10 @@
182182 try {
183183 return MAPPER.readValue(json, List.class);
184184 } catch (JsonParseException e) {
185
- log.error("Error converting JSON string to object {}", json, e);
185
+ LOG.error("Error converting JSON string to object {}", json, e);
186186 throw new SeCurisException("Error converting JSON to object", e);
187187 } catch (IOException e) {
188
- log.error("Error converting JSON string to object {}", json, e);
188
+ LOG.error("Error converting JSON string to object {}", json, e);
189189 throw new SeCurisException("Error converting JSON to object", e);
190190 }
191191 }
....@@ -206,7 +206,7 @@
206206 } catch (JsonParseException e) {
207207 throw new SeCurisException("Error converting JSON to object", e);
208208 } catch (IOException e) {
209
- log.error("Error converting JSON to object", e);
209
+ LOG.error("Error converting JSON to object", e);
210210 throw new SeCurisException("Error converting JSON to object", e);
211211 }
212212 }