id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
21871478_762 | {
"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 testPrettyHexStringWithByteArrayGeneral() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] array = new byte[]{0x01, (byte)0xe2, 0x58, (byte)0x9d, 0x3a, (byte)0x89, 0x6f, 0x47, (byte)0xc9, 0x0b};\n\t\tString expectedResult = \"01 E2 58 9D 3A 89 6F 47 C9 0B\";\n\t\t\n\t\t// ... | {
"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_298 | {
"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 testSetRequestIDBiggerThan255() {\n\t\t// Set up the resources for the test.\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\trequestID = 256;\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalT... | {
"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": "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": "DeviceRequestPacket.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_87 | {
"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 testGetAPIPacketParametersATCommandParameterNull() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tString parameter = null;\n\t\tATCommandPacket packet = new ATCommandPacket(frameID, command, parameter);\n\t\t\n\t\tString ex... | {
"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_670 | {
"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 testNotSupportedOperationRemoveDataListener() 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 ... | {
"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 removeDataListener(IDataReceiveListener listener) {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPDevice.removeDataListener(IDataReceiveListener listener)",
"constructor": false,
"fu... | {
"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_220 | {
"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 testSetSourcePortNegative() {\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(\"Por... | {
"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 setSourcePort(int sourcePort) {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.sourcePort = sourcePort;\n\t}",
"class_method_signature": "TXIPv6Packet.setSourcePort(int sourcePort)",
"constructor": false,
"full_sig... | {
"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_735 | {
"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 testNewByteArrayZeroFinalSize() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] original = new byte[]{'1', '2', '3', '4'};\n\t\tbyte[] expectedResult = new byte[0];\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.newByteArray(original, 0);\n\t\t\n... | {
"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[] newByteArray(byte[] data, int finalSize) {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Data cannot be null.\");\n\t\tif (finalSize < 0)\n\t\t\tthrow new IllegalArgumentException(\"Final size must be equal or greater than 0.\");\n\t\t\n\t\tif (finalSize == 0)\n\t\t\tr... | {
"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_365 | {
"fields": [
{
"declarator": "frameType = APIFrameType.RX_SMS.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.RX_SMS.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "phoneNumber = \"555203203\"",
... | {
"body": "@Test\n\tpublic final void testGetDataNullData() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tRXSMSPacket packet = new RXSMSPacket(phoneNumber, data);\n\n\t\t// Call the method under test.\n\t\tString result = packet.getData();\n\n\t\t// Verify the result.\n\t\tassertThat(\"Data mu... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 1 /* (Frame type) */ + TXSMSPacket.PHONE_NUMBER_LENGTH",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 1 /* (Frame type) */ + TXSMSPacket.PHONE_NUMBER_LENGTH;",
"type": "int"... | {
"body": "public String getData() {\n\t\treturn this.data;\n\t}",
"class_method_signature": "RXSMSPacket.getData()",
"constructor": false,
"full_signature": "public String getData()",
"identifier": "getData",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signatu... | {
"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_109 | {
"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\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint options =... | {
"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_559 | {
"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 testGetPortParametersDefault() {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tSerialPortParameters expected = new SerialPortParameters(9600, AbstractSerialPort.DEFAULT_DATA_BITS, \n\t\t\... | {
"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 SerialPortParameters getPortParameters() {\n\t\tif (parameters != null)\n\t\t\treturn parameters;\n\t\treturn new SerialPortParameters(baudRate, DEFAULT_DATA_BITS, \n\t\t\t\tDEFAULT_STOP_BITS, DEFAULT_PARITY, DEFAULT_FLOW_CONTROL);\n\t}",
"class_method_signature": "AbstractSerialPort.getPortParame... | {
"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_29 | {
"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 testIsBroadcastWithNon16BitBroadcastAnd64BitBroadcastDestinationAddress() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"FFFF\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t... | {
"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_236 | {
"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 testSetSourcePortNegative() {\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(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo... | {
"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 setSourcePort(int sourcePort) {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_SOURCE_PORT_ILLEGAL);\n\n\t\tthis.sourcePort = sourcePort;\n\t}",
"class_method_signature": "RXIPv6Packet.setSourcePort(int sourcePort)",
"constructor": false,
"f... | {
"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_666 | {
"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 testNotSupportedOperationSetDestinationAddress() 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 th... | {
"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 setDestinationAddress(XBee64BitAddress xbee64BitAddress)\n\t\t\tthrows TimeoutException, XBeeException {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPDevice.setDestinationAddress(XBee64... | {
"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_373 | {
"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.IO_D... | {
"body": "@Test\n\tpublic final void testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tIODataSampleRxIndicatorWifiPacket packet = new IODataSampleRxIndicatorWifiPacket(sourceAddress, rssi, receiveOptions, data);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Packet sh... | {
"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 = \"IO... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "IODataSampleRxIndicatorWifiPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroadcast",
"invocations": [],
"modifiers": "@Ove... | {
"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_689 | {
"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 testLongToByteArray() {\n\t\t// Setup the resources for the test.\n\t\tlong l = 0x1234859623475620L;\n\t\tbyte[] expectedResult = new byte[]{0x12, 0x34, (byte)0x85, (byte)0x96, 0x23, 0x47, 0x56, 0x20};\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.longT... | {
"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[] longToByteArray(long value) {\n\t\treturn new byte[] {\n\t\t\t\t(byte)((value >>> 56) & 0xFF),\n\t\t\t\t(byte)((value >>> 48) & 0xFF),\n\t\t\t\t(byte)((value >>> 40) & 0xFF),\n\t\t\t\t(byte)((value >>> 32) & 0xFF),\n\t\t\t\t(byte)((value >>> 24) & 0xFF),\n\t\t\t\t(byte)((value >>> 16) ... | {
"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_723 | {
"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 testReadIntegerFromByteOffset() {\n\t\t// Setup the resources for the test.\n\t\tint expectedResult = 0xB; // 0b1011\n\t\t\n\t\t// Call the method under test.\n\t\tint result = ByteUtils.readIntegerFromByte((byte)0x36 /* 0b110110 */, 1, 4);\n\t\t\n\t\t// Verify the result.\n\t\ta... | {
"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 readIntegerFromByte(byte containerByte, int bitOffset, int bitLength) {\n\t\tif (bitOffset < 0 || bitOffset > 7)\n\t\t\tthrow new IllegalArgumentException(\"Offset must be between 0 and 7.\");\n\t\tif (bitLength < 0 || bitLength > 7)\n\t\t\tthrow new IllegalArgumentException(\"Length must... | {
"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_631 | {
"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(expected=IllegalArgumentException.class)\n\tpublic void testSetAccessPointTimeoutNegative() {\n\t\t// Call the method under test.\n\t\twifiDevice.setAccessPointTimeout(-50);\n\t}",
"class_method_signature": "WiFiDeviceTest.testSetAccessPointTimeoutNegative()",
"constructor": false,
"full_signat... | {
"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 setAccessPointTimeout(int accessPointTimeout) {\n\t\tif (accessPointTimeout < 0)\n\t\t\tthrow new IllegalArgumentException(\"Access point timeout cannot be less than 0.\");\n\t\t\n\t\tthis.accessPointTimeout = accessPointTimeout;\n\t}",
"class_method_signature": "WiFiDevice.setAccessPointTime... | {
"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_261 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[2];\n\t\tpayload[0] = (byte)error.getID();\n\t\tpayload[1] = (byte)error.getID();\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.exp... | {
"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_91 | {
"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 = 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 ATCommandPacket(frameID, command, parameter);... | {
"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 boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "ATCommandPacket.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_774 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator": "lp... | {
"body": "@Test\n\tpublic void testSendIPDataAsync() throws Exception {\n\t\t// Do nothing when the sendIPDataAsync of IPDevice is called.\n\t\tMockito.doNothing().when((IPDevice)lpWanDevice).sendIPDataAsync(Mockito.any(Inet4Address.class), \n\t\t\t\tMockito.anyInt(), Mockito.any(IPProtocol.class), Mockito.any(byte[... | {
"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 void sendIPDataAsync(Inet4Address ipAddress, int destPort, IPProtocol protocol, \n\t\t\tbyte[] data) throws TimeoutException, XBeeException {\n\t\tif (protocol != IPProtocol.UDP)\n\t\t\tthrow new IllegalArgumentException(ONLY_UDP_TRANSMISSIONS);\n\t\tsuper.sendIPDataAsync(ipAddress, des... | {
"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_324 | {
"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.TX_I... | {
"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[12];\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": "OPTIONS_CLOSE_SOCKET = 2",
"modifier": "public static final",
"original_string": "public static final int OPTIONS_CLOSE_SOCKET = 2;",
"type": "int",
"var_name": "OPTIONS_CLOSE_SOCKET"
},
{
"declarator": "OPTIONS_LEAVE_SOCKET_OPEN = 0",
... | {
"body": "public static TXIPv4Packet 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_148 | {
"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 AT Command Response packet.\")));\n\t\t\n\t\t// Call the metho... | {
"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_518 | {
"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 void testToString() {\n\t\t// Setup the resources for the test.\n\t\tint baudrate = 9600;\n\t\tint dataBits = 8;\n\t\tint stopBits = 1;\n\t\tint parity = 0;\n\t\tint flowControl = 0;\n\t\t\n\t\tSerialPortParameters parameters = new SerialPortParameters(baudrate, dataBits, stopBits, parity, ... | {
"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 String toString() {\n\t\treturn \"Baud Rate: \"+ baudrate + \", Data Bits: \" + dataBits \n\t\t\t\t+ \", Stop Bits: \" + stopBits + \", Parity: \" + parity \n\t\t\t\t+ \", Flow Control: \" + flowControl;\n\t}",
"class_method_signature": "SerialPortParameters.toString()",
"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_580 | {
"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=IllegalArgumentException.class)\n\tpublic void testStartListeningInvalidPortNegative() throws TimeoutException, XBeeException {\n\t\tipv6Device.startListening(-10);\n\t}",
"class_method_signature": "IPv6DeviceTest.testStartListeningInvalidPortNegative()",
"constructor": false,
"full_si... | {
"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_353 | {
"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 testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tTXSMSPacket packet = new TXSMSPacket(frameID, phoneNumber, data);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Packet should not be broadcast\", packet.isBroadcast(), is(equalTo(f... | {
"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 boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "TXSMSPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroadcast",
"invocations": [],
"modifiers": "@Override public",
"para... | {
"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_703 | {
"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 testByteArrayToShortEmptyArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[0];\n\t\tshort expectedResult = 0;\n\t\t\n\t\t// Call the method under test.\n\t\tshort result = ByteUtils.byteArrayToShort(byteArray);\n\t\t\n\t\t// Verify the result.\n... | {
"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 short byteArrayToShort(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 < 2) {\n\t\t\tvalues = new byte[... | {
"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_216 | {
"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 testGetAPIPacketParametersReceivedDataNotNull() {\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\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetPar... | {
"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_646 | {
"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 testSetDNSAddress() throws Exception {\n\t\t// Do nothing when trying to set the NS parameter.\n\t\tMockito.doNothing().when(wifiDevice).setParameter(Mockito.eq(PARAMETER_NS), Mockito.any(byte[].class));\n\n\t\t// Set the DNS address.\n\t\twifiDevice.setDNSAddress((Inet4Address) Inet4A... | {
"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_168 | {
"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 testIsBroadcastWithNonBroadcastOption() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] receivedData = new byte[]{(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF};\n\t\tIPv6IODataSampleRxIndicator packet = new I... | {
"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 boolean isBroadcast() {\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPv6IODataSampleRxIndicator.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "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_492 | {
"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 testParsePacketStringAPIEscapedInvalidChecksum() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E000F1701007D33A20040AD142EFFFE024E4961\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(e... | {
"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_538 | {
"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 testWriteDataCompleteNullData() 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\tint offset = 0;\n\t\tint length = 0;\n\t\t\n\t\texception.expec... | {
"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_9 | {
"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 testAssociationIndicationStatus() throws Exception {\n\t\t// Return a valid response when requesting the AI parameter value.\n\t\tMockito.doReturn(RESPONSE_AI).when(cellularDevice).getParameter(PARAMETER_AI);\n\t\t\n\t\tassertEquals(validCellularAIStatus, cellularDevice.getCellularAsso... | {
"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": "public CellularAssociationIndicationStatus getCellularAssociationIndicationStatus() throws TimeoutException, \n\t\t\tXBeeException {\n\t\tbyte[] associationIndicationValue = getParameter(\"AI\");\n\t\treturn CellularAssociationIndicationStatus.get(ByteUtils.byteArrayToInt(associationIndicationValue));\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_187 | {
"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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tString cmd = \"A\"; // Invalid AT command.\n\t\t\n\t\tbyte[] payload = new byte[19 + cmd.getBytes().length];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem... | {
"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_754 | {
"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 testIntegerToHexString() {\n\t\t// Setup the resources for the test.\n\t\tint v = 0x12345678;\n\t\tString expectedResult = \"12345678\";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = HexUtils.integerToHexString(v, 4);\n\t\t\n\t\t// Verify the result.\n\t\tassertT... | {
"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 integerToHexString(int value, int minBytes) {\n\t\tif (minBytes <= 0)\n\t\t\tthrow new IllegalArgumentException(\"Minimum number of bytes must be greater than 0.\");\n\t\t\n\t\tString f = String.format(\"%%0%dX\", minBytes*2);\n\t\treturn String.format(f, value);\n\t}",
"class_method... | {
"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_304 | {
"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 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 Device Response packet.\")));\n\n\t\t// Call the method under... | {
"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_611 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java",
"identifier": "XBeeExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testCreateXBeeExceptionCause() {\n\t\t// Setup the resources for the test.\n\t\tThrowable cause = new Exception();\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'... | {
"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_241 | {
"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 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(\"CoAP Rx Response packet payload cannot be null.\")));\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_484 | {
"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 testParsePacketEmptyString() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Packet length should be greater than 0.\")));\n\t\t\n\t\t// Call the method unde... | {
"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_191 | {
"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 testGetAPIPacketParametersATCommandValueByteArray() {\n\t\t// Setup the resources for the test.\n\t\tString command = \"NI\";\n\t\tbyte[] commandValue = new byte[]{0x6D, 0x79};\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frameID, ipv6addr... | {
"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_312 | {
"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(\"Generic packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method under test... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 1",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 1;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "rfData",
"modifier": ... | {
"body": "public static GenericXBeePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Generic packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(\"Incomplete G... | {
"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_742 | {
"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 testByteArrayToHexStringNullByteArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] array = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Value to convert cannot be null.\")));\n\t\t\n\t\t// Call the method under te... | {
"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 byteArrayToHexString(byte[] value) {\n\t\tif (value == null )\n\t\t\tthrow new NullPointerException(\"Value to convert cannot be null.\");\n\t\t\n\t\tfinal StringBuilder hex = new StringBuilder(2 * value.length );\n\t\tfor (final byte b : value) {\n\t\t\thex.append(HEXES.charAt((b & 0x... | {
"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_48 | {
"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 IO Data Sample RX Indicator packet.\")));\n\t\t\n\t\t// Call t... | {
"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_257 | {
"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 testGetDataValidData() {\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\t// Call the method under test.\n\t\tbyte[] result = pa... | {
"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 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": "CoAPRxResponsePacket.getData()",
"constructor": false,
"full_signature": "public byte[] getData()",
"identifier": "getData",
"invocations": [
"c... | {
"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_607 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java",
"identifier": "TransmitExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetMessageOnlyTransmitStatusNullAndMessage() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = null;\n\t\tString message = \"This is the message\";\n\t\tTransmitException e = new TransmitException(message, transmitStatus);\n\t\t\n\t\t// Call... | {
"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_129 | {
"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 = 0x10;\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tATCommandStatus status = ATCommandStat... | {
"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 boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "RemoteATCommandResponsePacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroadcast",
"invocations": [],
"modifiers": "@Overrid... | {
"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_579 | {
"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=IllegalArgumentException.class)\n\tpublic void testStartListeningInvalidPortBig() throws TimeoutException, XBeeException {\n\t\tipv6Device.startListening(100000);\n\t}",
"class_method_signature": "IPv6DeviceTest.testStartListeningInvalidPortBig()",
"constructor": false,
"full_signature... | {
"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_596 | {
"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 testNotSupportedOperationReadDataFromTimeout() 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... | {
"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_715 | {
"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 testIsBitEnabledPositionGreaterThanValid() {\n\t\t// Setup the resources for the test.\n\t\tint n = 0xFFFF;\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Bit position must be between 0 and 31.\")));\n\t\t\n\t\t// Call the m... | {
"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_345 | {
"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 testGetDataNullData() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\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 t... | {
"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_650 | {
"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 testThreadAssociationIndicationStatus() throws Exception {\n\t\t// Return a valid response when requesting the AI parameter value.\n\t\tMockito.doReturn(RESPONSE_AI).when(threadDevice).getParameter(PARAMETER_AI);\n\t\t\n\t\tassertEquals(validThreadAIStatus, threadDevice.getThreadAssoci... | {
"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": "public ThreadAssociationIndicationStatus getThreadAssociationIndicationStatus() throws TimeoutException, \n\t\t\tXBeeException {\n\t\tbyte[] associationIndicationValue = getParameter(\"AI\");\n\t\treturn ThreadAssociationIndicationStatus.get(ByteUtils.byteArrayToInt(associationIndicationValue));\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_200 | {
"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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tString cmd = \"A\"; // Invalid AT command.\n\t\t\n\t\tbyte[] payload = new byte[19 + cmd.getBytes().length];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem... | {
"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 IPv6RemoteATCommandRequestPacket 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 destination address) + 1 (transmit options byte) + 2 (AT command)\n\t\tif (payload.length < M... | {
"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_447 | {
"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 testIsBroadcastWithNonBroadcastOption() {\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 = 0x20;\n\t\tbyte[] receivedData = new byte[]{(byte)0xFF, (byte)0xFF, (byte)0x... | {
"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": "RX64IOPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadca... | {
"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_152 | {
"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 testGetAPIDataATCommandParameterNotNullWitUnknownStatus() {\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\tbyte[] parameter... | {
"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_502 | {
"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 testParsePacketOnlyTwoByte() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = {0x7E, (byte)0xFF};\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equalTo(\"Error parsing packet: Incomplete packe... | {
"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_781 | {
"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 testEqualsIsTransitive() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress addr1 = new XBee16BitAddress(\"0x1234\");\n\t\tXBee16BitAddress addr2 = new XBee16BitAddress(\"0x1234\");\n\t\tXBee16BitAddress addr3 = new XBee16BitAddress(\"0x1234\");\n\t\t\n\t\t// Call ... | {
"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 boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBee16BitAddress))\n\t\t\treturn false;\n\t\tXBee16BitAddress addr = (XBee16BitAddress)obj;\n\t\treturn Arrays.equals(addr.getValue(), getValue());\n\t}",
"class_method_signature": "XBee16BitAddress.equals(Object obj)",
"constru... | {
"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_64 | {
"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 testGetAPIPacketParametersRFDataNull() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint sourceEndpoint = 0xA0;\n\t\tint destEn... | {
"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 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_294 | {
"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 testGetAPIPacketParametersTargetNull() {\n\t\t// Set up the resources for the test.\n\t\ttarget = null;\n\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = 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": "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_410 | {
"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\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"A1B2\");\n\t\tint rssi = 40;\n\t\tint options = 0x01;\n\t\tbyte[] data = new byte[]{(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xF... | {
"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 static RX16IOPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX16 Address IO packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 2 (16-bit address) + 1 (RSSI) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)... | {
"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_806 | {
"fields": [
{
"declarator": "SSID = \"My Access Point\"",
"modifier": "private static final",
"original_string": "private static final String SSID = \"My Access Point\";",
"type": "String",
"var_name": "SSID"
},
{
"declarator": "ENCRYPTION_TYPE = WiFiEncryptionType.WE... | {
"body": "@Test(expected=IllegalArgumentException.class)\n\tpublic void testSetSignalQualityBIG() {\n\t\tAccessPoint accessPoint = new AccessPoint(SSID, ENCRYPTION_TYPE);\n\t\t\n\t\taccessPoint.setSignalQuality(150);\n\t}",
"class_method_signature": "AccessPointTest.testSetSignalQualityBIG()",
"constructor": fal... | {
"fields": [
{
"declarator": "ERROR_CHANNEL = \"Channel cannot be negative.\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_CHANNEL = \"Channel cannot be negative.\";",
"type": "String",
"var_name": "ERROR_CHANNEL"
},
{
"de... | {
"body": "public void setSignalQuality(int signalQuality) {\n\t\tif (signalQuality < 0 || signalQuality > 100)\n\t\t\tthrow new IllegalArgumentException(ERROR_SIGNAL_QUALITY);\n\t\t\n\t\tthis.signalQuality = signalQuality;\n\t}",
"class_method_signature": "AccessPoint.setSignalQuality(int signalQuality)",
"const... | {
"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_555 | {
"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 testReadDataCompleteEmptyData() 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[0];\n\t\tint offset = 0;\n\t\tint length = data.length;\n\t\t\n\t... | {
"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_105 | {
"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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 0x8A; /* bit 1 */\n\t\tbyte[] receivedData... | {
"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 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": "ReceivePacket.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_33 | {
"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(\"Modem Status packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method under... | {
"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": "modemStatusEvent",
"m... | {
"body": "public static ModemStatusPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Modem Status packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (Modem status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgument... | {
"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_386 | {
"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 testIsBroadcastFalse() {\n\t\t// Set up the resources for the test.\n\t\tRemoteATCommandWifiPacket packet = new RemoteATCommandWifiPacket(frameID, destAddress, transmitOptions, command, parameter);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Pack... | {
"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 boolean isBroadcast() {\n\t\treturn destAddress.getHostAddress().equals(IPDevice.BROADCAST_IP);\n\t}",
"class_method_signature": "RemoteATCommandWifiPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroadcas... | {
"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_369 | {
"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.IO_D... | {
"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 IO Data Sample Rx Indicator (Wi-Fi) packet.\")));\n\n\t\t// C... | {
"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 = \"IO... | {
"body": "public static IODataSampleRxIndicatorWifiPacket 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_693 | {
"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 testByteArrayToLong8Bytes() {\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};\n\t\tlong expectedResult = 0x1234859623475620L;\n\t\t\n\t\t// Call the method under test.\n\t\tlong result = Byt... | {
"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_739 | {
"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 testSwapByteArrayNullByteArray() {\n\t\t// Setup the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Source cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tByteUtils.swapByteArray(null);\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_406 | {
"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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 75;\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tRX64P... | {
"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": "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": "RX64Packet.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_113 | {
"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 testGetAPIPacketParametersATCommandParameterByteArrayNonStringCmd() {\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\"... | {
"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_543 | {
"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 testWriteDataCompleteEmptyData() 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[0];\n\t\tint offset = 0;\n\t\tint length = data.length;\n\t\t\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 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_810 | {
"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 void testCreateWithIncompleteByteArray() {\n\t\t// Test with an incomplete byte array.\n\t\tXBeeIMEIAddress imei = null;\n\t\ttry {\n\t\t\timei = new XBeeIMEIAddress(INCOMPLETE_BYTE_ARRAY);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"This exception should have not been thrown.\");\n\t\t}\n\t... | {
"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": "public String getValue() {\n\t\treturn HexUtils.byteArrayToHexString(address).substring(1);\n\t}",
"class_method_signature": "XBeeIMEIAddress.getValue()",
"constructor": false,
"full_signature": "public String getValue()",
"identifier": "getValue",
"invocations": [
"substring",
"byteArray... | {
"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_390 | {
"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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[12];\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\tSystem.... | {
"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_25 | {
"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\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint broadcastRa... | {
"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 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_685 | {
"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 testReadStringEmptyInputStream() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] contents = new byte[0];\n\t\tByteArrayInputStream in = new ByteArrayInputStream(contents);\n\t\t\n\t\t// Call the method under test.\n\t\tString result = ByteUtils.readString(in);\n\t\t\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 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_451 | {
"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 testGetRFDataInvalidData() {\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 = 0x84; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tRX6... | {
"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": "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": "RX64IOPacket.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_514 | {
"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 testEqualsIsReflexive() {\n\t\t// Setup the resources for the test.\n\t\tSerialPortParameters parameters = new SerialPortParameters(9600, 8, 1, 0, 0);\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual = parameters.equals(parameters);\n\t\t\n\t\t// Verify the result.... | {
"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_144 | {
"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 = 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_72 | {
"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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.AT_COMMAND_QUEUE.getValue();\n\t\t//int frameID = 0xE7;\n\t\tbyte[] atCommand = \"NI\".getBytes();\n\t\t\n\t\tbyte[] payload = new byte[1 + atCommand.length];\... | {
"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_797 | {
"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 testEqualsWithNull() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress addr = new XBee64BitAddress(\"0x0013A20040123456\");\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual = addr.equals(null);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"64-b... | {
"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 boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBee64BitAddress))\n\t\t\treturn false;\n\t\tXBee64BitAddress addr = (XBee64BitAddress)obj;\n\t\treturn Arrays.equals(addr.getValue(), getValue());\n\t}",
"class_method_signature": "XBee64BitAddress.equals(Object obj)",
"constru... | {
"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_328 | {
"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.TX_I... | {
"body": "@Test\n\tpublic final void testSetSourcePortNegative() {\n\t\t// Set up the resources for the test.\n\t\tTXIPv4Packet packet = new TXIPv4Packet(frameID, destAddress, destPort, sourcePort, protocol, transmitOptions, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage... | {
"fields": [
{
"declarator": "OPTIONS_CLOSE_SOCKET = 2",
"modifier": "public static final",
"original_string": "public static final int OPTIONS_CLOSE_SOCKET = 2;",
"type": "int",
"var_name": "OPTIONS_CLOSE_SOCKET"
},
{
"declarator": "OPTIONS_LEAVE_SOCKET_OPEN = 0",
... | {
"body": "public void setSourcePort(int sourcePort) {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.sourcePort = sourcePort;\n\t}",
"class_method_signature": "TXIPv4Packet.setSourcePort(int sourcePort)",
"constructor": false,
"full_sig... | {
"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_778 | {
"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 testEqualsWithDifferentXBeePacket() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress addr1 = new XBee16BitAddress(\"0x1234\");\n\t\tXBee16BitAddress addr2 = new XBee16BitAddress(\"0x5678\");\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual1 = addr1... | {
"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 boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBee16BitAddress))\n\t\t\treturn false;\n\t\tXBee16BitAddress addr = (XBee16BitAddress)obj;\n\t\treturn Arrays.equals(addr.getValue(), getValue());\n\t}",
"class_method_signature": "XBee16BitAddress.equals(Object obj)",
"constru... | {
"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_282 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[5 + path.length() + contentType.length() + data.length];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)path.length();\n\t\tSystem.arraycopy(path.g... | {
"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_73 | {
"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\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\t\n\t\tbyte[] payload = new byte[1 + atCommand.length + data.l... | {
"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_796 | {
"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 testIPv6AddressesMatch() 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(mockedRxIPv6Packet);\n\t\t\n\t\t// Create an XBeePacketsQueue.\n\t\tXBeePacketsQueue xbeePacketsQueue = PowerMo... | {
"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 ipv6AddressesMatch(XBeePacket xbeePacket, Inet6Address ipv6Address) {\n\t\tif (xbeePacket == null || ipv6Address == null \n\t\t\t\t|| !(xbeePacket instanceof XBeeAPIPacket))\n\t\t\treturn false;\n\t\tAPIFrameType packetType = ((XBeeAPIPacket)xbeePacket).getFrameType();\n\t\tswitch (packetTy... | {
"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_329 | {
"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.TX_I... | {
"body": "@Test\n\tpublic final void testSetSourcePortBigger() {\n\t\t// Set up the resources for the test.\n\t\tTXIPv4Packet packet = new TXIPv4Packet(frameID, destAddress, destPort, sourcePort, protocol, transmitOptions, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(i... | {
"fields": [
{
"declarator": "OPTIONS_CLOSE_SOCKET = 2",
"modifier": "public static final",
"original_string": "public static final int OPTIONS_CLOSE_SOCKET = 2;",
"type": "int",
"var_name": "OPTIONS_CLOSE_SOCKET"
},
{
"declarator": "OPTIONS_LEAVE_SOCKET_OPEN = 0",
... | {
"body": "public void setSourcePort(int sourcePort) {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.sourcePort = sourcePort;\n\t}",
"class_method_signature": "TXIPv4Packet.setSourcePort(int sourcePort)",
"constructor": false,
"full_sig... | {
"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_779 | {
"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 testEqualsIsSymetric() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress addr1 = new XBee16BitAddress(\"0x1234\");\n\t\tXBee16BitAddress addr2 = new XBee16BitAddress(\"0x1234\");\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual1 = addr1.equals(addr2... | {
"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 boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBee16BitAddress))\n\t\t\treturn false;\n\t\tXBee16BitAddress addr = (XBee16BitAddress)obj;\n\t\treturn Arrays.equals(addr.getValue(), getValue());\n\t}",
"class_method_signature": "XBee16BitAddress.equals(Object obj)",
"constru... | {
"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_283 | {
"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 testGetAPIPacketParametersPathNull() {\n\t\t// Set up the resources for the test.\n\t\tpath = null;\n\n\t\tSendDataRequestPacket packet = new SendDataRequestPacket(frameID, path, contentType, options, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String>... | {
"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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tif (path != null) {\n\t\t\tparameters.put(\"Path length\", HexUtils.prettyHexString(HexUtils.integerToHexString(path.length(), 1)) + \" (\" ... | {
"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_450 | {
"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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 75;\n\t\tint options = 0x84; /* bit 2 */\n\t\tbyte[] receivedData = null;\n\t\tRX64IOPacket packet = new RX64IOPack... | {
"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": "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": "RX64IOPacket.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_515 | {
"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 testEqualsIsTransitive() {\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_145 | {
"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 testGetRFDataInvalidData() {\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\ti... | {
"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_391 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[13];\n\t\tpayload[0] = (byte)frameID;\n\t\tSystem.arraycopy(new byte[]{0x00, 0x00, 0x00, 0x00}, 0, payload, 1, 4);\n\t\tSystem.arraycopy(sourceAddress.getAddr... | {
"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_24 | {
"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\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint broadcast... | {
"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 static TransmitPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Transmit 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 (broadcast radious) + 1 (options)\n\t\tif (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_684 | {
"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 testReadStringNullInputStream() {\n\t\t// Setup the resources for the test.\n\t\tByteArrayInputStream in = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Input stream cannot be null.\")));\n\t\t\n\t\t// Call the method under tes... | {
"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_407 | {
"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(\"RX16 Address IO packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method un... | {
"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 static RX16IOPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX16 Address IO packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 2 (16-bit address) + 1 (RSSI) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)... | {
"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_112 | {
"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\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint ... | {
"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_542 | {
"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 testWriteDataCompleteOffsetPlusLengthThanDataSize() 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 ... | {
"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_811 | {
"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 void testCreateWithIncompleteString() {\n\t\t// Test with an incomplete string.\n\t\tXBeeIMEIAddress imei = null;\n\t\ttry {\n\t\t\timei = new XBeeIMEIAddress(INCOMPLETE_STRING);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"This exception should have not been thrown.\");\n\t\t}\n\t\t\n\t\tass... | {
"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": "public String getValue() {\n\t\treturn HexUtils.byteArrayToHexString(address).substring(1);\n\t}",
"class_method_signature": "XBeeIMEIAddress.getValue()",
"constructor": false,
"full_signature": "public String getValue()",
"identifier": "getValue",
"invocations": [
"substring",
"byteArray... | {
"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_32 | {
"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\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint broadcastRadious = 0;\n\t\tint ... | {
"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_387 | {
"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 testIsBroadcastTrue() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tdestAddress = (Inet4Address) Inet4Address.getByName(IPDevice.BROADCAST_IP);\n\n\t\tRemoteATCommandWifiPacket packet = new RemoteATCommandWifiPacket(frameID, destAddress, transmitOptions, comm... | {
"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 boolean isBroadcast() {\n\t\treturn destAddress.getHostAddress().equals(IPDevice.BROADCAST_IP);\n\t}",
"class_method_signature": "RemoteATCommandWifiPacket.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast()",
"identifier": "isBroadcas... | {
"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_368 | {
"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.IO_D... | {
"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(\"IO Data Sample Rx Indicator (Wi-Fi) packet payload cannot be null.\")));\n\n\t\t// C... | {
"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 = \"IO... | {
"body": "public static IODataSampleRxIndicatorWifiPacket 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_692 | {
"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 testByteArrayToLongLessThan8Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12, 0x34, (byte)0x85, (byte)0x96, 0x23, 0x47};\n\t\tlong expectedResult = 0x123485962347L;\n\t\t\n\t\t// Call the method under test.\n\t\tlong result = ByteUtils.b... | {
"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_738 | {
"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 testNewByteArrayFinalSizeGreaterThanOriginal() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] original = new byte[]{'1', '2', '3', '4'};\n\t\tbyte[] expectedResult = new byte[]{'0', '0', '1', '2', '3', '4'};\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ... | {
"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[] newByteArray(byte[] data, int finalSize) {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Data cannot be null.\");\n\t\tif (finalSize < 0)\n\t\t\tthrow new IllegalArgumentException(\"Final size must be equal or greater than 0.\");\n\t\t\n\t\tif (finalSize == 0)\n\t\t\tr... | {
"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.