Source:
<code>public List<StreamsDatum> process(StreamsDatum entry) { List<StreamsDatum> result = Lists.newArrayList(); String json = null; <START> LOGGER.debug("{} processing {}", STREAMS_ID); <END> if( entry.getDocument() instanceof ObjectNode ) { ObjectNode node = (ObjectNode) entry.getDocument(); try { json = mapper.writeValueAsString(node); } catch (JsonProcessingException e) { e.printStackTrace(); } } else if( entry.getDocument() instanceof String ) { json = (String) entry.getDocument(); } if( StringUtils.isNotEmpty(json)) { try { Object readResult = jsonPath.read(json); if (readResult instanceof String) { String match = (String) readResult; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if (readResult instanceof JSONObject) { JSONObject match = (JSONObject) readResult; ObjectNode objectNode = mapper.readValue(mapper.writeValueAsString(match), ObjectNode.class); StreamsDatum matchDatum = new StreamsDatum(objectNode); result.add(matchDatum); } else if (readResult instanceof JSONArray) { JSONArray array = (JSONArray) readResult; Iterator iterator = array.iterator(); while (iterator.hasNext()) { Object item = iterator.next(); if( item instanceof String ) { String match = (String) item; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if ( item instanceof JSONObject ) { StreamsDatum matchDatum = new StreamsDatum(item); result.add(matchDatum); } } } else { } } catch( Exception e ) { e.printStackTrace(); LOGGER.warn(e.getMessage()); } } return result; }</code><technical_language>placeholders in stream argument, is this intentional</technical_language>

Target:
public List<StreamsDatum> process(StreamsDatum entry) { List<StreamsDatum> result = Lists.newArrayList(); String json = null; LOGGER.debug("{} processing {}", STREAMS_ID); if( entry.getDocument() instanceof ObjectNode ) { ObjectNode node = (ObjectNode) entry.getDocument(); try { json = mapper.writeValueAsString(node); } catch (JsonProcessingException e) { LOGGER.warn(e.getMessage()); } } else if( entry.getDocument() instanceof String ) { json = (String) entry.getDocument(); } if( StringUtils.isNotEmpty(json)) { try { Object readResult = jsonPath.read(json); if (readResult instanceof String) { String match = (String) readResult; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if (readResult instanceof JSONObject) { JSONObject match = (JSONObject) readResult; ObjectNode objectNode = mapper.readValue(mapper.writeValueAsString(match), ObjectNode.class); StreamsDatum matchDatum = new StreamsDatum(objectNode); result.add(matchDatum); } else if (readResult instanceof JSONArray) { JSONArray array = (JSONArray) readResult; Iterator iterator = array.iterator(); while (iterator.hasNext()) { Object item = iterator.next(); if( item instanceof String ) { String match = (String) item; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if ( item instanceof JSONObject ) { JSONObject match = (JSONObject) item; ObjectNode objectNode = mapper.readValue(mapper.writeValueAsString(match), ObjectNode.class); StreamsDatum matchDatum = new StreamsDatum(objectNode); result.add(matchDatum); } } } else { } } catch( Exception e ) { LOGGER.warn(e.getMessage()); } } return result; }