Source:
<code>public static String findSecrets(File xmlFile) throws SAXException, IOException, TransformerException { XMLReader xr = new XMLFilterImpl(XMLReaderFactory.createXMLReader()) { private String tagName = ""; @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { tagName = qName; super.startElement(uri, localName, qName, atts); } public void endElement(String uri, String localName, String qName) throws SAXException { tagName = ""; super.endElement(uri, localName, qName); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (!"".equals(tagName)) { String value = new String(ch, start, length).trim(); if (!"".equals(value) && !"{}".equals(value)) { if ((Secret.decrypt(value)) != null || SecretBytes.isSecretBytes(value)) { ch = SECRET_MARKER.toCharArray(); start = 0; length = ch.length; } } } super.characters(ch, start, length); } }; String str = FileUtils.readFileToString(xmlFile); Source src = new SAXSource(xr, new InputSource(new StringReader(str))); final ByteArrayOutputStream result = new ByteArrayOutputStream(); Result res = new StreamResult(result); Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, OUTPUT_ENCODING); try { transformer.transform(src, res); return result.toString("UTF-8"); } catch (TransformerException e) { <START> return findSecretFallback(str); <END> } }</code><technical_language>fine-grain logging notify issue</technical_language>

Target:
public static String findSecrets(File xmlFile) throws SAXException, IOException, TransformerException { XMLReader xr = new XMLFilterImpl(XMLReaderFactory.createXMLReader()) { private String tagName = ""; @Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { tagName = qName; super.startElement(uri, localName, qName, atts); } public void endElement(String uri, String localName, String qName) throws SAXException { tagName = ""; super.endElement(uri, localName, qName); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (!"".equals(tagName)) { String value = new String(ch, start, length).trim(); if (!"".equals(value) && !"{}".equals(value)) { if ((Secret.decrypt(value)) != null || SecretBytes.isSecretBytes(value)) { ch = SECRET_MARKER.toCharArray(); start = 0; length = ch.length; } } } super.characters(ch, start, length); } }; String str = FileUtils.readFileToString(xmlFile); Source src = new SAXSource(xr, new InputSource(new StringReader(str))); final ByteArrayOutputStream result = new ByteArrayOutputStream(); Result res = new StreamResult(result); Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, OUTPUT_ENCODING); try { transformer.transform(src, res); return result.toString("UTF-8"); } catch (TransformerException e) { if (ENABLE_FALLBACK) { return findSecretFallback(str); } else { throw e; } } }