gilPts commented on code in PR #517: URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158212716
########## framework/webtools/groovyScripts/entity/XmlDsDump.groovy: ########## @@ -17,151 +17,158 @@ * under the License. */ -import java.util.* -import java.io.* -import org.apache.ofbiz.base.util.* -import org.apache.ofbiz.entity.model.* -import org.apache.ofbiz.entity.util.* -import org.apache.ofbiz.entity.transaction.* -import org.apache.ofbiz.entity.condition.* +import org.apache.ofbiz.base.util.Debug +import org.apache.ofbiz.base.util.UtilFormatOut +import org.apache.ofbiz.entity.condition.EntityComparisonOperator +import org.apache.ofbiz.entity.condition.EntityCondition +import org.apache.ofbiz.entity.condition.EntityJoinOperator +import org.apache.ofbiz.entity.model.ModelViewEntity +import org.apache.ofbiz.entity.transaction.TransactionUtil +import org.apache.ofbiz.entity.util.EntityFindOptions outpath = parameters.outpath filename = parameters.filename maxRecStr = parameters.maxrecords entitySyncId = parameters.entitySyncId passedEntityNames = null -if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet +if (parameters.entityName) { + passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet +} // get the max records per file setting and convert to a int -maxRecordsPerFile = 0 -if (maxRecStr) { - try { - maxRecordsPerFile = Integer.parseInt(maxRecStr) - } - catch (Exception e) { - } -} +int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0 Review Comment: maxRecStr is an user filled data for `Max Records Per File` during xml export. If the user to not fill an integer, this code won't break and maxRecordsPerFile will still be set at default `0` value. Are you telling that there are some cases that could throw an exception with `isInteger` test to int cast ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ofbiz.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org