Projects >> nCoAP >>33758af5b0bbde4b3693b7f24c9cbd24d3362e67

Chunk
Conflicting content
        return header;
    }

<<<<<<< HEAD
    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof CoapMessage)) {
            return super.equals(obj);
        }
        CoapMessage coapMessage = (CoapMessage)obj;
        
        //if this.rcptAddress is null, coapMessage.rcptAddress must also be null to be equal
        //if this.payload is null, coapMessage.payload must also be null to be equal
        return (rcptAddress == null ? coapMessage.rcptAddress == null : 
                rcptAddress.equals(coapMessage.rcptAddress)) &&
                
                (payload == null ? coapMessage.payload == null : 
                payload.equals(coapMessage.payload)) &&
                
                header.equals(coapMessage.header) &&
                optionList.equals(coapMessage.optionList);
=======
    public boolean equals(Object obj){
        if(!(obj instanceof CoapMessage)){
            return false;
        }

        CoapMessage msg = (CoapMessage) obj;
        return this.getHeader().getVersion() == msg.getHeader().getVersion()
            && this.getHeader().getMsgType().number == msg.getHeader().getMsgType().number
            && this.getHeader().getCode().number == msg.getHeader().getCode().number
            && this.getHeader().getMsgID() == msg.getHeader().getMsgID()
            && optionList.equals(msg.getOptionList())
            && payload.equals(msg.getPayload());
>>>>>>> 3ad64312c991bbbc7fa50b462318e15c89adb3bc
    }
}
Solution content
        return header;
    }

    public boolean equals(Object obj){
        if(!(obj instanceof CoapMessage)){
            return false;
        }

        CoapMessage msg = (CoapMessage) obj;
        return this.getHeader().getVersion() == msg.getHeader().getVersion()
            && this.getHeader().getMsgType().number == msg.getHeader().getMsgType().number
            && this.getHeader().getCode().number == msg.getHeader().getCode().number
            && this.getHeader().getMsgID() == msg.getHeader().getMsgID()
            && optionList.equals(msg.getOptionList())
            && payload.equals(msg.getPayload());
    }
}
File
CoapMessage.java
Developer's decision
Version 2
Kind of conflict
Annotation
Attribute
Cast expression
Comment
If statement
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
import org.apache.log4j.Logger;

import java.util.List;
<<<<<<< HEAD
import java.util.Set;
=======
import java.util.Map.Entry;
>>>>>>> 3ad64312c991bbbc7fa50b462318e15c89adb3bc

/**
 *
Solution content
import org.apache.log4j.Logger;

import java.util.List;
import java.util.Map.Entry;

/**
 *
File
OptionList.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
        return options.size();
    }

<<<<<<< HEAD
    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof OptionList)) {
            return super.equals(obj);
        }
        OptionList optionList = (OptionList) obj;
        return options.equals(optionList.options);
    }
    
    
}
=======
    /**
     * Two instances of {@link OptionList} are equal if and only if both contain the same number of {@link Option}s
     * of each {@link OptionName} in the same order per {@link OptionName}. To be more precisely, internally the
     * {@link Option}s are stored in a {@link LinkedListMultimap} with {@link OptionName} as key and an instance of
     * {@link Option} as value. The order of the keys does not influence the equality of two {@link OptionList}s
     * but the order of the values per key does.
     *
     * @param obj The object to test the equality with
     * @return  true if the given object is an instance of {@link OptionList} and is equal to this instance
     * according to the conditions explained above. Otherwise it returns false.
     */
    public boolean equals(Object obj){
        if(!(obj instanceof OptionList)){
            return false;
        }
        
        OptionList optionList = (OptionList) obj;
        
        if(options.size() != optionList.options.size()){
            return false;
        }
        
        for(OptionName optionName : OptionName.values()){
            List
Solution content
            
        return options.size();
    }

    /**
     * Two instances of {@link OptionList} are equal if and only if both contain the same number of {@link Option}s
     * of each {@link OptionName} in the same order per {@link OptionName}. To be more precisely, internally the
     * {@link Option}s are stored in a {@link LinkedListMultimap} with {@link OptionName} as key and an instance of
     * {@link Option} as value. The order of the keys does not influence the equality of two {@link OptionList}s
     * but the order of the values per key does.
     *
     * @param obj The object to test the equality with
     * @return  true if the given object is an instance of {@link OptionList} and is equal to this instance
     * according to the conditions explained above. Otherwise it returns false.
     */
    public boolean equals(Object obj){
        if(!(obj instanceof OptionList)){
            return false;
        }
        
        OptionList optionList = (OptionList) obj;
        
        if(options.size() != optionList.options.size()){
            return false;
        }
        
        for(OptionName optionName : OptionName.values()){
            List
File
OptionList.java
Developer's decision
Version 2
Kind of conflict
Annotation
Comment
Method declaration
Chunk
Conflicting content
                log.debug("[OptionRegistry] Occurence constraint for option " + opt_name + " with code " + code + " is: "
                        + result.toString());
            }
<<<<<<< HEAD
            return result == null ? OptionOccurence.NONE : result;
=======
            return result != null ? result : OptionOccurence.NONE;
>>>>>>> 3ad64312c991bbbc7fa50b462318e15c89adb3bc
        }
        catch(NullPointerException e){
            return OptionOccurence.NONE;
Solution content
                log.debug("[OptionRegistry] Occurence constraint for option " + opt_name + " with code " + code + " is: "
                        + result.toString());
            }
            return result != null ? result : OptionOccurence.NONE;
        }
        catch(NullPointerException e){
            return OptionOccurence.NONE;
File
OptionRegistry.java
Developer's decision
Version 2
Kind of conflict
Return statement
Variable
Chunk
Conflicting content
        }

        //Remove eventual leading zeros
<<<<<<< HEAD
        int iMin = Math.min(8, bytes.length);
        for(int i = 0; i < iMin; i++){
=======
        for(int i = 0; i < bytes.length; i++){
>>>>>>> 3ad64312c991bbbc7fa50b462318e15c89adb3bc
            if(bytes[i] != 0){
                return Arrays.copyOfRange(bytes, i, bytes.length);
            }
Solution content
        }

        //Remove eventual leading zeros
        for(int i = 0; i < bytes.length; i++){
            if(bytes[i] != 0){
                return Arrays.copyOfRange(bytes, i, bytes.length);
            }
File
UintOption.java
Developer's decision
Version 2
Kind of conflict
For statement
Method invocation
Variable
Chunk
Conflicting content
            return false;
        }
        UintOption opt = (UintOption) o;
<<<<<<< HEAD
        if((optionNumber == opt.optionNumber) && (Arrays.equals(value, opt.value))){
=======
        if((optionNumber == opt.optionNumber) && (this.getDecodedValue() == opt.getDecodedValue())){
>>>>>>> 3ad64312c991bbbc7fa50b462318e15c89adb3bc
            return true;
        }
        return false;
Solution content
            return false;
        }
        UintOption opt = (UintOption) o;
        if((optionNumber == opt.optionNumber) && (this.getDecodedValue() == opt.getDecodedValue())){
            return true;
        }
        return false;
File
UintOption.java
Developer's decision
Version 2
Kind of conflict
If statement