Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 6.0.1.

Duplications

File Line
org/socialsignin/spring/data/dynamodb/repository/query/AbstractDynamoDBQuery.java 127
org/socialsignin/spring/data/dynamodb/repository/query/AbstractDynamoDBQuery.java 203
		public PagedExecution(Parameters<?, ?> parameters) {

			this.parameters = parameters;
		}

		private long scanThroughResults(Iterator<T> iterator, long resultsToScan) {
			long processed = 0;
			while (iterator.hasNext() && processed < resultsToScan) {
				iterator.next();
				processed++;
			}
			return processed;
		}

		private List<T> readPageOfResultsRestrictMaxResultsIfNecessary(Iterator<T> iterator, int pageSize) {
			int processed = 0;
			int toProcess = getResultsRestrictionIfApplicable() != null
					? Math.min(pageSize, getResultsRestrictionIfApplicable())
					: pageSize;
			List<T> resultsPage = new ArrayList<>();
			while (iterator.hasNext() && processed < toProcess) {
				resultsPage.add(iterator.next());
				processed++;
			}
			return resultsPage;
		}

		@Override
		public Object execute(AbstractDynamoDBQuery<T, ID> dynamoDBQuery, Object[] values) {

			ParameterAccessor accessor = new ParametersParameterAccessor(parameters, values);
			Pageable pageable = accessor.getPageable();
			Query<T> query = dynamoDBQuery.doCreateQueryWithPermissions(values);

			List<T> results = query.getResultList();
			return createPage(results, pageable, dynamoDBQuery, values);