CPD Results

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

Duplications

FileLine
org\fosstrak\epcis\repository\query\QueryOperationsModule.java219
org\fosstrak\epcis\repository\query\QueryOperationsModule.java805
        for (QueryParam param : queryParams.getParam()) {
            String paramName = param.getName();
            Object paramValue = param.getValue();

            // check for null value
            if (paramName == null || "".equals(paramName)) {
                String msg = "Missing name for a query parameter";
                throw queryParameterException(msg, null);
            }
            if (paramValue == null) {
                String msg = "Missing value for query parameter '" + paramName + "'";
                throw queryParameterException(msg, null);
            }
            // check if the current query parameter has already been provided
            int index = Collections.binarySearch(sortedParamNames, paramName);
            if (index < 0) {
                // we have not yet seen this query parameter name - ok
                sortedParamNames.add(-index - 1, paramName);
            } else {
                // we have already handled this query parameter name - not ok
                String msg = "Query parameter '" + paramName + "' provided more than once";
                throw queryParameterException(msg, null);
            }