|
18 | 18 | */ |
19 | 19 | package org.netbeans.modules.php.editor.model.impl; |
20 | 20 |
|
21 | | -import com.fasterxml.jackson.annotation.JsonIgnore; |
22 | | -import com.fasterxml.jackson.annotation.JsonProperty; |
23 | | -import com.fasterxml.jackson.core.JsonProcessingException; |
24 | | -import com.fasterxml.jackson.core.type.TypeReference; |
25 | | -import com.fasterxml.jackson.databind.ObjectMapper; |
26 | 21 | import java.util.ArrayList; |
27 | 22 | import java.util.Collection; |
28 | 23 | import java.util.List; |
@@ -57,21 +52,21 @@ public class PropertyHookSignatureItem { |
57 | 52 | private static final Logger LOGGER = Logger.getLogger(PropertyHookSignatureItem.class.getName()); |
58 | 53 | private static final String EMPTY_ARRAY = "[]"; // NOI18N |
59 | 54 |
|
60 | | - @JsonProperty("name") |
| 55 | +// @JsonProperty("name") |
61 | 56 | private String name; |
62 | | - @JsonProperty("start") |
| 57 | +// @JsonProperty("start") |
63 | 58 | private int start; |
64 | | - @JsonProperty("end") |
| 59 | +// @JsonProperty("end") |
65 | 60 | private int end; |
66 | | - @JsonProperty("mod") |
| 61 | +// @JsonProperty("mod") |
67 | 62 | private int mod; |
68 | | - @JsonProperty("isRef") |
| 63 | +// @JsonProperty("isRef") |
69 | 64 | private boolean isRef; |
70 | | - @JsonProperty("isAttr") |
| 65 | +// @JsonProperty("isAttr") |
71 | 66 | private boolean isAttr; |
72 | | - @JsonProperty("hasBody") |
| 67 | +// @JsonProperty("hasBody") |
73 | 68 | private boolean hasBody; |
74 | | - @JsonProperty("paramSig") |
| 69 | +// @JsonProperty("paramSig") |
75 | 70 | private String paramSig; |
76 | 71 |
|
77 | 72 | // need a default constructor for jackson |
@@ -142,15 +137,15 @@ public static String getSignatureFromScopes(Collection<? extends PropertyHookSco |
142 | 137 | List<PropertyHookSignatureItem> signatureItems = getSignatureItemsFromScopes(propertyHookScopes); |
143 | 138 | String signature = EMPTY_ARRAY; |
144 | 139 | if (!signatureItems.isEmpty()) { |
145 | | - try { |
146 | | - ObjectMapper mapper = new ObjectMapper(); |
147 | | - signature = mapper.writeValueAsString(signatureItems); |
148 | | - } catch (JsonProcessingException ex) { |
149 | | - LOGGER.log(Level.WARNING, "Cannot serialize: {0}, {1}", new Object[]{signatureItems, ex.getMessage()}); // NOI18N |
150 | | - } |
151 | | - if (LOGGER.isLoggable(Level.FINE)) { |
152 | | - LOGGER.log(Level.FINE, "getSignatureFromScopes() took: {0} ms", (System.currentTimeMillis() - start)); // NOI18N |
153 | | - } |
| 140 | +// try { |
| 141 | +// ObjectMapper mapper = new ObjectMapper(); |
| 142 | +// signature = mapper.writeValueAsString(signatureItems); |
| 143 | +// } catch (JsonProcessingException ex) { |
| 144 | +// LOGGER.log(Level.WARNING, "Cannot serialize: {0}, {1}", new Object[]{signatureItems, ex.getMessage()}); // NOI18N |
| 145 | +// } |
| 146 | +// if (LOGGER.isLoggable(Level.FINE)) { |
| 147 | +// LOGGER.log(Level.FINE, "getSignatureFromScopes() took: {0} ms", (System.currentTimeMillis() - start)); // NOI18N |
| 148 | +// } |
154 | 149 | } |
155 | 150 | return signature; |
156 | 151 | } |
@@ -180,15 +175,15 @@ public static String getSignatureFromElements(Collection<? extends PropertyHookE |
180 | 175 | List<PropertyHookSignatureItem> signatureItems = getSignatureItemsFromElements(propertyHookElements); |
181 | 176 | String signature = EMPTY_ARRAY; |
182 | 177 | if (!signatureItems.isEmpty()) { |
183 | | - try { |
184 | | - ObjectMapper mapper = new ObjectMapper(); |
185 | | - signature = mapper.writeValueAsString(signatureItems); |
186 | | - } catch (JsonProcessingException ex) { |
187 | | - LOGGER.log(Level.WARNING, "Cannot serialize: {0}, {1}", new Object[]{signatureItems, ex.getMessage()}); // NOI18N |
188 | | - } |
189 | | - if (LOGGER.isLoggable(Level.FINE)) { |
190 | | - LOGGER.log(Level.FINE, "getSignatureFromElements() took: {0} ms", (System.currentTimeMillis() - start)); // NOI18N |
191 | | - } |
| 178 | +// try { |
| 179 | +// ObjectMapper mapper = new ObjectMapper(); |
| 180 | +// signature = mapper.writeValueAsString(signatureItems); |
| 181 | +// } catch (JsonProcessingException ex) { |
| 182 | +// LOGGER.log(Level.WARNING, "Cannot serialize: {0}, {1}", new Object[]{signatureItems, ex.getMessage()}); // NOI18N |
| 183 | +// } |
| 184 | +// if (LOGGER.isLoggable(Level.FINE)) { |
| 185 | +// LOGGER.log(Level.FINE, "getSignatureFromElements() took: {0} ms", (System.currentTimeMillis() - start)); // NOI18N |
| 186 | +// } |
192 | 187 | } |
193 | 188 | return signature; |
194 | 189 | } |
@@ -220,61 +215,61 @@ public static List<PropertyHookSignatureItem> fromSignature(final String signatu |
220 | 215 |
|
221 | 216 | final long start = (LOGGER.isLoggable(Level.FINE)) ? System.currentTimeMillis() : 0; |
222 | 217 | List<PropertyHookSignatureItem> signatureItems = List.of(); |
223 | | - try { |
224 | | - ObjectMapper mapper = new ObjectMapper(); |
225 | | - signatureItems = mapper.readValue(signature, new TypeReference<List<PropertyHookSignatureItem>>() {}); |
226 | | - } catch (JsonProcessingException ex) { |
227 | | - LOGGER.log(Level.WARNING, |
228 | | - "Cannot deserialize: {0}, {1} (please try to delete your cache directory because the signature may be changed.)", // NOI18N |
229 | | - new Object[]{signature, ex.getMessage()}); |
230 | | - } |
| 218 | +// try { |
| 219 | +// ObjectMapper mapper = new ObjectMapper(); |
| 220 | +// signatureItems = mapper.readValue(signature, new TypeReference<List<PropertyHookSignatureItem>>() {}); |
| 221 | +// } catch (JsonProcessingException ex) { |
| 222 | +// LOGGER.log(Level.WARNING, |
| 223 | +// "Cannot deserialize: {0}, {1} (please try to delete your cache directory because the signature may be changed.)", // NOI18N |
| 224 | +// new Object[]{signature, ex.getMessage()}); |
| 225 | +// } |
231 | 226 | if (LOGGER.isLoggable(Level.FINE)) { |
232 | 227 | LOGGER.log(Level.FINE, "fromSignature() took: {0} ms", (System.currentTimeMillis() - start)); // NOI18N |
233 | 228 | } |
234 | 229 | return signatureItems; |
235 | 230 | } |
236 | 231 |
|
237 | | - @JsonIgnore |
| 232 | +// @JsonIgnore |
238 | 233 | public String getName() { |
239 | 234 | return name; |
240 | 235 | } |
241 | 236 |
|
242 | | - @JsonIgnore |
| 237 | +// @JsonIgnore |
243 | 238 | public OffsetRange getOffsetRange() { |
244 | 239 | return new OffsetRange(start, end); |
245 | 240 | } |
246 | 241 |
|
247 | | - @JsonIgnore |
| 242 | +// @JsonIgnore |
248 | 243 | public int getStart() { |
249 | 244 | return start; |
250 | 245 | } |
251 | 246 |
|
252 | | - @JsonIgnore |
| 247 | +// @JsonIgnore |
253 | 248 | public int getEnd() { |
254 | 249 | return end; |
255 | 250 | } |
256 | 251 |
|
257 | | - @JsonIgnore |
| 252 | +// @JsonIgnore |
258 | 253 | public int getModifier() { |
259 | 254 | return mod; |
260 | 255 | } |
261 | 256 |
|
262 | | - @JsonIgnore |
| 257 | +// @JsonIgnore |
263 | 258 | public boolean isAttributed() { |
264 | 259 | return isAttr; |
265 | 260 | } |
266 | 261 |
|
267 | | - @JsonIgnore |
| 262 | +// @JsonIgnore |
268 | 263 | public boolean isReference() { |
269 | 264 | return isRef; |
270 | 265 | } |
271 | 266 |
|
272 | | - @JsonIgnore |
| 267 | +// @JsonIgnore |
273 | 268 | public boolean hasBody() { |
274 | 269 | return hasBody; |
275 | 270 | } |
276 | 271 |
|
277 | | - @JsonIgnore |
| 272 | +// @JsonIgnore |
278 | 273 | public String getParameterSignature() { |
279 | 274 | return paramSig; |
280 | 275 | } |
|
0 commit comments