CPD Results

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

Duplications

File Line
info/magnolia/rest/service/command/v1/CommandEndpoint.java 119
info/magnolia/rest/service/command/v2/CommandEndpoint.java 137
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @ApiOperation(value = "Executes a command", notes = "Executes a command from the default catalog")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = STATUS_MESSAGE_OK),
            @ApiResponse(code = 403, message = STATUS_MESSAGE_FORBIDDEN),
            @ApiResponse(code = 404, message = STATUS_MESSAGE_COMMAND_NOT_FOUND),
            @ApiResponse(code = 500, message = STATUS_MESSAGE_ERROR_OCCURRED)
    })
    public Response executeCommand(@PathParam("commandName") String commandName, Map<String, Object> commandMap) throws RepositoryException {
        return executeCommand(null, commandName, commandMap);
    }
File Line
info/magnolia/rest/service/command/v1/CommandEndpoint.java 81
info/magnolia/rest/service/command/v2/CommandEndpoint.java 89
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @ApiOperation(value = "Executes a command", notes = "Executes a command from a specific catalog")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = STATUS_MESSAGE_OK),
            @ApiResponse(code = 403, message = STATUS_MESSAGE_FORBIDDEN),
            @ApiResponse(code = 404, message = STATUS_MESSAGE_COMMAND_NOT_FOUND),
            @ApiResponse(code = 500, message = STATUS_MESSAGE_ERROR_OCCURRED)
    })
    public Response executeCommand(
            @PathParam("catalogName") String catalogName,
            @PathParam("commandName") String commandName,
            Map<String, Object> commandMap) throws RepositoryException {
File Line
info/magnolia/rest/service/property/v1/PropertyEndpoint.java 150
info/magnolia/rest/service/property/v1/PropertyEndpoint.java 211
            @QueryParam("name") String name,
            @QueryParam("value") List<String> valueStrings,
            @QueryParam("type") @DefaultValue(PropertyType.TYPENAME_STRING) String typeString,
            @QueryParam("multiple") @DefaultValue("false") boolean multiple) throws RepositoryException {

        if (!multiple && valueStrings.size() != 1) {
            return Response.status(Response.Status.BAD_REQUEST).build();
        }

        try {
            PropertyType.valueFromName(typeString);
        } catch (IllegalArgumentException e) {
            return Response.status(Response.Status.BAD_REQUEST).build();
        }

        final String parentAbsPath = StringUtils.defaultIfEmpty(parentPath, "/");