Merge pull request #312 from AlexYursha/master
Enable Jackson users to strip security-sensitive data from parser errors.
diff --git a/src/main/java/com/fasterxml/jackson/core/JsonProcessingException.java b/src/main/java/com/fasterxml/jackson/core/JsonProcessingException.java
index 44be053..fbaf4c7 100644
--- a/src/main/java/com/fasterxml/jackson/core/JsonProcessingException.java
+++ b/src/main/java/com/fasterxml/jackson/core/JsonProcessingException.java
@@ -54,6 +54,12 @@
public JsonLocation getLocation() { return _location; }
/**
+ * Method that allows to remove context information from this exception's message.
+ * Useful when you are parsing security-sensitive data and don't want original data excerpts to be present in Jackson parser error messages.
+ */
+ public void clearLocation() { _location = null; }
+
+ /**
* Method that allows accessing the original "message" argument,
* without additional decorations (like location information)
* that overridden {@link #getMessage} adds.