Project

General

Profile

« Previous | Next » 

Revision 60566

PRIVATE : I have the impression we are not preventing a NullPointerException during collection that I am experiencing with the eurostat API of the EU Open Data Portal.

View differences:

modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/rest/RestIterator.java
23 23
import javax.xml.transform.stream.StreamResult;
24 24
import javax.xml.xpath.*;
25 25

  
26
import eu.dnetlib.data.collector.plugins.oai.engine.XmlCleaner;
27 26
import eu.dnetlib.data.collector.plugins.utils.JsonUtils;
28 27
import eu.dnetlib.data.collector.rmi.CollectorServiceException;
29 28
import org.apache.commons.io.IOUtils;
......
35 34
import org.xml.sax.InputSource;
36 35

  
37 36
/**
38
 * @author Jochen Schirrwagen, Aenne Loehden, Andreas Czerniak
37
 * @author Jochen Schirrwagen, Aenne Loehden, Andreas Czerniak, Alessia Bardi, Miriam Baglioni
39 38
 * @date 2020-04-09
40 39
 *
41 40
 */
......
227 226
				for (int i = 0; i < nodeList.getLength(); i++) {
228 227
					StringWriter sw = new StringWriter();
229 228
					transformer.transform(new DOMSource(nodeList.item(i)), new StreamResult(sw));
230
					recordQueue.add(sw.toString());
229
					String toEnqueue = sw.toString();
230
					if(toEnqueue == null || StringUtils.isBlank(toEnqueue) || emptyXml.equalsIgnoreCase(toEnqueue)){
231
						log.warn("The following record resulted in empty item for the feeding queue: "+resultXml);
232
					}
233
					else{ recordQueue.add(sw.toString());}
231 234
				}
232
			} else { log.info("resultXml is equal with emptyXml"); }
235
			} else { log.warn("resultXml is equal with emptyXml"); }
233 236

  
234 237
			resumptionInt += resultSizeValue;
235 238

  

Also available in: Unified diff