| Chunk |
|---|
| Conflicting content |
|---|
return JSONValue.toJSONString(map);
}
<<<<<<< HEAD
public ByteBuffer[] toDatagrams() {
byte[] messageBytes = gzipMessage( toJson() );
ByteBuffer[] datagrams = new ByteBuffer[ messageBytes.length / MAXIMUM_CHUNK_SIZE + 1 ];
if ( messageBytes.length > MAXIMUM_CHUNK_SIZE ) {
sliceDatagrams( messageBytes, datagrams );
} else {
datagrams[0] = ByteBuffer.allocate( messageBytes.length );
datagrams[0].put( messageBytes );
=======
public ByteBuffer[] toDatagrams()
{
byte[] messageBytes = gzipMessage( toJson() );
ByteBuffer[] datagrams = new ByteBuffer[ messageBytes.length / MAXIMUM_CHUNK_SIZE + 1 ];
if ( messageBytes.length > MAXIMUM_CHUNK_SIZE )
{
sliceDatagrams( messageBytes, datagrams );
}
else
{
datagrams[ 0 ] = ByteBuffer.allocate( messageBytes.length );
datagrams[ 0 ].put( messageBytes );
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
datagrams[0].flip();
}
return datagrams; |
| Solution content |
|---|
return JSONValue.toJSONString(map);
}
public ByteBuffer[] toDatagrams() {
byte[] messageBytes = gzipMessage( toJson() );
ByteBuffer[] datagrams = new ByteBuffer[ messageBytes.length / MAXIMUM_CHUNK_SIZE + 1 ];
if ( messageBytes.length > MAXIMUM_CHUNK_SIZE ) {
sliceDatagrams( messageBytes, datagrams );
} else {
datagrams[0] = ByteBuffer.allocate( messageBytes.length );
datagrams[0].put( messageBytes );
datagrams[0].flip();
}
return datagrams; |
| File |
|---|
| GelfMessage.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array access |
| If statement |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
to = messageLength;
}
byte[] datagram = concatByteArray( header, Arrays.copyOfRange( messageBytes, from, to ) );
<<<<<<< HEAD
datagrams[idx] = ByteBuffer.allocate( datagram.length );
datagrams[idx].put(datagram);
datagrams[idx].flip();
=======
datagrams[ idx ] = ByteBuffer.allocate( datagram.length );
datagrams[ idx ].put( datagram );
datagrams[ idx ].flip();
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
}
}
|
| Solution content |
|---|
to = messageLength;
}
byte[] datagram = concatByteArray( header, Arrays.copyOfRange( messageBytes, from, to ) );
datagrams[idx] = ByteBuffer.allocate( datagram.length );
datagrams[idx].put(datagram);
datagrams[idx].flip();
}
}
|
| File |
|---|
| GelfMessage.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array access |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
package org.graylog2; import java.io.IOException; <<<<<<< HEAD import java.net.*; ======= import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketException; >>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74 import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; |
| Solution content |
|---|
package org.graylog2; import java.io.IOException; import java.net.*; import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; |
| File |
|---|
| GelfSender.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
public class GelfSender {
<<<<<<< HEAD
public static final int DEFAULT_PORT = 12201;
=======
private static final int DEFAULT_PORT = 12201;
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
private InetAddress host;
private int port; |
| Solution content |
|---|
public class GelfSender {
public static final int DEFAULT_PORT = 12201;
private InetAddress host;
private int port; |
| File |
|---|
| GelfSender.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
=======
private int port;
private DatagramChannel channel;
<<<<<<< HEAD
public GelfSender(String host) throws IOException {
this(host, DEFAULT_PORT);
}
public GelfSender(String host, int port) throws IOException {
this.host = InetAddress.getByName(host);
this.port = port;
this.channel = initiateChannel();
}
private DatagramChannel initiateChannel() throws IOException {
DatagramChannel resultingChannel = DatagramChannel.open();
resultingChannel.socket().bind(new InetSocketAddress(0));
resultingChannel.connect(new InetSocketAddress(this.host, this.port));
resultingChannel.configureBlocking(false);
return resultingChannel;
public GelfSender(String host) throws IOException, SocketException {
this(host, DEFAULT_PORT);
}
public GelfSender(String host, int port) throws IOException, SocketException {
this.host = InetAddress.getByName(host);
this.port = port;
this.channel = initiateChannel();
}
private DatagramChannel initiateChannel() throws IOException
{
DatagramChannel resultingChannel = DatagramChannel.open();
resultingChannel.socket().bind(new InetSocketAddress(0));
resultingChannel.connect(new InetSocketAddress(this.host, this.port));
resultingChannel.configureBlocking(false);
return resultingChannel;
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
}
public boolean sendMessage(GelfMessage message) { |
| Solution content |
|---|
private int port;
private DatagramChannel channel;
public GelfSender(String host) throws IOException {
this(host, DEFAULT_PORT);
}
public GelfSender(String host, int port) throws IOException {
this.host = InetAddress.getByName(host);
this.port = port;
this.channel = initiateChannel();
}
private DatagramChannel initiateChannel() throws IOException {
DatagramChannel resultingChannel = DatagramChannel.open();
resultingChannel.socket().bind(new InetSocketAddress(0));
resultingChannel.connect(new InetSocketAddress(this.host, this.port));
resultingChannel.configureBlocking(false);
return resultingChannel;
}
public boolean sendMessage(GelfMessage message) { |
| File |
|---|
| GelfSender.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method declaration |
| Method invocation |
| Method signature |
| Return statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
public boolean sendDatagrams(ByteBuffer[] bytesList) {
try {
<<<<<<< HEAD
channel.write(bytesList);
=======
channel.write( bytesList);
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
} catch (IOException e) {
return false;
} |
| Solution content |
|---|
public boolean sendDatagrams(ByteBuffer[] bytesList) {
try {
channel.write(bytesList);
} catch (IOException e) {
return false;
} |
| File |
|---|
| GelfSender.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
}
public void close() {
<<<<<<< HEAD
try {
channel.close();
} catch (IOException e) {
e.printStackTrace();
=======
try
{
channel.close();
}
catch ( IOException e )
{
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
}
}
} |
| Solution content |
|---|
}
public void close() {
try {
channel.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} |
| File |
|---|
| GelfSender.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Catch clause |
| Comment |
| Method invocation |
| Try statement |
| Chunk |
|---|
| Conflicting content |
|---|
for (int i = 0; i < 15; i++) {
longString += longString;
}
<<<<<<< HEAD
GelfMessage message = new GelfMessage("Long", longString, new Date().getTime(), "1");
ByteBuffer[] bytes2 = message.toDatagrams();
assertEquals(2, bytes2.length);
assertTrue(bytes2[0].get(10) == (byte) 0x00);
assertTrue(bytes2[0].get(11) == (byte) 0x02);
assertTrue(bytes2[1].get(10) == (byte) 0x01);
assertTrue(bytes2[1].get(11) == (byte) 0x02);
=======
GelfMessage message = new GelfMessage("Long", longString, new Date(), "1");
ByteBuffer[] bytes2 = message.toDatagrams();
assertEquals(2, bytes2.length);
assertTrue(bytes2[0].get(10) == (byte) 0x00);
assertTrue(bytes2[0].get(11) == (byte) 0x02);
assertTrue(bytes2[1].get(10) == (byte) 0x01);
assertTrue(bytes2[1].get(11) == (byte) 0x02);
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
}
@Test |
| Solution content |
|---|
for (int i = 0; i < 15; i++) {
longString += longString;
}
GelfMessage message = new GelfMessage("Long", longString, new Date().getTime(), "1");
ByteBuffer[] bytes2 = message.toDatagrams();
assertEquals(2, bytes2.length);
assertTrue(bytes2[0].get(10) == (byte) 0x00);
assertTrue(bytes2[0].get(11) == (byte) 0x02);
assertTrue(bytes2[1].get(10) == (byte) 0x01);
assertTrue(bytes2[1].get(11) == (byte) 0x02);
}
@Test |
| File |
|---|
| GelfMessageTest.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
@Test
public void testSimpleMessage() throws Exception {
<<<<<<< HEAD
GelfMessage message = new GelfMessage("Short", "Long", new Date().getTime(), "1");
=======
GelfMessage message = new GelfMessage("Short", "Long", new Date(), "1");
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
ByteBuffer[] bytes = message.toDatagrams();
assertEquals(1, bytes.length);
} |
| Solution content |
|---|
@Test
public void testSimpleMessage() throws Exception {
GelfMessage message = new GelfMessage("Short", "Long", new Date().getTime(), "1");
ByteBuffer[] bytes = message.toDatagrams();
assertEquals(1, bytes.length);
} |
| File |
|---|
| GelfMessageTest.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
private GelfMessage lastMessage;
<<<<<<< HEAD
public TestGelfSender(String host) throws IOException {
=======
public TestGelfSender(String host) throws IOException, SocketException {
>>>>>>> 6a073dd4aeab69bfe117076da40f41433126bc74
super(host);
}
|
| Solution content |
|---|
private GelfMessage lastMessage;
public TestGelfSender(String host) throws IOException {
super(host);
}
|
| File |
|---|
| GelfAppenderTest.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Method signature |