Index: modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/rest/RestIterator.java
===================================================================
--- modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/rest/RestIterator.java	(revision 52970)
+++ modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/rest/RestIterator.java	(revision 52971)
@@ -40,6 +40,7 @@
  */
 public class RestIterator implements Iterator<String> {
 
+    // TODO: clean up the comments of replaced source code
 	private static final Log log = LogFactory.getLog(OaiIterator.class); // NOPMD by marko on 11/24/08 5:02 PM
 
 	private static final String wrapName = "recordWrap";
@@ -72,7 +73,7 @@
 			final String resultFormatParam,
 			final String resultFormatValue,
 			final String resultSizeParam,
-                        final String resultSizeValue,
+                        final String resultSizeValueStr,
 			final String queryParams,
 			final String entityXpath
 			) {
@@ -81,9 +82,10 @@
 		this.resumptionParam = resumptionParam;
 		this.resultFormatValue = resultFormatValue;
 		this.queryParams = queryParams;
-		
+                this.resultSizeValue = Integer.valueOf(resultSizeValueStr);
+                        
         queryFormat = StringUtils.isNotBlank(resultFormatParam) ? "&" + resultFormatParam + "=" + resultFormatValue : "";
-        querySize = StringUtils.isNotBlank(resultSizeParam) ? "&" + resultSizeParam + "=" + resultSizeValue : "";
+        querySize = StringUtils.isNotBlank(resultSizeParam) ? "&" + resultSizeParam + "=" + resultSizeValueStr : "";
 
 		try {
 			initXmlTransformation(resultTotalXpath, resumptionXpath, entityXpath);
@@ -150,7 +152,7 @@
 		String resultXml = "";
 		String nextQuery = "";
 		try {
-            resultStream = new URL(query).openStream();
+                        resultStream = new URL(query).openStream();
 			if("json".equals(resultFormatValue.toLowerCase())){				
 				resultJson = IOUtils.toString(resultStream,"UTF-8");
 
@@ -177,6 +179,10 @@
 				
 			resumptionInt += resultSizeValue;
                         
+/*	replaced by switch statement as follow		
+                        if("scan".equals(resumptionType.toLowerCase())) { resumptionStr = xprResumptionPath.evaluate(resultNode);}
+			if("count".equals(resumptionType.toLowerCase())){ resumptionStr = Integer.toString(resumptionInt); }
+*/
                         switch(resumptionType.toLowerCase()) {
                             case "scan":
                                             resumptionStr = xprResumptionPath.evaluate(resultNode);
@@ -195,10 +201,10 @@
                                             }
                                             break;
                             default:
+                                            resultTotal = resumptionInt;
+                                            break;
                         }
-/*			if("scan".equals(resumptionType.toLowerCase())) { resumptionStr = xprResumptionPath.evaluate(resultNode);}
-			if("count".equals(resumptionType.toLowerCase())){ resumptionStr = Integer.toString(resumptionInt); }
-*/
+
 			if (resultTotal == -1) {
 				resultTotal = Integer.parseInt(xprResultTotalPath.evaluate(resultNode));
 				log.info("resultTotal: " + resultTotal);
@@ -209,6 +215,8 @@
 				nextQuery = baseUrl + "?" + queryParams + querySize + "&" + resumptionParam + "=" + resumptionStr + queryFormat;
 			} else
 				nextQuery = "";
+                        
+                        log.info("nextQueryUrl: " + nextQuery);
 			return nextQuery;
 
 		} catch(Exception e) {
Index: modules/dnet-collector-plugins/trunk/pom.xml
===================================================================
--- modules/dnet-collector-plugins/trunk/pom.xml	(revision 52970)
+++ modules/dnet-collector-plugins/trunk/pom.xml	(revision 52971)
@@ -7,7 +7,7 @@
 	</parent>
 	<groupId>eu.dnetlib</groupId>
 	<artifactId>dnet-collector-plugins</artifactId>
-	<version>1.3.15-SNAPSHOT</version>
+	<version>1.3.16-SNAPSHOT</version>
 	<scm>
 		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-collector-plugins/trunk</developerConnection>
 	</scm>
