id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
21871478_577 | {
"fields": [
{
"declarator": "INVALID_IO_DATA = new byte[]{0x00, 0x01, 0x02, 0x03}",
"modifier": "private static final",
"original_string": "private static final byte[] INVALID_IO_DATA = new byte[]{0x00, 0x01, 0x02, 0x03};",
"type": "byte[]",
"var_name": "INVALID_IO_DATA"
},
... | {
"body": "@Test\n\tpublic void testGetDigitalLSBMask() {\n\t\t// Setup the resources for the test.\n\t\tIOSample ioSample = new IOSample(IO_DATA_ONLY_DIGITAL);\n\t\tint expected = IO_DATA_ONLY_DIGITAL[2] & 0xFF;\n\t\t\n\t\t// Call the method under test.\n\t\tint result = ioSample.getDigitalLSBMask();\n\t\t\n\t\t// V... | {
"fields": [
{
"declarator": "ioSamplePayload",
"modifier": "private final",
"original_string": "private final byte[] ioSamplePayload;",
"type": "byte[]",
"var_name": "ioSamplePayload"
},
{
"declarator": "rawMask",
"modifier": "private",
"original_string": ... | {
"body": "public int getDigitalLSBMask() {\n\t\treturn digitalLSBMask;\n\t}",
"class_method_signature": "IOSample.getDigitalLSBMask()",
"constructor": false,
"full_signature": "public int getDigitalLSBMask()",
"identifier": "getDigitalLSBMask",
"invocations": [],
"modifiers": "public",
"parameters": "(... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_127 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterNonNull() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tAT... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 15",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 15;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"64-bit source address\", HexUtils.prettyHexString(sourceAddress64.toString()));\n\t\tparameters.put(\"16-bit source address... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_11 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetPacketDataWithoutDataNoFrameID() {\n\t\t// Setup the resources for the test.\n\t\tAPIFrameType frameType = APIFrameType.GENERIC;\n\t\tTestXBeeAPIPacket packet = new TestXBeeAPIPacket(frameType);\n\t\tbyte[] expectedData = new byte[]{(byte)frameType.getValue()};\n\t\t\n\t\t... | {
"fields": [
{
"declarator": "NO_FRAME_ID = 9999",
"modifier": "public final static",
"original_string": "public final static int NO_FRAME_ID = 9999;",
"type": "int",
"var_name": "NO_FRAME_ID"
},
{
"declarator": "frameID = NO_FRAME_ID",
"modifier": "protected",
... | {
"body": "@Override\n\tpublic byte[] getPacketData() {\n\t\tByteArrayOutputStream data = new ByteArrayOutputStream();\n\t\t\n\t\tdata.write(frameTypeValue);\n\t\t\n\t\tbyte[] apiData = getAPIData();\n\t\tif (apiData == null)\n\t\t\tapiData = new byte[0];\n\t\tif (apiData != null && apiData.length > 0) {\n\t\t\ttry {... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_465 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNotNull() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 40;\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tRX16Pack... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress16",
"mo... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"16-bit source address\", HexUtils.prettyHexString(sourceAddress16.toString()));\n\t\tparameters.put(\"RSSI\", HexUtils.pret... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_170 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testGetRFDataInvalidData() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tIPv6IODataSampleRxIndicator packet = new IPv6IODataSampleRxIndicator(ipv6address, receivedData);\n\t\t\n\t\t// Call the method under test.\n\... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 17",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 17;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "IPv6IODataSampleRxIndicator.getRFData()",
"constructor": false,
"full_signature": "public byte[] getRFData()",
"identifier": "getRFData",
"i... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_520 | {
"fields": [
{
"declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()",
"modifier": "private static final",
"original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();",
"type": "byte[]",
"var_name": "R... | {
"body": "@Test\n\tpublic final void testIsOpenAfterOpening() {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = new TestAbstractSerialPort(\"COM1\", 9600);\n\t\tport.connectionOpen = true;\n\t\t\n\t\t// Call the method under test.\n\t\tboolean isOpen = port.isOpen();\n\t\t\n\t\t// Verify... | {
"fields": [
{
"declarator": "DEFAULT_PORT_TIMEOUT = 10",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;",
"type": "int",
"var_name": "DEFAULT_PORT_TIMEOUT"
},
{
"declarator": "DEFAULT_DATA_BITS = 8",
"mo... | {
"body": "@Override\n\tpublic boolean isOpen() {\n\t\treturn connectionOpen;\n\t}",
"class_method_signature": "AbstractSerialPort.isOpen()",
"constructor": false,
"full_signature": "@Override public boolean isOpen()",
"identifier": "isOpen",
"invocations": [],
"modifiers": "@Override public",
"paramete... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_46 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBroadcast() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint retryCount = 2;\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.SUCCESS;\n\t\tXBeeDiscoveryStatus discove... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 7",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 7;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "destAddress16",
"modi... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "TransmitStatusPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroadcast",
"invocations": [],
"modifiers": "@Override public"... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_609 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java",
"identifier": "TransmitExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetMessageOnlyTransmitStatusAndMessageBothNull() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = null;\n\t\tString message = null;\n\t\tTransmitException e = new TransmitException(message, transmitStatus);\n\t\t\n\t\t// Call the method und... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAULT_MESSAGE = \"There was a problem t... | {
"body": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (transmitStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + transmitStatus.toString();\n\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_259 | {
"fields": [
{
"declarator": "frameType = APIFrameType.FRAME_ERROR.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.FRAME_ERROR.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "error = FrameError.INVAL... | {
"body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete Frame Error packet.\")));\n\n\t\t// Call the method under tes... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 2",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 2;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Fram... | {
"body": "public static FrameErrorPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFra... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_473 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGenerateByteArray() {\n\t\t// Setup the resources for the test.\n\t\tfinal byte[] dataArray = new byte[]{0x08, 0x01, 0x4E, 0x49, 0x4E, 0x61, 0x6D, 0x65};\n\t\tTestXBeePacket packet = new TestXBeePacket() {\n\t\t\tpublic byte[] getPacketData() {\n\t\t\t\treturn dataArray;\n\t\... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public byte[] generateByteArray() {\n\t\tchecksum.reset();\n\t\tbyte[] packetData = getPacketData();\n\t\tByteArrayOutputStream os = new ByteArrayOutputStream();\n\t\tos.write(SpecialByte.HEADER_BYTE.getValue());\n\t\tif (packetData != null) {\n\t\t\tbyte[] length = ByteUtils.shortToByteArray((short)packet... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_189 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandValueNull() {\n\t\t// Setup the resources for the test.\n\t\tString command = \"NI\";\n\t\tbyte[] commandValue = null;\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frameID, ipv6address, command, \n\t\t\t\... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Source address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(sourceAddress.getAddress())) + \" (\" + sourceAddr... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_536 | {
"fields": [
{
"declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()",
"modifier": "private static final",
"original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();",
"type": "byte[]",
"var_name": "R... | {
"body": "@Test\n\tpublic final void testWriteDataByteArrayDataNullData() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tbyte[] data = null;\n\t\t\n\t\texception.expect(NullPointerException.class);\n\t\te... | {
"fields": [
{
"declarator": "DEFAULT_PORT_TIMEOUT = 10",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;",
"type": "int",
"var_name": "DEFAULT_PORT_TIMEOUT"
},
{
"declarator": "DEFAULT_DATA_BITS = 8",
"mo... | {
"body": "@Override\n\tpublic void writeData(byte[] data) throws IOException {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Data to be sent cannot be null.\");\n\t\t\n\t\tif (getOutputStream() != null) {\n\t\t\t// Writing data in ports without any device connected and configured with \n\t\t\t// har... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_166 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersInvalidReceivedData() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tIPv6IODataSampleRxIndicator packet = new IPv6IODataSampleRxIndicator(ipv6address, receivedData);\n\t\t\n\t\tString expec... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 17",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 17;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"IPv6 source address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(sourceAddress.getAddress())) +\n\t\t\t\t\" (\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_7 | {
"fields": [
{
"declarator": "PARAMETER_AI = \"AI\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_AI = \"AI\";",
"type": "String",
"var_name": "PARAMETER_AI"
},
{
"declarator": "RESPONSE_AI = new byte[]{0x00}",
"m... | {
"body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationsAddIOSampleListener() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in Cellular protocol.\")));\n\t\t\n\t\t// Call the meth... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in Cellular protocol.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in Cellular protocol.\";",
"type": "String",
"v... | {
"body": "@Override\n\tpublic void addIOSampleListener(IIOSampleReceiveListener listener) {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "CellularDevice.addIOSampleListener(IIOSampleReceiveListener listener)",
"constructo... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_50 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 40;\n\t\tbyte[] data... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 12",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 12;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "public static IODataSampleRxIndicatorPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"IO Data Sample RX Indicator packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (32-bit address) + 2 (16-bit address) + 1 (receive options)\n\t\tif (p... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_424 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNull() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint options = 40;\n\t\tbyte[] data = null;\n\t\tTX64Packet packet = new TX64Packet... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "transmitOptions",
"... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"64-bit dest. address\", HexUtils.prettyHexString(destAddress64.toString()));\n\t\tparameters.put(\"Options\", HexUtils.pret... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_131 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetCommandValueAsStringNullValue() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tATCommandStatus s... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 15",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 15;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "public String getCommandValueAsString() {\n\t\tif (commandValue == null)\n\t\t\treturn null;\n\t\treturn new String(commandValue);\n\t}",
"class_method_signature": "RemoteATCommandResponsePacket.getCommandValueAsString()",
"constructor": false,
"full_signature": "public String getCommandValueAsString... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_561 | {
"fields": [
{
"declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()",
"modifier": "private static final",
"original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();",
"type": "byte[]",
"var_name": "R... | {
"body": "@Test\n\tpublic void testGetReceiveTimeoutDefault() {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\t\n\t\t// Call the method under test.\n\t\tint result = port.getReceiveTimeout();\n\t\t\n\t\t// Verify the result.\... | {
"fields": [
{
"declarator": "DEFAULT_PORT_TIMEOUT = 10",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;",
"type": "int",
"var_name": "DEFAULT_PORT_TIMEOUT"
},
{
"declarator": "DEFAULT_DATA_BITS = 8",
"mo... | {
"body": "public int getReceiveTimeout() {\n\t\treturn receiveTimeout;\n\t}",
"class_method_signature": "AbstractSerialPort.getReceiveTimeout()",
"constructor": false,
"full_signature": "public int getReceiveTimeout()",
"identifier": "getReceiveTimeout",
"invocations": [],
"modifiers": "public",
"param... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_648 | {
"fields": [
{
"declarator": "PARAMETER_AI = \"AI\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_AI = \"AI\";",
"type": "String",
"var_name": "PARAMETER_AI"
},
{
"declarator": "PARAMETER_MA = \"MA\"",
"modifier":... | {
"body": "@Test\n\tpublic void testGetDNSAddress() throws Exception {\n\t\t// Return a valid response when requesting the NS parameter value.\n\t\tMockito.doReturn(IP_ADDRESS).when(wifiDevice).getParameter(PARAMETER_NS);\n\n\t\tassertEquals(Inet4Address.getByAddress(IP_ADDRESS), wifiDevice.getDNSAddress());\n\t}",
... | {
"fields": [
{
"declarator": "DEFAULT_ACCESS_POINT_TIMETOUT = 15000",
"modifier": "private final static",
"original_string": "private final static int DEFAULT_ACCESS_POINT_TIMETOUT = 15000;",
"type": "int",
"var_name": "DEFAULT_ACCESS_POINT_TIMETOUT"
},
{
"declarator":... | {
"body": "public Inet4Address getDNSAddress() throws TimeoutException, XBeeException {\n\t\ttry {\n\t\t\treturn (Inet4Address) Inet4Address.getByAddress(getParameter(\"NS\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\tthrow new XBeeException(e);\n\t\t}\n\t}",
"class_method_signature": "WiFiDevice.getDNSAddres... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_218 | {
"fields": [
{
"declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDRESS"
... | {
"body": "@Test\n\tpublic final void testSetDestPortNegative() {\n\t\t// Set up the resources for the test.\n\t\tTXIPv6Packet packet = new TXIPv6Packet(frameID, destAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Port ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 24",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 24;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"TX... | {
"body": "public void setDestPort(int destPort) {\n\t\tif (destPort < 0 || destPort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.destPort = destPort;\n\t}",
"class_method_signature": "TXIPv6Packet.setDestPort(int destPort)",
"constructor": false,
"full_signature": "public... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_280 | {
"fields": [
{
"declarator": "frameType = APIFrameType.SEND_DATA_REQUEST.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.SEND_DATA_REQUEST.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x... | {
"body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete Send Data Request packet.\")));\n\n\t\t// Call the method und... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 6",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 6;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Send... | {
"body": "public static SendDataRequestPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != A... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_795 | {
"fields": [
{
"declarator": "MAX_LENGTH = XBeePacketsQueue.DEFAULT_MAX_LENGTH",
"modifier": "private final static",
"original_string": "private final static int MAX_LENGTH = XBeePacketsQueue.DEFAULT_MAX_LENGTH;",
"type": "int",
"var_name": "MAX_LENGTH"
},
{
"declarato... | {
"body": "@Test\n\tpublic void testIPAddressesMatch() throws Exception {\n\t\tArrayList<XBeePacket> ipPackets = new ArrayList<XBeePacket>();\n\t\t\n\t\t// Fill the list of API packets.\n\t\tipPackets.add(mockedRxIPv4Packet);\n\t\t\n\t\t// Create an XBeePacketsQueue.\n\t\tXBeePacketsQueue xbeePacketsQueue = PowerMock... | {
"fields": [
{
"declarator": "DEFAULT_MAX_LENGTH = 50",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_MAX_LENGTH = 50;",
"type": "int",
"var_name": "DEFAULT_MAX_LENGTH"
},
{
"declarator": "maxLength = DEFAULT_MAX_LENGTH",
... | {
"body": "private boolean ipAddressesMatch(XBeePacket xbeePacket, Inet4Address ipAddress) {\n\t\tif (xbeePacket == null || ipAddress == null \n\t\t\t\t|| !(xbeePacket instanceof XBeeAPIPacket))\n\t\t\treturn false;\n\t\tAPIFrameType packetType = ((XBeeAPIPacket)xbeePacket).getFrameType();\n\t\tswitch (packetType) {\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_70 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"AT Command Queue packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method u... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 4",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "command",
"modifier":... | {
"body": "public static ATCommandQueuePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"AT Command Queue packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (AT command)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_516 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testEqualsIsConsistent() {\n\t\t// Setup the resources for the test.\n\t\tSerialPortParameters parameters1 = new SerialPortParameters(9600, 8, 1, 0, 0);\n\t\tSerialPortParameters parameters2 = new SerialPortParameters(9600, 8, 1, 0, 0);\n\t\tSerialPortParameters parameters3 = new... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "baudrate",
"modifier": "public final",
"original_str... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj instanceof SerialPortParameters)\n\t\t\treturn ((SerialPortParameters)obj).baudrate == baudrate \n\t\t\t\t&& ((SerialPortParameters)obj).dataBits == dataBits \n\t\t\t\t&& ((SerialPortParameters)obj).stopBits == stopBits\n\t\t\t\t&& ((SerialPortP... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_146 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetRFDataValidData() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint sourceEndpoint = 0xA0;\n\t\tint... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 20",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 20;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "destAddress64",
"mo... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "ExplicitAddressingPacket.getRFData()",
"constructor": false,
"full_signature": "public byte[] getRFData()",
"identifier": "getRFData",
"invo... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_453 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"TX Status packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method under te... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "transmitStatus",
"mod... | {
"body": "public static TXStatusPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"TX Status packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 1 (status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgum... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_687 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testReadStringNullTerminated() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] contents = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, 0x00};\n\t\tbyte[] expectedResult = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05};\n\t\tByteArrayInputStream in = new ByteArrayInputStream(content... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static String readString(ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\t\n\t\tStringBuilder sb = new StringBuilder();\n\t\tbyte readByte;\n\t\twhile (((readByte = (byte)inputStream.read()) != 0x00) && re... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_27 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBroadcastWithNon16BitAndNon64BitBroadcastDestinationAddress() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\"... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 14",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 14;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "destAddress64",
"mo... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn get64bitDestinationAddress().equals(XBee64BitAddress.BROADCAST_ADDRESS) \n\t\t\t\t|| get16bitDestinationAddress().equals(XBee16BitAddress.BROADCAST_ADDRESS);\n\t}",
"class_method_signature": "TransmitPacket.isBroadcast()",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_668 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationSetPANID() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that should thr... | {
"fields": [
{
"declarator": "BROADCAST_IP = \"255.255.255.255\"",
"modifier": "public static final",
"original_string": "public static final String BROADCAST_IP = \"255.255.255.255\";",
"type": "String",
"var_name": "BROADCAST_IP"
},
{
"declarator": "OPERATION_EXCEPTI... | {
"body": "@Override\n\tpublic void setPANID(byte[] panID) throws TimeoutException, XBeeException {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPDevice.setPANID(byte[] panID)",
"constructor": false,
"full_signature": ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_392 | {
"fields": [
{
"declarator": "IP_ADDRESS = \"10.10.11.12\"",
"modifier": "private static final",
"original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";",
"type": "String",
"var_name": "IP_ADDRESS"
},
{
"declarator": "frameType = APIFrameType.REMO... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadInvalidIP() throws Exception {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[13];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem.arraycopy(new byte[]{0x00, 0x00, 0x00, 0x00}, 0, payload, 2, 4);\n\t... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 13",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 13;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Re... | {
"body": "public static RemoteATCommandResponseWifiPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_238 | {
"fields": [
{
"declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_SR... | {
"body": "@Test\n\tpublic final void testSetProtocolNull() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv6Packet packet = new RXIPv6Packet(destAddress, sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Protoco... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 39",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 39;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"RX... | {
"body": "public void setProtocol(IPProtocol protocol) {\n\t\tif (protocol == null)\n\t\t\tthrow new NullPointerException(ERROR_PROTOCOL_NULL);\n\n\t\tthis.protocol = protocol;\n\t}",
"class_method_signature": "RXIPv6Packet.setProtocol(IPProtocol protocol)",
"constructor": false,
"full_signature": "public void... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_812 | {
"fields": [
{
"declarator": "INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}",
"modifier": "private final static",
"original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};",
... | {
"body": "@Test\n\tpublic final void testEqualsWithNull() {\n\t\t// Setup the resources for the test.\n\t\tXBeeIMEIAddress imei = new XBeeIMEIAddress(\"1234\");\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual = imei.equals(null);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"IMEI address cannot ... | {
"fields": [
{
"declarator": "ERROR_IMEI_NULL = \"IMEI address cannot be null.\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_IMEI_NULL = \"IMEI address cannot be null.\";",
"type": "String",
"var_name": "ERROR_IMEI_NULL"
},
{
... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (!(obj instanceof XBeeIMEIAddress))\n\t\t\treturn false;\n\t\tXBeeIMEIAddress addr = (XBeeIMEIAddress)obj;\n\t\treturn addr.getValue().equals(getValue());\n\t}",
"class_method_signature": "XBeeIMEIAddress.... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_111 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterString() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint opt... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 15",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 15;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "destAddress64",
"mo... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"64-bit dest. address\", HexUtils.prettyHexString(destAddress64.toString()));\n\t\tparameters.put(\"16-bit dest. address\", ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_541 | {
"fields": [
{
"declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()",
"modifier": "private static final",
"original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();",
"type": "byte[]",
"var_name": "R... | {
"body": "@Test\n\tpublic final void testWriteDataCompleteOffsetBiggerThanDataSize() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tbyte[] data = new byte[] {'h', 'e', 'l', 'l', 'o'};\n\t\tint offset = da... | {
"fields": [
{
"declarator": "DEFAULT_PORT_TIMEOUT = 10",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;",
"type": "int",
"var_name": "DEFAULT_PORT_TIMEOUT"
},
{
"declarator": "DEFAULT_DATA_BITS = 8",
"mo... | {
"body": "@Override\n\tpublic void writeData(byte[] data) throws IOException {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Data to be sent cannot be null.\");\n\t\t\n\t\tif (getOutputStream() != null) {\n\t\t\t// Writing data in ports without any device connected and configured with \n\t\t\t// har... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_404 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBroadcastWithBroadcastOptionBit2Enabled() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 75;\n\t\tint options = 0xCC; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1)\n\t\t\t\t|| ByteUtils.isBitEnabled(getReceiveOptions(), 2);\n\t}",
"class_method_signature": "RX64Packet.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_691 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testByteArrayToLongEmptyArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[0];\n\t\tlong expectedResult = 0;\n\t\t\n\t\t// Call the method under test.\n\t\tlong result = ByteUtils.byteArrayToLong(byteArray);\n\t\t\n\t\t// Verify the result.\n\t\t... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static long byteArrayToLong(byte[] byteArray) {\n\t\tif (byteArray == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\tif (byteArray.length == 0)\n\t\t\treturn 0;\n\t\t\n\t\tbyte[] values = byteArray;\n\t\tif (byteArray.length < 8) {\n\t\t\tvalues = new byte[8]... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_384 | {
"fields": [
{
"declarator": "IP_ADDRESS = \"10.10.11.12\"",
"modifier": "private static final",
"original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";",
"type": "String",
"var_name": "IP_ADDRESS"
},
{
"declarator": "frameType = APIFrameType.REMO... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterNull() {\n\t\t// Setup the resources for the test.\n\t\tparameter = null;\n\n\t\tRemoteATCommandWifiPacket packet = new RemoteATCommandWifiPacket(frameID, destAddress, transmitOptions, command, parameter);\n\n\t\t// Call the method unde... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 13",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 13;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Re... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Destination address\", \"00 00 00 00 \" + HexUtils.prettyHexString(HexUtils.byteArrayToHexString(destAddress.getAddress()))... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_31 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetRFDataNullData() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint broadcastRadious = 0;\n\t\tint o... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 14",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 14;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "destAddress64",
"mo... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "TransmitPacket.getRFData()",
"constructor": false,
"full_signature": "public byte[] getRFData()",
"identifier": "getRFData",
"invocations": ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_557 | {
"fields": [
{
"declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()",
"modifier": "private static final",
"original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();",
"type": "byte[]",
"var_name": "R... | {
"body": "@Test\n\tpublic final void testReadDataCompleteReadIOException() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tbyte[] data = new byte[20];\n\t\tint offset = 0;\n\t\tint length = data.length;\n\... | {
"fields": [
{
"declarator": "DEFAULT_PORT_TIMEOUT = 10",
"modifier": "public static final",
"original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;",
"type": "int",
"var_name": "DEFAULT_PORT_TIMEOUT"
},
{
"declarator": "DEFAULT_DATA_BITS = 8",
"mo... | {
"body": "@Override\n\tpublic int readData(byte[] data) throws IOException {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Buffer cannot be null.\");\n\t\t\n\t\tint readBytes = 0;\n\t\tif (getInputStream() != null)\n\t\t\treadBytes = getInputStream().read(data);\n\t\treturn readBytes;\n\t}",
"clas... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_107 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete Remote AT Command packet.\")));\n\t\t\n\t\t// Call the method ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 15",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 15;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "destAddress64",
"mo... | {
"body": "public static RemoteATCommandPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Remote AT Command packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 8 (64-bit address) + 2 (16-bit address) + 1 (transmit options byte) + 2 (AT... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_804 | {
"fields": [
{
"declarator": "INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09}",
"modifier": "private final static",
"original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0... | {
"body": "@Test\n\tpublic final void testHashCodeIsConsistent() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress addr = new XBee64BitAddress(\"0x0013A20040123456\");\n\t\t\n\t\tint initialHashCode = addr.hashCode();\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Consistent hashcode test fails\",... | {
"fields": [
{
"declarator": "COORDINATOR_ADDRESS = new XBee64BitAddress(\"0000\")",
"modifier": "public static final",
"original_string": "public static final XBee64BitAddress COORDINATOR_ADDRESS = new XBee64BitAddress(\"0000\");",
"type": "XBee64BitAddress",
"var_name": "COORDINAT... | {
"body": "@Override\n\tpublic int hashCode() {\n\t\tint hash = HASH_SEED;\n\t\tfor (byte b:getValue())\n\t\t\thash = hash * (hash + b);\n\t\treturn hash;\n\t}",
"class_method_signature": "XBee64BitAddress.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "h... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_412 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersInvalidReceivedData() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 40;\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tRX16IOPa... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress16",
"mo... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"16-bit source address\", HexUtils.prettyHexString(sourceAddress16.toString()));\n\t\tparameters.put(\"RSSI\", HexUtils.pret... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_296 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_REQUEST.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_REQUEST.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "requestID = 0x01",... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersTargetAndDataNotNull() {\n\t\t// Set up the resources for the test.\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet.getAPIP... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Device Request ID\", HexUtils.prettyHexString(HexUtils.integerToHexString(requestID, 1)) + \" (\" + requestID + \")\");\n\t... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_89 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterByteArray() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tbyte[] parameter = new byte[]{0x6D, 0x79, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65};\n\t\tATCommandPacket packet = new ATComma... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 4",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "command",
"modifier":... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"AT Command\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(command.getBytes())) + \" (\" + command + \")\");\n\t\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_66 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBroadcastWithBroadcastOptionEnabled() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint sourceEndpoint = 0xA0;\n\t\tint d... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 18",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 18;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "DATA_ENDPOINT = 0xE8",
... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\tif (ByteUtils.isBitEnabled(getReceiveOptions(), 1))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"class_method_signature": "ExplicitRxIndicatorPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_629 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/ATCommandExceptionTest.java",
"identifier": "ATCommandExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetMessageOnlyCommandStatusAndMessageBothNull() {\n\t\t// Setup the resources for the test.\n\t\tATCommandStatus atCommandStatus = null;\n\t\tString message = null;\n\t\tATCommandException e = new ATCommandException(message, atCommandStatus);\n\t\t\n\t\t// Call the method und... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAULT_MESSAGE = \"There was a problem s... | {
"body": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (atCommandStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + atCommandStatus.getDescripti... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_279 | {
"fields": [
{
"declarator": "frameType = APIFrameType.SEND_DATA_REQUEST.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.SEND_DATA_REQUEST.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x... | {
"body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Send Data Request packet payload cannot be null.\")));\n\n\t\t// Call the method und... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 6",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 6;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Send... | {
"body": "public static SendDataRequestPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != A... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_783 | {
"fields": [
{
"declarator": "INVALID_BYTE_ARRAY = new byte[]{0x01, 0x02, 0x03}",
"modifier": "private final static",
"original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x01, 0x02, 0x03};",
"type": "byte[]",
"var_name": "INVALID_BYTE_ARRAY"
},
{
... | {
"body": "@Test\n\tpublic final void testHashCodeIsConsistent() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress addr = new XBee16BitAddress(\"0x1234\");\n\t\t\n\t\tint initialHashCode = addr.hashCode();\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Consistent hashcode test fails\", addr.hashCo... | {
"fields": [
{
"declarator": "COORDINATOR_ADDRESS = new XBee16BitAddress(\"0000\")",
"modifier": "public static final",
"original_string": "public static final XBee16BitAddress COORDINATOR_ADDRESS = new XBee16BitAddress(\"0000\");",
"type": "XBee16BitAddress",
"var_name": "COORDINAT... | {
"body": "@Override\n\tpublic int hashCode() {\n\t\tint hash = HASH_SEED;\n\t\tfor (byte b:getValue())\n\t\t\thash = hash * (hash + b);\n\t\treturn hash;\n\t}",
"class_method_signature": "XBee16BitAddress.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"identifier": "h... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_150 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0xE7;\n\t\tbyte[] atCommand = \"NI\".getBytes();\n\t\tint status = ATCommandStatus.OK.getId();\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\t\n\t\tbyte[] pa... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "status",
"modifier": ... | {
"body": "public static ATCommandResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"AT Command Response packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (AT command) + 1 (status byte)\n\t\tif (payload.length < MIN_API_PAYL... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_500 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testParsePacketEmptyByteArray() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Packet length should be greater than 0.\... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_445 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersInvalidReceivedData() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 75;\n\t\tint options = 40;\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"64-bit source address\", HexUtils.prettyHexString(sourceAddress64.toString()));\n\t\tparameters.put(\"RSSI\", HexUtils.pret... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_652 | {
"fields": [
{
"declarator": "PARAMETER_AI = \"AI\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_AI = \"AI\";",
"type": "String",
"var_name": "PARAMETER_AI"
},
{
"declarator": "RESPONSE_AI = new byte[]{0x00}",
"m... | {
"body": "@Test\n\tpublic void testSendIPDataProtocolIllegalTCPSSL() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tInet6Address address = (Inet6Address) Inet6Address.getByName(\"FDB3:0001:0002:0000:0004:0005:0006:0007\");\n\t\tbyte[] data = \"Hello XBee\".getBytes();\n\t\tint destPort = 1234;\n\... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in Thread protocol.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in Thread protocol.\";",
"type": "String",
"var_n... | {
"body": "@Override\n\tpublic void sendIPData(Inet6Address ipv6Address, int destPort,\n\t\t\tIPProtocol protocol, byte[] data) throws TimeoutException,\n\t\t\tXBeeException {\n\t\tif (protocol != IPProtocol.UDP && protocol != IPProtocol.COAP)\n\t\t\tthrow new IllegalArgumentException(ERROR_PROTOCOL_ILLEGAL);\n\t\tsu... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_202 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterNull() {\n\t\tparameter = null;\n\t\tIPv6RemoteATCommandRequestPacket packet = new IPv6RemoteATCommandRequestPacket(frameID, ipv6address, transmitOptions, command, parameter);\n\t\t\n\t\tString expectedDestAddr = HexUtils.prettyHexStrin... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Destination address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(destAddress.getAddress())) + \n\t\t\t\t\" (\"... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_717 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBitEnabledFalse() {\n\t\t// Setup the resources for the test.\n\t\tint n = 0x0;\n\t\tboolean expectedResult = false;\n\t\t\n\t\t// Call the method under test.\n\t\tboolean result = ByteUtils.isBitEnabled(n, 5);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Bit must be ... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static boolean isBitEnabled(int containerInteger, int bitPosition) {\n\t\tif (bitPosition < 0 || bitPosition > 31)\n\t\t\tthrow new IllegalArgumentException(\"Bit position must be between 0 and 31.\");\n\t\t\n\t\treturn (((containerInteger & 0xFFFFFFFF) >> bitPosition) & 0x01) == 0x01;\n\t}",
"cla... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_347 | {
"fields": [
{
"declarator": "frameType = APIFrameType.TX_SMS.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.TX_SMS.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",
"modifier":... | {
"body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"TX SMS packet payload cannot be null.\")));\n\n\t\t// Call the method under test tha... | {
"fields": [
{
"declarator": "PHONE_NUMBER_LENGTH = 20",
"modifier": "static final",
"original_string": "static final int PHONE_NUMBER_LENGTH = 20;",
"type": "int",
"var_name": "PHONE_NUMBER_LENGTH"
},
{
"declarator": "PHONE_NUMBER_PATTERN = \"^\\\\+?\\\\d+$\"",
... | {
"body": "public static TXSMSPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTyp... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_594 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationReadDataTimeout() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that sho... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";",
"type": "String",
"var_name": "O... | {
"body": "@Override\n\tpublic XBeeMessage readData() {\n\t\t// Not supported in IPv6 modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPv6Device.readData()",
"constructor": false,
"full_signature": "@Override public XBeeMessage readData()",
"identi... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_255 | {
"fields": [
{
"declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_SR... | {
"body": "@Test\n\tpublic final void testSetStatusNull() {\n\t\t// Set up the resources for the test.\n\t\tCoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texcept... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 41",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public void setStatus(RestFulStatusEnum restFulStatus) {\n\t\tif (restFulStatus == null)\n\t\t\tthrow new NullPointerException(ERROR_STATUS_NULL);\n\n\t\tthis.restFulStatus = restFulStatus;\n\t}",
"class_method_signature": "CoAPRxResponsePacket.setStatus(RestFulStatusEnum restFulStatus)",
"constructor"... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_605 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java",
"identifier": "TransmitExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetMessageOnlyTransmitStatusNull() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = null;\n\t\tTransmitException e = new TransmitException(transmitStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tString result = e.getMessage();\n\t\t... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAULT_MESSAGE = \"There was a problem t... | {
"body": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (transmitStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + transmitStatus.toString();\n\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_310 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_RESPONSE.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",... | {
"body": "@Test\n\tpublic final void testSetRequestIDBiggerThan255() {\n\t\t// Set up the resources for the test.\n\t\tDeviceResponsePacket packet = new DeviceResponsePacket(frameID, requestID, data);\n\n\t\trequestID = 256;\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 4",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "public void setRequestID(int requestID) {\n\t\tif (requestID < 0 || requestID > 255)\n\t\t\tthrow new IllegalArgumentException(ERROR_REQUEST_ID_ILLEGAL);\n\n\t\tthis.requestID = requestID;\n\t}",
"class_method_signature": "DeviceResponsePacket.setRequestID(int requestID)",
"constructor": false,
"full... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_740 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testSwapByteArrayEmptyArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] original = new byte[0];\n\t\tbyte[] expectedResult = new byte[0];\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.swapByteArray(original);\n\t\t\n\t\t// Verify the resul... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static byte[] swapByteArray(byte[] source) {\n\t\tif (source == null)\n\t\t\tthrow new NullPointerException(\"Source cannot be null.\");\n\t\t\n\t\tif (source.length == 0)\n\t\t\treturn new byte[0];\n\t\t\n\t\tbyte[] swapped = new byte[source.length];\n\t\tfor (int i = 0; i < source.length; i++)\n\t... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_469 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetRFDataNullData() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] receivedData = null;\n\t\tRX16Packet packet = new RX16Packet(source16Addr,... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress16",
"mo... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "RX16Packet.getRFData()",
"constructor": false,
"full_signature": "public byte[] getRFData()",
"identifier": "getRFData",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_193 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic final void testIsBroadcast() {\n\t\t// Setup the resources for the test.\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frameID, ipv6address, command, \n\t\t\t\tstatus, new byte[0]);\n\t\t\n\t\texception.expect(Uns... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPv6RemoteATCommandResponsePacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroad... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_486 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testParsePacketNullOperatingMode() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Operating mode must be API or API Escaped.\")));\n\t\t\n\t\t// Call the me... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_613 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java",
"identifier": "XBeeExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testCreateXBeeExceptionMessage() {\n\t\t// Setup the resources for the test.\n\t\tString message = \"This is the message\";\n\t\t\n\t\t// Call the method under test.\n\t\tXBeeException e = new XBeeException(message);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Created 'XBe... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/src/main/java/com/digi/xbee/api/exceptions/XB... | {
"body": "@Override\n\tpublic Throwable getCause() {\n\t\treturn super.getCause();\n\t}",
"class_method_signature": "XBeeException.getCause()",
"constructor": false,
"full_signature": "@Override public Throwable getCause()",
"identifier": "getCause",
"invocations": [
"getCause"
],
"modifiers": "@Ov... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_243 | {
"fields": [
{
"declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_SR... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[40];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem.arraycopy(destAddress.getAddress(), 0, payload, 2, destAddress.getAddress().... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 41",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public static CoAPRxResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != AP... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_756 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testPrettyHexStringNullString() {\n\t\t// Setup the resources for the test.\n\t\tString s = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Hexadecimal string cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tH... | {
"fields": [
{
"declarator": "HEXES = \"0123456789ABCDEF\"",
"modifier": "private static final",
"original_string": "private static final String HEXES = \"0123456789ABCDEF\";",
"type": "String",
"var_name": "HEXES"
},
{
"declarator": "HEX_HEADER = \"0x\"",
"modif... | {
"body": "public static String prettyHexString(String hexString) {\n\t\tif (hexString == null)\n\t\t\tthrow new NullPointerException(\"Hexadecimal string cannot be null.\");\n\t\t\n\t\tString copy = hexString.toUpperCase();\n\t\tfor (final char c : copy.toCharArray()) {\n\t\t\tif (!HEXES.contains(\"\"+c))\n\t\t\t\tt... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_306 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_RESPONSE.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[3 + data.length];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)requestID;\n\t\tpayload[2] = (byte)0x00;\n\t\tSystem.arraycopy(data, 0, payload, 3... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 4",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "public static DeviceResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != AP... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_185 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"IPv6 Remote AT command response packet payload cannot be null.\")));\n\t\t\n\t\t// Ca... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "public static IPv6RemoteATCommandResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\t// 1 (Frame type) + 1 (frame ID) + 16 (IPv6 source address) + 2 (AT command) + 1 (status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LEN... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_490 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testParsePacketStringAPIEscapedWithAPI() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E000F1701007D33A20040AD142EFFFE024E496D\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equalTo(\... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_214 | {
"fields": [
{
"declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDRESS"
... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadInvalidIP() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[24];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem.arraycopy(destAddress.getAddress(), 0, payload, 2, destAddress.getA... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 24",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 24;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"TX... | {
"body": "public static TXIPv6Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTy... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_644 | {
"fields": [
{
"declarator": "PARAMETER_AI = \"AI\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_AI = \"AI\";",
"type": "String",
"var_name": "PARAMETER_AI"
},
{
"declarator": "PARAMETER_MA = \"MA\"",
"modifier":... | {
"body": "@Test\n\tpublic void testGetGatewayAddress() throws Exception {\n\t\t// Return a valid response when requesting the GW parameter value.\n\t\tMockito.doReturn(IP_ADDRESS).when(wifiDevice).getParameter(PARAMETER_GW);\n\n\t\tassertEquals(Inet4Address.getByAddress(IP_ADDRESS), wifiDevice.getGatewayIPAddress())... | {
"fields": [
{
"declarator": "DEFAULT_ACCESS_POINT_TIMETOUT = 15000",
"modifier": "private final static",
"original_string": "private final static int DEFAULT_ACCESS_POINT_TIMETOUT = 15000;",
"type": "int",
"var_name": "DEFAULT_ACCESS_POINT_TIMETOUT"
},
{
"declarator":... | {
"body": "public Inet4Address getGatewayIPAddress() throws TimeoutException, XBeeException {\n\t\ttry {\n\t\t\treturn (Inet4Address) Inet4Address.getByAddress(getParameter(\"GW\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\tthrow new XBeeException(e);\n\t\t}\n\t}",
"class_method_signature": "WiFiDevice.getGat... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_351 | {
"fields": [
{
"declarator": "frameType = APIFrameType.TX_SMS.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.TX_SMS.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",
"modifier":... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNull() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tTXSMSPacket packet = new TXSMSPacket(frameID, phoneNumber, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet.getA... | {
"fields": [
{
"declarator": "PHONE_NUMBER_LENGTH = 20",
"modifier": "static final",
"original_string": "static final int PHONE_NUMBER_LENGTH = 20;",
"type": "int",
"var_name": "PHONE_NUMBER_LENGTH"
},
{
"declarator": "PHONE_NUMBER_PATTERN = \"^\\\\+?\\\\d+$\"",
... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Transmit options\", HexUtils.prettyHexString(HexUtils.integerToHexString(transmitOptions, 1)));\n\t\tparameters.put(\"Phone... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_701 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testShortToByteArray() {\n\t\t// Setup the resources for the test.\n\t\tshort s = 0x7FFF;\n\t\tbyte[] expectedResult = new byte[]{0x7F, (byte)0xFF};\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.shortToByteArray(s);\n\t\t\n\t\t// Verify the result.\n\t\... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static byte[] shortToByteArray(short value) {\n\t\tbyte[] b = new byte[2];\n\t\tb[0] = (byte)((value >> 8) & 0xFF);\n\t\tb[1] = (byte)(value & 0xFF);\n\t\treturn b;\n\t}",
"class_method_signature": "ByteUtils.shortToByteArray(short value)",
"constructor": false,
"full_signature": "public stati... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_428 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetRFDataNullData() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] data = null;\n\t\tTX64Packet packet = new TX64Packet(frameI... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "transmitOptions",
"... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "TX64Packet.getRFData()",
"constructor": false,
"full_signature": "public byte[] getRFData()",
"identifier": "getRFData",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_582 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@Test(expected=InvalidOperatingModeException.class)\n\tpublic void testStartListeningInvalidOperatingMode() throws TimeoutException, XBeeException {\n\t\t// Throw an Invalid operating mode exception when setting any parameter.\n\t\tMockito.doThrow(new InvalidOperatingModeException()).when(ipv6Device).setPa... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";",
"type": "String",
"var_name": "O... | {
"body": "public void startListening(int sourcePort) throws TimeoutException, XBeeException {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(\"Source port must be between 0 and 65535.\");\n\t\t\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)sourcePort));\n\t\tth... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_429 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetRFDataValidData() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tTX64Packet... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "transmitOptions",
"... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "TX64Packet.getRFData()",
"constructor": false,
"full_signature": "public byte[] getRFData()",
"identifier": "getRFData",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_583 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@Test(expected=TimeoutException.class)\n\tpublic void testStartListeningTimeout() throws TimeoutException, XBeeException {\n\t\t// Throw an timeout exception when setting any parameter.\n\t\tMockito.doThrow(new TimeoutException()).when(ipv6Device).setParameter(Mockito.anyString(), Mockito.any(byte[].class)... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";",
"type": "String",
"var_name": "O... | {
"body": "public void startListening(int sourcePort) throws TimeoutException, XBeeException {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(\"Source port must be between 0 and 65535.\");\n\t\t\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)sourcePort));\n\t\tth... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_215 | {
"fields": [
{
"declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDRESS"
... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNull() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tTXIPv6Packet packet = new TXIPv6Packet(frameID, destAddress, destPort, sourcePort, protocol, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 24",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 24;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"TX... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Destination address\", HexUtils.prettyHexString(destAddress.getAddress()) + \" (\" + destAddress.getHostAddress() + \")\");... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_645 | {
"fields": [
{
"declarator": "PARAMETER_AI = \"AI\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_AI = \"AI\";",
"type": "String",
"var_name": "PARAMETER_AI"
},
{
"declarator": "PARAMETER_MA = \"MA\"",
"modifier":... | {
"body": "@Test\n\tpublic void testSetDNSAddressNull() throws Exception {\n\t\t// Set up the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"DNS address cannot be null.\")));\n\n\t\t// Call the method under test that should throw a NullPointerExcep... | {
"fields": [
{
"declarator": "DEFAULT_ACCESS_POINT_TIMETOUT = 15000",
"modifier": "private final static",
"original_string": "private final static int DEFAULT_ACCESS_POINT_TIMETOUT = 15000;",
"type": "int",
"var_name": "DEFAULT_ACCESS_POINT_TIMETOUT"
},
{
"declarator":... | {
"body": "public void setDNSAddress(Inet4Address address) throws TimeoutException, XBeeException {\n\t\tif (address == null)\n\t\t\tthrow new NullPointerException(\"DNS address cannot be null.\");\n\t\t\n\t\tsetParameter(\"NS\", address.getAddress());\n\t}",
"class_method_signature": "WiFiDevice.setDNSAddress(Inet... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_350 | {
"fields": [
{
"declarator": "frameType = APIFrameType.TX_SMS.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.TX_SMS.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",
"modifier":... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] phoneNumber = Arrays.copyOf(this.phoneNumber.getBytes(), 20);\n\n\t\tbyte[] payload = new byte[22 + data.length()];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)opt... | {
"fields": [
{
"declarator": "PHONE_NUMBER_LENGTH = 20",
"modifier": "static final",
"original_string": "static final int PHONE_NUMBER_LENGTH = 20;",
"type": "int",
"var_name": "PHONE_NUMBER_LENGTH"
},
{
"declarator": "PHONE_NUMBER_PATTERN = \"^\\\\+?\\\\d+$\"",
... | {
"body": "public static TXSMSPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTyp... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_700 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testByteArrayToIntMoreThan4Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12, 0x34, (byte)0x85, (byte)0x96, 0x23, 0x47, 0x56, 0x20, 0x63, 0x67};\n\t\tint expectedResult = 0x12348596;\n\t\t\n\t\t// Call the method under test.\n\t\tint resu... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static int byteArrayToInt(byte[] byteArray) {\n\t\tif (byteArray == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\tif (byteArray.length == 0)\n\t\t\treturn 0;\n\t\t\n\t\tbyte[] values = byteArray;\n\t\tif (byteArray.length < 4) {\n\t\t\tvalues = new byte[4];\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_184 | {
"fields": [
{
"declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDRESS"
... | {
"body": "@Test\n\tpublic final void testGetDataValidData() {\n\t\t// Set up the resources for the test.\n\t\tCoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);\n\n\t\t// Call the method under test.\n\t\tbyte[] result = packet.getPayload();\n\n\t\t// Verify th... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 26",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 26;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public byte[] getPayload() {\n\t\tif (payload == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(payload, payload.length);\n\t}",
"class_method_signature": "CoAPTxRequestPacket.getPayload()",
"constructor": false,
"full_signature": "public byte[] getPayload()",
"identifier": "getPayload",
"in... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_491 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testParsePacketStringAPIInvalidChecksum() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E000F17010013A20040AD142EFFFE024E4969\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equalTo(\"... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_612 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java",
"identifier": "XBeeExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testCreateXBeeExceptionCauseNull() {\n\t\t// Setup the resources for the test.\n\t\tThrowable cause = null;\n\t\t\n\t\t// Call the method under test.\n\t\tXBeeException e = new XBeeException(cause);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Created 'XBeeException' does n... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "library/src/main/java/com/digi/xbee/api/exceptions/XB... | {
"body": "@Override\n\tpublic Throwable getCause() {\n\t\treturn super.getCause();\n\t}",
"class_method_signature": "XBeeException.getCause()",
"constructor": false,
"full_signature": "@Override public Throwable getCause()",
"identifier": "getCause",
"invocations": [
"getCause"
],
"modifiers": "@Ov... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_242 | {
"fields": [
{
"declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_SR... | {
"body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete CoAP Rx Response packet.\")));\n\n\t\t// Call the method unde... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 41",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public static CoAPRxResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != AP... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_757 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testPrettyHexStringNonHexadecimalString() {\n\t\t// Setup the resources for the test.\n\t\tString s = \"tyurw\";\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Given string cannot contain non-hexadecimal characters.\")));\n\t\t\n\... | {
"fields": [
{
"declarator": "HEXES = \"0123456789ABCDEF\"",
"modifier": "private static final",
"original_string": "private static final String HEXES = \"0123456789ABCDEF\";",
"type": "String",
"var_name": "HEXES"
},
{
"declarator": "HEX_HEADER = \"0x\"",
"modif... | {
"body": "public static String prettyHexString(String hexString) {\n\t\tif (hexString == null)\n\t\t\tthrow new NullPointerException(\"Hexadecimal string cannot be null.\");\n\t\t\n\t\tString copy = hexString.toUpperCase();\n\t\tfor (final char c : copy.toCharArray()) {\n\t\t\tif (!HEXES.contains(\"\"+c))\n\t\t\t\tt... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_307 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_RESPONSE.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersDataNull() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tDeviceResponsePacket packet = new DeviceResponsePacket(frameID, requestID, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = pac... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 4",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Device Request ID\", HexUtils.prettyHexString(HexUtils.integerToHexString(requestID, 1)) + \" (\" + requestID + \")\");\n\t... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_468 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBroadcastWithBroadcastOptionBit2Enabled() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress16",
"mo... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1)\n\t\t\t\t|| ByteUtils.isBitEnabled(getReceiveOptions(), 2);\n\t}",
"class_method_signature": "RX16Packet.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_192 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandValueByteArrayNonStringCmd() {\n\t\t// Setup the resources for the test.\n\t\tString command = \"DL\";\n\t\tbyte[] commandValue = new byte[]{0x6D, 0x79};\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frame... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Source address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(sourceAddress.getAddress())) + \" (\" + sourceAddr... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_487 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testParsePacketUnknownOperatingMode() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Operating mode must be API or API Escaped.\")));\n\t\t\n\t\t// Call the... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_254 | {
"fields": [
{
"declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_SR... | {
"body": "@Test\n\tpublic final void testSetProtocolNull() {\n\t\t// Set up the resources for the test.\n\t\tCoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texce... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 41",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public void setProtocol(IPProtocol protocol) {\n\t\tif (protocol == null)\n\t\t\tthrow new NullPointerException(ERROR_PROTOCOL_NULL);\n\n\t\tthis.protocol = protocol;\n\t}",
"class_method_signature": "CoAPRxResponsePacket.setProtocol(IPProtocol protocol)",
"constructor": false,
"full_signature": "pub... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_604 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java",
"identifier": "TransmitExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetMessageOnlyTransmitStatus() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.UNKNOWN;\n\t\tTransmitException e = new TransmitException(transmitStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tString result = e.g... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAULT_MESSAGE = \"There was a problem t... | {
"body": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (transmitStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + transmitStatus.toString();\n\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_311 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_RESPONSE.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = 0x01",... | {
"body": "@Test\n\tpublic final void testSetRequestIDNegative() {\n\t\t// Set up the resources for the test.\n\t\tDeviceResponsePacket packet = new DeviceResponsePacket(frameID, requestID, data);\n\n\t\trequestID = -1;\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 4",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "public void setRequestID(int requestID) {\n\t\tif (requestID < 0 || requestID > 255)\n\t\t\tthrow new IllegalArgumentException(ERROR_REQUEST_ID_ILLEGAL);\n\n\t\tthis.requestID = requestID;\n\t}",
"class_method_signature": "DeviceResponsePacket.setRequestID(int requestID)",
"constructor": false,
"full... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_741 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testSwapByteArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] original = new byte[] {'B', 'y', 'e', ' ', 'm', 'y', ' ', 'f', 'r', 'i', 'e', 'n', 'd'};\n\t\tbyte[] expectedResult = new byte[]{'d', 'n', 'e', 'i', 'r', 'f', ' ', 'y', 'm', ' ', 'e', 'y', 'B'};\n\t\t\n\t... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static byte[] swapByteArray(byte[] source) {\n\t\tif (source == null)\n\t\t\tthrow new NullPointerException(\"Source cannot be null.\");\n\t\t\n\t\tif (source.length == 0)\n\t\t\treturn new byte[0];\n\t\t\n\t\tbyte[] swapped = new byte[source.length];\n\t\tfor (int i = 0; i < source.length; i++)\n\t... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_595 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationReadDataFrom() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that should... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";",
"type": "String",
"var_name": "O... | {
"body": "@Override\n\tpublic XBeeMessage readDataFrom(RemoteXBeeDevice remoteXBeeDevice) {\n\t\t// Not supported in IPv6 modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPv6Device.readDataFrom(RemoteXBeeDevice remoteXBeeDevice)",
"constructor": false... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_653 | {
"fields": [
{
"declarator": "PARAMETER_AI = \"AI\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_AI = \"AI\";",
"type": "String",
"var_name": "PARAMETER_AI"
},
{
"declarator": "RESPONSE_AI = new byte[]{0x00}",
"m... | {
"body": "@Test\n\tpublic void testSendIPDataAsyncProtocolIllegalTCP() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tInet6Address address = (Inet6Address) Inet6Address.getByName(\"FDB3:0001:0002:0000:0004:0005:0006:0007\");\n\t\tbyte[] data = \"Hello XBee\".getBytes();\n\t\tint destPort = 1234;\... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in Thread protocol.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in Thread protocol.\";",
"type": "String",
"var_n... | {
"body": "@Override\n\tpublic void sendIPDataAsync(Inet6Address ipv6Address, int destPort,\n\t\t\tIPProtocol protocol, byte[] data) throws XBeeException {\n\t\tif (protocol != IPProtocol.UDP && protocol != IPProtocol.COAP)\n\t\t\tthrow new IllegalArgumentException(ERROR_PROTOCOL_ILLEGAL);\n\t\tsuper.sendIPDataAsync(... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_203 | {
"fields": [
{
"declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"",
"modifier": "private static final",
"original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";",
"type": "String",
"var_name": "IPV6_ADDR"
},
... | {
"body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterString() {\n\t\tIPv6RemoteATCommandRequestPacket packet = new IPv6RemoteATCommandRequestPacket(frameID, ipv6address, transmitOptions, command, parameterStr);\n\t\t\n\t\tString expectedDestAddr = HexUtils.prettyHexString(ipv6address.getA... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Destination address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(destAddress.getAddress())) + \n\t\t\t\t\" (\"... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_716 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBitEnabledTrue() {\n\t\t// Setup the resources for the test.\n\t\tint n = 0xFFFF;\n\t\tboolean expectedResult = true;\n\t\t\n\t\t// Call the method under test.\n\t\tboolean result = ByteUtils.isBitEnabled(n, 5);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Bit must be... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static boolean isBitEnabled(int containerInteger, int bitPosition) {\n\t\tif (bitPosition < 0 || bitPosition > 31)\n\t\t\tthrow new IllegalArgumentException(\"Bit position must be between 0 and 31.\");\n\t\t\n\t\treturn (((containerInteger & 0xFFFFFFFF) >> bitPosition) & 0x01) == 0x01;\n\t}",
"cla... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_346 | {
"fields": [
{
"declarator": "IP_ADDRESS = \"10.10.11.12\"",
"modifier": "private static final",
"original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";",
"type": "String",
"var_name": "IP_ADDRESS"
},
{
"declarator": "frameType = APIFrameType.RX_I... | {
"body": "@Test\n\tpublic final void testGetDataValidData() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv4Packet packet = new RXIPv4Packet(sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\t// Call the method under test.\n\t\tbyte[] result = packet.getData();\n\n\t\t// Verify the result.\n\t\tass... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"RX... | {
"body": "public byte[] getData() {\n\t\tif (data == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(data, data.length);\n\t}",
"class_method_signature": "RXIPv4Packet.getData()",
"constructor": false,
"full_signature": "public byte[] getData()",
"identifier": "getData",
"invocations": [
"copyOf"
... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_151 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testGetAPIDataATCommandParameterNullWithUnknownStatus() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.AT_COMMAND_RESPONSE.getValue();\n\t\tint frameID = 0x10;\n\t\tbyte[] atCommand = \"NI\".getBytes();\n\t\tint status = 254;\n\t\t\n\t\tbyte[] paylo... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "status",
"modifier": ... | {
"body": "public static ATCommandResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"AT Command Response packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (AT command) + 1 (status byte)\n\t\tif (payload.length < MIN_API_PAYL... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.