Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicated block of Code in Sonar for import statements in Java

In Sonar 4.5.6 (with default settings) I am seeing Duplicated Blocks message as

enter image description here

My java code for which I am getting the message is like below:-

package com.jabong.orchestratorservice.adapter.order.endpoints;

import com.jabong.orchestratorservice.adapter.order.request.UpdateOrderStatusReadyShipRequest;

public class UpdateOrderReadyShipEndPoint extends BaseOrderEndPoint {
    private final static String API_NAME = "setStatusToReadyToShip";

    @Override
    public String getSourceEndPoint() {
    return new StringBuilder("direct:").append(API_NAME).toString();
    }

    @Override
    public String getDestinationEndPoint() {
    return new StringBuilder("bean:orderHelper?method=").append(API_NAME).toString();
    }

    @Override
    protected String getName() {
    return API_NAME;
    }

    @Override
    protected String getApiInputClassName() {
    return UpdateOrderStatusReadyShipRequest.class.getName();
    }
}

UpdateOrderStatusReadyShipRequest also does not import UpdateOrderReadyShipEndPoint

package com.jabong.orchestratorservice.adapter.order.request;

public class UpdateOrderStatusReadyShipRequest extends BaseOrderRequest {

Can some let me know what does this mean?

like image 664
tuk Avatar asked Mar 20 '16 08:03

tuk


1 Answers

You have to look (scroll down) your code. There will be a duplication marker in brown/gray like this:

enter image description here

like image 89
Carlos Cruz Avatar answered Oct 15 '22 16:10

Carlos Cruz