id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
21871478_272 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_RESPONSE_STATUS.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE_STATUS.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "fr... | {
"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(\"Device Response Status packet payload cannot be null.\")));\n\n\t\t// Call the metho... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "public static DeviceResponseStatusPacket 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)... | {
"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_788 | {
"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 testGetFirstExplicitDataPacket() {\n\t\t// Create an XBeePacketsQueue of 5 slots.\n\t\tXBeePacketsQueue xbeePacketsQueue = new XBeePacketsQueue(5);\n\t\t\n\t\t// Add 2 dummy packets.\n\t\tfor (int i = 0; i < 2; i ++)\n\t\t\txbeePacketsQueue.addPacket(Mockito.mock(XBeePacket.class));\n\... | {
"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": "public XBeePacket getFirstExplicitDataPacket(int timeout) {\n\t\tif (timeout > 0) {\n\t\t\tXBeePacket xbeePacket = getFirstExplicitDataPacket(0);\n\t\t\t// Wait for a timeout or until an explicit data XBee packet is read.\n\t\t\tLong deadLine = System.currentTimeMillis() + timeout;\n\t\t\twhile (xbeePacket... | {
"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_622 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/ATCommandExceptionTest.java",
"identifier": "ATCommandExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetCommandStatusMessage() {\n\t\t// Setup the resources for the test.\n\t\tATCommandStatus atCommandStatus = ATCommandStatus.INVALID_PARAMETER;\n\t\tATCommandException e = new ATCommandException(atCommandStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tString result = ... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAULT_MESSAGE = \"There was a problem s... | {
"body": "public String getCommandStatusMessage() {\n\t\tif (atCommandStatus != null)\n\t\t\treturn atCommandStatus.getDescription();\n\t\treturn null;\n\t}",
"class_method_signature": "ATCommandException.getCommandStatusMessage()",
"constructor": false,
"full_signature": "public String getCommandStatusMessage... | {
"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_730 | {
"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 testReadUntilCRNoCR() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] contents = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x06, 0x07, 0x08};\n\t\tByteArrayInputStream in = new ByteArrayInputStream(contents);\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] resu... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static byte[] readUntilCR(ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\t\n\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\t\tbyte readByte;\n\t\twhile (((readByte = (byte)inputSt... | {
"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_360 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] phoneNumber = Arrays.copyOf(this.phoneNumber.getBytes(), 20);\n\n\t\tbyte[] payload = new byte[20 + data.length()];\n\t\tSystem.arraycopy(phoneNumber, 0, payload, 0, phoneNumbe... | {
"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 static RXSMSPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTyp... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_675 | {
"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 testNotSupportedOperationSendBroadcastData() 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 s... | {
"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 sendBroadcastData(byte[] data) throws TimeoutException,\n\t\t\tXBeeException {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPDevice.sendBroadcastData(byte[] data)",
"constructor": fals... | {
"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_225 | {
"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(\"RX IPv6 packet payload cannot be null.\")));\n\n\t\t// Call the method under test th... | {
"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 static RXIPv6Packet 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_419 | {
"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\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x84; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61, (byte)0x98, 0x11, 0x32}... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress16",
"mo... | {
"body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}",
"class_method_signature": "RX16IOPacket.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_376 | {
"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 testSetRSSINegative() {\n\t\t// Set up the resources for the test.\n\t\tIODataSampleRxIndicatorWifiPacket packet = new IODataSampleRxIndicatorWifiPacket(sourceAddress, rssi, receiveOptions, data);\n\n\t\trssi = -1;\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texc... | {
"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 void setRSSI(int rssi) {\n\t\tif (rssi < 0 || rssi > 255)\n\t\t\tthrow new IllegalArgumentException(ERROR_RSSI_ILLEGAL);\n\n\t\tthis.rssi = rssi;\n\t}",
"class_method_signature": "IODataSampleRxIndicatorWifiPacket.setRSSI(int rssi)",
"constructor": false,
"full_signature": "public void setRSSI... | {
"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_726 | {
"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 testReadBooleanFromByteTrue() {\n\t\t// Setup the resources for the test.\n\t\tbyte n = (byte)0x08;\n\t\tboolean expectedResult = true;\n\t\t\n\t\t// Call the method under test.\n\t\tboolean result = ByteUtils.readBooleanFromByte(n, 3);\n\t\t\n\t\t// Verify the result.\n\t\tasser... | {
"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 readBooleanFromByte(byte containerByte, int bitOffset) {\n\t\tif (bitOffset < 0 || bitOffset > 31)\n\t\t\tthrow new IllegalArgumentException(\"Bit offset must be between 0 and 7.\");\n\t\t\n\t\treturn isBitEnabled(containerByte, bitOffset);\n\t}",
"class_method_signature": "ByteUtil... | {
"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_233 | {
"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 testSetDestAddressNull() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv6Packet packet = new RXIPv6Packet(destAddress, sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Dest... | {
"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 setDestAddress(Inet6Address destAddress) {\n\t\tif (destAddress == null)\n\t\t\tthrow new NullPointerException(ERROR_DEST_ADDR_NULL);\n\n\t\tthis.destAddress = destAddress;\n\t}",
"class_method_signature": "RXIPv6Packet.setDestAddress(Inet6Address destAddress)",
"constructor": false,
"ful... | {
"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_663 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@Test(expected=TimeoutException.class)\n\tpublic void testStoptListeningTimeout() throws TimeoutException, XBeeException {\n\t\t// Throw an timeout exception when setting any parameter.\n\t\tMockito.doThrow(new TimeoutException()).when(ipDevice).setParameter(Mockito.anyString(), Mockito.any(byte[].class));... | {
"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": "public void stopListening() throws TimeoutException, XBeeException {\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)0));\n\t\tsourcePort = 0;\n\t}",
"class_method_signature": "IPDevice.stopListening()",
"constructor": false,
"full_signature": "public void stopListening()",
"identifier"... | {
"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_399 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 40;\n\t\tint options = 0x01;\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\t\n\... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "public static RX64Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX64 packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (64-bit address) + 1 (signal strength) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\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_819 | {
"fields": [
{
"declarator": "INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}",
"modifier": "private final static",
"original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};",
... | {
"body": "@Test\n\tpublic final void testHashCodeIsConsistent() {\n\t\t// Setup the resources for the test.\n\t\tXBeeIMEIAddress imei = new XBeeIMEIAddress(\"1234\");\n\t\t\n\t\tint initialHashCode = imei.hashCode();\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Consistent hashcode test fails\", imei.hashCode()... | {
"fields": [
{
"declarator": "ERROR_IMEI_NULL = \"IMEI address cannot be null.\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_IMEI_NULL = \"IMEI address cannot be null.\";",
"type": "String",
"var_name": "ERROR_IMEI_NULL"
},
{
... | {
"body": "@Override\n\tpublic int hashCode() {\n\t\tint hash = HASH_SEED;\n\t\tfor (byte b:getValue().getBytes())\n\t\t\thash = hash * (hash + b);\n\t\treturn hash;\n\t}",
"class_method_signature": "XBeeIMEIAddress.hashCode()",
"constructor": false,
"full_signature": "@Override public int hashCode()",
"ident... | {
"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_94 | {
"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 testGetParameter() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tString parameterToSet = \"newNIValue\";\n\t\tATCommandPacket packet = new ATCommandPacket(frameID, command, parameterToSet);\n\t\t\n\t\t// Call the method un... | {
"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 byte[] getParameter() {\n\t\treturn parameter;\n\t}",
"class_method_signature": "ATCommandPacket.getParameter()",
"constructor": false,
"full_signature": "public byte[] getParameter()",
"identifier": "getParameter",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"retur... | {
"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_771 | {
"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 testSendIPData() throws Exception {\n\t\t// Do nothing when the sendIPData of IPDevice is called.\n\t\tMockito.doNothing().when((IPDevice)lpWanDevice).sendIPData(Mockito.any(Inet4Address.class), \n\t\t\t\tMockito.anyInt(), Mockito.any(IPProtocol.class), Mockito.any(byte[].class));\n\t\... | {
"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 sendIPData(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.sendIPData(ipAddress, destPort, pro... | {
"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_321 | {
"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 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 TX IPv4 packet.\")));\n\n\t\t// Call the method under test th... | {
"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_634 | {
"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 testGetIPAddressingMode() throws Exception {\n\t\t// Return a valid response when requesting the MA parameter value.\n\t\tMockito.doReturn(RESPONSE_MA).when(wifiDevice).getParameter(PARAMETER_MA);\n\n\t\tassertEquals(IPAddressingMode.STATIC, wifiDevice.getIPAddressingMode());\n\t}",
... | {
"fields": [
{
"declarator": "DEFAULT_ACCESS_POINT_TIMETOUT = 15000",
"modifier": "private final static",
"original_string": "private final static int DEFAULT_ACCESS_POINT_TIMETOUT = 15000;",
"type": "int",
"var_name": "DEFAULT_ACCESS_POINT_TIMETOUT"
},
{
"declarator":... | {
"body": "public IPAddressingMode getIPAddressingMode() throws TimeoutException, XBeeException {\n\t\treturn IPAddressingMode.get(ByteUtils.byteArrayToInt(getParameter(\"MA\")));\n\t}",
"class_method_signature": "WiFiDevice.getIPAddressingMode()",
"constructor": false,
"full_signature": "public IPAddressingMod... | {
"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_264 | {
"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 testSetErrorNull() {\n\t\t// Set up the resources for the test.\n\t\tFrameErrorPacket packet = new FrameErrorPacket(error);\n\n\t\terror = null;\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Frame error cannot be null.\")));\n\n\t\... | {
"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 void setError(FrameError error) {\n\t\tif (error == null)\n\t\t\tthrow new NullPointerException(ERROR_STATUS_NULL);\n\n\t\tthis.error = error;\n\t}",
"class_method_signature": "FrameErrorPacket.setError(FrameError error)",
"constructor": false,
"full_signature": "public void setError(FrameErro... | {
"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_458 | {
"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 testGetAPIPacketParameters() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.SUCCESS;\n\t\tTXStatusPacket packet = new TXStatusPacket(frameID, transmitStatus);\n\t\t\n\t\tString expectedTransmitStatu... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "transmitStatus",
"mod... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Status\", \n\t\t\t\tHexUtils.prettyHexString(HexUtils.integerToHexString(transmitStatus.getId(), 1)) \n\t\t\t\t+ \" (\" + t... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_585 | {
"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=InterfaceNotOpenException.class)\n\tpublic void testStopListeningConnectionClosed() throws TimeoutException, XBeeException {\n\t\t// Throw an Interface not open exception when setting any parameter.\n\t\tMockito.doThrow(new InterfaceNotOpenException()).when(ipv6Device).setParameter(Mockito.a... | {
"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 stopListening() throws TimeoutException, XBeeException {\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)0));\n\t\tsourcePort = 0;\n\t}",
"class_method_signature": "IPv6Device.stopListening()",
"constructor": false,
"full_signature": "public void stopListening()",
"identifie... | {
"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_213 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[22 + data.length];\n\t\tpayload[0] = (byte)frameID;\n\t\tSystem.arraycopy(destAddress.getAddress(), 0, payload, 1, destAddress.getAddress().length);\n\t\tpay... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 24",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 24;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"TX... | {
"body": "public static TXIPv6Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTy... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_643 | {
"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 testGetGatewayIPAddressIllegalIP() throws XBeeException {\n\t\t// Return an illegal IP address when getting the GW parameter.\n\t\tMockito.doReturn(new byte[]{0x00}).when(wifiDevice).getParameter(PARAMETER_GW);\n\n\t\t// Get the gateway IP address of the device.\n\t\ttry {\n\t\t\twifiD... | {
"fields": [
{
"declarator": "DEFAULT_ACCESS_POINT_TIMETOUT = 15000",
"modifier": "private final static",
"original_string": "private final static int DEFAULT_ACCESS_POINT_TIMETOUT = 15000;",
"type": "int",
"var_name": "DEFAULT_ACCESS_POINT_TIMETOUT"
},
{
"declarator":... | {
"body": "public Inet4Address getGatewayIPAddress() throws TimeoutException, XBeeException {\n\t\ttry {\n\t\t\treturn (Inet4Address) Inet4Address.getByAddress(getParameter(\"GW\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\tthrow new XBeeException(e);\n\t\t}\n\t}",
"class_method_signature": "WiFiDevice.getGat... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_356 | {
"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 testGetDataValidData() {\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.\n\t\tString result = packet.getData();\n\n\t\t// Verify the result.\n\t\tassertThat(\"Data must be the ... | {
"fields": [
{
"declarator": "PHONE_NUMBER_LENGTH = 20",
"modifier": "static final",
"original_string": "static final int PHONE_NUMBER_LENGTH = 20;",
"type": "int",
"var_name": "PHONE_NUMBER_LENGTH"
},
{
"declarator": "PHONE_NUMBER_PATTERN = \"^\\\\+?\\\\d+$\"",
... | {
"body": "public String getData() {\n\t\treturn data;\n\t}",
"class_method_signature": "TXSMSPacket.getData()",
"constructor": false,
"full_signature": "public String getData()",
"identifier": "getData",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_706 | {
"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 testByteArrayToShortMoreThan2Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12, 0x34, (byte)0x85, (byte)0x96};\n\t\tshort expectedResult = 0x1234;\n\t\t\n\t\t// Call the method under test.\n\t\tshort result = ByteUtils.byteArrayToShort(by... | {
"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_478 | {
"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 testGetPacketLengthEmptyData() {\n\t\t// Setup the resources for the test.\n\t\tTestXBeePacket packet = new TestXBeePacket() {\n\t\t\tpublic byte[] getPacketData() {\n\t\t\t\treturn new byte[0];\n\t\t\t}\n\t\t};\n\t\tint expectedLength = 0;\n\t\t\n\t\t// Call the method under tes... | {
"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 int getPacketLength() {\n\t\tbyte[] packetData = getPacketData();\n\t\tif (packetData == null)\n\t\t\treturn 0;\n\t\treturn packetData.length;\n\t}",
"class_method_signature": "XBeePacket.getPacketLength()",
"constructor": false,
"full_signature": "public int getPacketLength()",
"identifier"... | {
"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_182 | {
"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 testSetMEthodNull() {\n\t\t// Set up the resources for the test.\n\t\tCoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"HTTP Me... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 26",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 26;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public void setMethod(HTTPMethodEnum method) {\n\t\tif (method == null)\n\t\t\tthrow new NullPointerException(ERROR_METHOD_NULL);\n\n\t\tthis.method = method;\n\t}",
"class_method_signature": "CoAPTxRequestPacket.setMethod(HTTPMethodEnum method)",
"constructor": false,
"full_signature": "public void ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_497 | {
"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 testParsePacketNullByteArray() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Packet byte array cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\... | {
"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_614 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java",
"identifier": "XBeeExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testCreateXBeeExceptionMessageNull() {\n\t\t// Setup the resources for the test.\n\t\tString message = null;\n\t\t\n\t\t// Call the method under test.\n\t\tXBeeException e = new XBeeException(message);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Created 'XBeeException' doe... | {
"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_244 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[40 + data.length];\n\t\tpayload[0] = (byte)frameID;\n\t\tSystem.arraycopy(destAddress.getAddress(), 0, payload, 1, destAddress.getAddress().length);\n\t\tSys... | {
"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_751 | {
"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 testContainsLettersFalse() {\n\t\t// Setup the resources for the test.\n\t\tString s = \"013456789\";\n\t\tboolean expectedResult = false;\n\t\t\n\t\t// Call the method under test.\n\t\tboolean result = HexUtils.containsLetters(s);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat... | {
"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 boolean containsLetters(String parameter) {\n\t\tif (parameter == null)\n\t\t\tthrow new NullPointerException(\"Parameter cannot be null.\");\n\t\t\n\t\tbyte[] byteArray = parameter.getBytes();\n\t\tfor (int i = 0; i < byteArray.length; i++){\n\t\t\tif (!((byteArray[i] >= '0') && (byteArray[i... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_301 | {
"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 testGetFlags() {\n\t\t// Set up the resources for the test.\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\t// Verify the result.\n\t\tassertThat(\"Returned flags is not the expected\", packet.getFlags(), is(equalTo(0)));\n\t}",
"class... | {
"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 int getFlags() {\n\t\treturn flags;\n\t}",
"class_method_signature": "DeviceRequestPacket.getFlags()",
"constructor": false,
"full_signature": "public int getFlags()",
"identifier": "getFlags",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "int",
"signatur... | {
"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_194 | {
"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 testGetCommandValueAsString() {\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frameID, ipv6address, command, \n\t\t\t\tstatus, valueStr);\n\t\t\n\t\t// Call the method under test.\n\t\tString commandValue = packet.getCommandValueAsString();... | {
"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 String getCommandValueAsString() {\n\t\tif (commandValue == null)\n\t\t\treturn null;\n\t\treturn new String(commandValue);\n\t}",
"class_method_signature": "IPv6RemoteATCommandResponsePacket.getCommandValueAsString()",
"constructor": false,
"full_signature": "public String getCommandValueAsSt... | {
"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_481 | {
"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 testGetChecksumEmptyData() {\n\t\t// Setup the resources for the test.\n\t\tTestXBeePacket packet = new TestXBeePacket() {\n\t\t\tpublic byte[] getPacketData() {\n\t\t\t\treturn new byte[0];\n\t\t\t}\n\t\t};\n\t\tint expectedChecksum = (byte)0xFF & 0xFF;\n\t\t\n\t\t// Call the me... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "checksum",
"modifier": "private",
"original_string":... | {
"body": "public int getChecksum() {\n\t\tchecksum.reset();\n\t\tbyte[] packetData = getPacketData();\n\t\tif (packetData != null)\n\t\t\tchecksum.add(packetData);\n\t\treturn (byte)checksum.generate() & 0xFF;\n\t}",
"class_method_signature": "XBeePacket.getChecksum()",
"constructor": false,
"full_signature": ... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_252 | {
"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\tCoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data);\n\n\t\texception.expect(IllegalArgumentException.class);... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 41",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Co... | {
"body": "public void 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": "CoAPRxResponsePacket.setSourcePort(int sourcePort)",
"constructor": fal... | {
"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_602 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java",
"identifier": "TransmitExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetTransmitStatusMessage() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.INVALID_ENDPOINT;\n\t\tTransmitException e = new TransmitException(transmitStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tString result ... | {
"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": "public String getTransmitStatusMessage() {\n\t\tif (transmitStatus != null)\n\t\t\treturn transmitStatus.getDescription();\n\t\treturn null;\n\t}",
"class_method_signature": "TransmitException.getTransmitStatusMessage()",
"constructor": false,
"full_signature": "public String getTransmitStatusMessage... | {
"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_317 | {
"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\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};;\n\t\tGenericXBeePacket packet = new GenericXBeePacket(data);\n\t\t\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Packet should not b... | {
"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": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "GenericXBeePacket.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_747 | {
"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 testHexStringToByteArray() {\n\t\t// Setup the resources for the test.\n\t\tString s = \"0102030405\";\n\t\tbyte[] expectedResult = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05};\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = HexUtils.hexStringToByteArray(s);\n\t\t\n\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 byte[] hexStringToByteArray(String value) {\n\t\tif (value == null)\n\t\t\tthrow new NullPointerException(\"Value to convert cannot be null.\");\n\t\t\n\t\tvalue = value.trim();\n\t\tif (value.startsWith(HEX_HEADER))\n\t\t\tvalue = value.substring((HEX_HEADER).length());\n\t\tint len = value.... | {
"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_593 | {
"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 testNotSupportedOperationReadData() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that should thr... | {
"fields": [
{
"declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"",
"modifier": "private static final",
"original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";",
"type": "String",
"var_name": "O... | {
"body": "@Override\n\tpublic XBeeMessage readData() {\n\t\t// Not supported in IPv6 modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPv6Device.readData()",
"constructor": false,
"full_signature": "@Override public XBeeMessage readData()",
"identi... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_439 | {
"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\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tTX16Packet packet = ne... | {
"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": "transmitOptions",
"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": "TX16Packet.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_655 | {
"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\tipDevice.startListening(100000);\n\t}",
"class_method_signature": "IPDeviceTest.testStartListeningInvalidPortBig()",
"constructor": false,
"full_signature": "... | {
"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": "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_205 | {
"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 testGetAPIPacketParametersATCommandParameterByteArrayNonStringCmd() {\n\t\t// Setup the resources for the test.\n\t\tString command = \"DL\";\n\t\tbyte[] parameter = new byte[]{0x6D, 0x79};\n\t\tIPv6RemoteATCommandRequestPacket packet = new IPv6RemoteATCommandRequestPacket(frameI... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 21",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"IP... | {
"body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Destination address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(destAddress.getAddress())) + \n\t\t\t\t\" (\"... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_710 | {
"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 testByteArrayToStringNullArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = null;\n\t\t\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Byte array cannot be null.\")));\n\t\t\n\t\t// Call the method under test.... | {
"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 byteArrayToString(byte[] value) {\n\t\tif (value == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\treturn new String(value);\n\t}",
"class_method_signature": "ByteUtils.byteArrayToString(byte[] value)",
"constructor": false,
"full_signatur... | {
"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_340 | {
"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 testSetDestPortNegative() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv4Packet packet = new RXIPv4Packet(sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Port must be... | {
"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 void setDestPort(int destPort) {\n\t\tif (destPort < 0 || destPort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.destPort = destPort;\n\t}",
"class_method_signature": "RXIPv4Packet.setDestPort(int destPort)",
"constructor": false,
"full_signature": "public... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_157 | {
"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 testGetCommandValueAsString() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tATCommandStatus status = ATCommandStatus.UNKNOWN;\n\t\tString valueToSet = \"newNIValue\";\n\t\tATCommandResponsePacket packet = new ATCommandResp... | {
"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 String getCommandValueAsString() {\n\t\tif (commandValue == null)\n\t\t\treturn null;\n\t\treturn new String(commandValue);\n\t}",
"class_method_signature": "ATCommandResponsePacket.getCommandValueAsString()",
"constructor": false,
"full_signature": "public String getCommandValueAsString()",
... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_507 | {
"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 testEqualsWithNonSerialPortParameters() {\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(new Object());\n\t\t\n\t\t// ... | {
"fields": [
{
"declarator": "HASH_SEED = 23",
"modifier": "private static final",
"original_string": "private static final int HASH_SEED = 23;",
"type": "int",
"var_name": "HASH_SEED"
},
{
"declarator": "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_442 | {
"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.RX_IO_64.getValue();\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 40;\n\t\t\n\t\tbyte[] payload = new byte[... | {
"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 static RX64IOPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX64 Address IO packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (64-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_291 | {
"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 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 Request packet.\")));\n\n\t\t// Call the method under ... | {
"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 static DeviceRequestPacket 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) != API... | {
"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_784 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/models/HardwareVersionTest.java",
"identifier": "HardwareVersionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetHardwareVersionInvalid() {\n\t\t// Try to instantiate a HardwareVersion object with a null description.\n\t\ttry {\n\t\t\tHardwareVersion.get(0, null);\n\t\t} catch(Exception e) {\n\t\t\tassertEquals(NullPointerException.class, e.getClass());\n\t\t}\n\t\t// Try to instantiate a ... | {
"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": "value",
"modifier": "private final",
"original_strin... | {
"body": "public static HardwareVersion get(int value) {\n\t\tHardwareVersionEnum hvEnum = HardwareVersionEnum.get(value);\n\t\tif (hvEnum == null)\n\t\t\treturn new HardwareVersion(value, \"Unknown\");\n\t\treturn new HardwareVersion(hvEnum.getValue(), hvEnum.getDescription());\n\t}",
"class_method_signature": "H... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_61 | {
"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.EXPLICIT_RX_INDICATOR.getValue();\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBe... | {
"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": "public static ExplicitRxIndicatorPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Explicit Rx Indicator packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (64-bit address) + 2 (16-bit address) + 1 (source endpoint) + 1 (destination end... | {
"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_803 | {
"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 testEqualsIsConsistent() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress addr1 = new XBee64BitAddress(\"0x0013A20040123456\");\n\t\tXBee64BitAddress addr2 = new XBee64BitAddress(\"0x0013A20040123456\");\n\t\tXBee64BitAddress addr3 = new XBee64BitAddress(\"0x0013... | {
"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_550 | {
"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 testReadDataCompleteNullData() 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.expect... | {
"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_100 | {
"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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 40;\n\t\tbyte[] receiv... | {
"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": "@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_415 | {
"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 testIsBroadcastWithBroadcastOptionBit1Enabled() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x42; /* bit 1 */\n\t\tbyte[] receivedData = new byte[]{(byte)0xFF, (byte)0xFF, ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 5",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress16",
"mo... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1)\n\t\t\t\t|| ByteUtils.isBitEnabled(getReceiveOptions(), 2);\n\t}",
"class_method_signature": "RX16IOPacket.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_696 | {
"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 testByteArrayToIntNullArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = null;\n\t\t\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Byte array cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\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 int byteArrayToInt(byte[] byteArray) {\n\t\tif (byteArray == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\tif (byteArray.length == 0)\n\t\t\treturn 0;\n\t\t\n\t\tbyte[] values = byteArray;\n\t\tif (byteArray.length < 4) {\n\t\t\tvalues = new byte[4];\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_36 | {
"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 testCreatePacketPayloadInvalidFrameType() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.TRANSMIT_REQUEST.getValue();\n\t\tModemStatusEvent modemStatusEvent = ModemStatusEvent.STATUS_JOINED_NETWORK;\n\t\t\n\t\tbyte[] payload = new byte[2];\n\t\tpayl... | {
"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_229 | {
"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 testCreatePacketPayloadInvalidIP() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[39];\n\t\tpayload[0] = (byte)frameType;\n\t\tSystem.arraycopy(destAddress.getAddress(), 0, payload, 1, destAddress.getAddress().length);\n\t\tSystem.arr... | {
"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 static RXIPv6Packet 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_679 | {
"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 testReadBytesNegativeNumberOfBytes() {\n\t\t// Setup the resources for the test.\n\t\tByteArrayInputStream in = new ByteArrayInputStream(new byte[0]);\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Number of bytes to read mu... | {
"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[] readBytes(int numBytes, ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\tif (numBytes < 0)\n\t\t\tthrow new IllegalArgumentException(\"Number of bytes to read must be equal or greater than 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_383 | {
"fields": [
{
"declarator": "IP_ADDRESS = \"10.10.11.12\"",
"modifier": "private static final",
"original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";",
"type": "String",
"var_name": "IP_ADDRESS"
},
{
"declarator": "frameType = APIFrameType.REMO... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadInvalidIP() throws Exception {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[13];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem.arraycopy(new byte[]{0x00, 0x00, 0x00, 0x00}, 0, payload, 2, 4);\n\t... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 13",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 13;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Re... | {
"body": "public static RemoteATCommandWifiPacket 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) ... | {
"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_116 | {
"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 = 0x10;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"FFFF\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"DEF1\");\n\t... | {
"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 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": "RemoteATCommandPacket.isBroadcast()",
"constructor": fa... | {
"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_546 | {
"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 testReadDataByteArrayEmptyData() 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\t\n\t\t// Call the method under test.\n\t\tint nBytes = ... | {
"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_815 | {
"fields": [
{
"declarator": "INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}",
"modifier": "private final static",
"original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};",
... | {
"body": "@Test\n\tpublic final void testEqualsIsSymetric() {\n\t\t// Setup the resources for the test.\n\t\tXBeeIMEIAddress imei1 = new XBeeIMEIAddress(\"1234\");\n\t\tXBeeIMEIAddress imei2 = new XBeeIMEIAddress(\"1234\");\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual1 = imei1.equals(imei2);\n\t\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": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (!(obj instanceof XBeeIMEIAddress))\n\t\t\treturn false;\n\t\tXBeeIMEIAddress addr = (XBeeIMEIAddress)obj;\n\t\treturn addr.getValue().equals(getValue());\n\t}",
"class_method_signature": "XBeeIMEIAddress.... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_403 | {
"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 testIsBroadcastWithBroadcastOptionBit1Enabled() {\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 = 0xA2; /* bit 1 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, ... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 11",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "sourceAddress64",
"... | {
"body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1)\n\t\t\t\t|| ByteUtils.isBitEnabled(getReceiveOptions(), 2);\n\t}",
"class_method_signature": "RX64Packet.isBroadcast()",
"constructor": false,
"full_signature": "@Override public boolean isBroadcast... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_680 | {
"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 testReadBytesEmptyInputStream() {\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\tbyte[] result = ByteUtils.readBytes(2, in);\n\t\t\n\t\... | {
"fields": [],
"file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java",
"identifier": "ByteUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)",
"constructor": false,
"full_signature": "pu... | {
"body": "public static byte[] readBytes(int numBytes, ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\tif (numBytes < 0)\n\t\t\tthrow new IllegalArgumentException(\"Number of bytes to read must be equal or greater than 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_395 | {
"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 testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tRemoteATCommandResponseWifiPacket packet = new RemoteATCommandResponseWifiPacket(frameID, sourceAddress, command, status, commandValue);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat... | {
"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 false;\n\t}",
"class_method_signature": "RemoteATCommandResponseWifiPacket.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_20 | {
"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 testGetPacketParametersNoFrameIDWithData() {\n\t\t// Setup the resources for the test.\n\t\tAPIFrameType frameType = APIFrameType.GENERIC;\n\t\tfinal String expectedField = HexUtils.prettyHexString(HexUtils.byteArrayToHexString(new byte[]{0x00, 0x01, 0x02, 0x03}));\n\t\tTestXBeeA... | {
"fields": [
{
"declarator": "NO_FRAME_ID = 9999",
"modifier": "public final static",
"original_string": "public final static int NO_FRAME_ID = 9999;",
"type": "int",
"var_name": "NO_FRAME_ID"
},
{
"declarator": "frameID = NO_FRAME_ID",
"modifier": "protected",
... | {
"body": "@Override\n\tprotected LinkedHashMap<String, String> getPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tif (getFrameType() != null)\n\t\t\tparameters.put(\"Frame type\", HexUtils.prettyHexString(HexUtils.integerToHexString(frameTypeValue, 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_511 | {
"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 testEqualsWithDifferentParity() {\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, 2, 0);\n\t\t\n\t\t// Call the method under ... | {
"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_141 | {
"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 testIsBroadcastWith16BitAnd64BitBroadcastDestinationAddress() {\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(\"FFFF\");\n\t\tint source... | {
"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": "@Override\n\tpublic boolean isBroadcast() {\n\t\tif (get64BitDestinationAddress().equals(XBee64BitAddress.BROADCAST_ADDRESS) \n\t\t\t\t|| get16BitDestinationAddress().equals(XBee16BitAddress.BROADCAST_ADDRESS))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"class_method_signature": "ExplicitAddressingPac... | {
"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_454 | {
"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 TX Status packet.\")));\n\t\t\n\t\t// Call the method under te... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "transmitStatus",
"mod... | {
"body": "public static TXStatusPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"TX Status packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 1 (status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgum... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_287 | {
"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 testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tSendDataRequestPacket packet = new SendDataRequestPacket(frameID, path, contentType, options, data);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Packet should not be broadcast\",... | {
"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 boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "SendDataRequestPacket.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_98 | {
"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.RECEIVE_PACKET.getValue();\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitA... | {
"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 ReceivePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Receive 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 (payload.length < MIN_API_PAYLOAD_LENG... | {
"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_77 | {
"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\tString command = \"DL\";\n\t\tbyte[] parameter = new byte[]{0x6D, 0x79};\n\t\tATCommandQueuePacket packet = new ATCommandQueuePacket(frame... | {
"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_268 | {
"fields": [
{
"declarator": "frameType = APIFrameType.SEND_DATA_RESPONSE.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.SEND_DATA_RESPONSE.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "frameID = ... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[3];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)status.getID();\n\t\tpayload[2] = (byte)status.getID();\n\n\t\texception.expect(IllegalArgumentE... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Send... | {
"body": "public static SendDataResponsePacket 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) != ... | {
"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_792 | {
"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 testGetFirstPacketTimeout() throws Exception {\n\t\t// Create an XBeePacketsQueue of 5 slots but don't fill it.\n\t\tXBeePacketsQueue xbeePacketsQueue = PowerMockito.spy(new XBeePacketsQueue(5));\n\t\t\n\t\t// Get the current time.\n\t\tcurrentMillis = System.currentTimeMillis();\n\t\t... | {
"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": "public XBeePacket getFirstPacket(int timeout) {\n\t\tif (timeout > 0) {\n\t\t\tXBeePacket xbeePacket = getFirstPacket(0);\n\t\t\t// Wait for a timeout or until an XBee packet is read.\n\t\t\tLong deadLine = System.currentTimeMillis() + timeout;\n\t\t\twhile (xbeePacket == null && deadLine > System.currentT... | {
"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_638 | {
"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 testSetIPAddressMask() throws Exception {\n\t\t// Do nothing when trying to set the MK parameter.\n\t\tMockito.doNothing().when(wifiDevice).setParameter(Mockito.eq(PARAMETER_MK), Mockito.any(byte[].class));\n\n\t\t// Set the IP address mask.\n\t\twifiDevice.setIPAddressMask((Inet4Addre... | {
"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 setIPAddressMask(Inet4Address address) throws TimeoutException, XBeeException {\n\t\tif (address == null)\n\t\t\tthrow new NullPointerException(\"Address mask cannot be null.\");\n\t\t\n\t\tsetParameter(\"MK\", address.getAddress());\n\t}",
"class_method_signature": "WiFiDevice.setIPAddressMa... | {
"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_776 | {
"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 testEqualsWithNull() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress addr = new XBee16BitAddress(\"0x1234\");\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(\"16-bit address c... | {
"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_326 | {
"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 testSetDestPortNegative() {\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 setDestPort(int destPort) {\n\t\tif (destPort < 0 || destPort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.destPort = destPort;\n\t}",
"class_method_signature": "TXIPv4Packet.setDestPort(int destPort)",
"constructor": false,
"full_signature": "public... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_93 | {
"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 testGetParameterAsStringNullValue() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tATCommandPacket packet = new ATCommandPacket(frameID, command, (String)null);\n\t\t\n\t\t// Call the method under test.\n\t\tString value = ... | {
"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 String getParameterAsString() {\n\t\tif (parameter == null)\n\t\t\treturn null;\n\t\treturn new String(parameter);\n\t}",
"class_method_signature": "ATCommandPacket.getParameterAsString()",
"constructor": false,
"full_signature": "public String getParameterAsString()",
"identifier": "getPara... | {
"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_633 | {
"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 testSetIPAddressingMode() throws Exception {\n\t\t// Do nothing when trying to set the MA parameter.\n\t\tMockito.doNothing().when(wifiDevice).setParameter(Mockito.eq(PARAMETER_MA), Mockito.any(byte[].class));\n\n\t\t// Set the addressing mode.\n\t\twifiDevice.setIPAddressingMode(IPAdd... | {
"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 setIPAddressingMode(IPAddressingMode mode) throws TimeoutException, XBeeException {\n\t\tif (mode == null)\n\t\t\tthrow new NullPointerException(\"IP addressing mode cannot be null.\");\n\t\t\n\t\tsetParameter(\"MA\", ByteUtils.intToByteArray(mode.getID()));\n\t}",
"class_method_signature": "... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_263 | {
"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 testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tFrameErrorPacket packet = new FrameErrorPacket(error);\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(false)));\n\... | {
"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": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}",
"class_method_signature": "FrameErrorPacket.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_799 | {
"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 testEqualsWithDifferentXBeePacket() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress addr1 = new XBee64BitAddress(\"0x0013A20040123456\");\n\t\tXBee64BitAddress addr2 = new XBee64BitAddress(\"0x0013A20040789012\");\n\t\t\n\t\t// Call the method under test.\n\t\tb... | {
"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_408 | {
"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 RX16 Address IO packet.\")));\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_371 | {
"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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[11];\n\t\tSystem.arraycopy(new byte[]{0x00, 0x00, 0x00, 0x00}, 0, payload, 0, 4);\n\t\tSystem.arraycopy(sourceAddress.getAddress(), 0, payload, 4, sourceAddr... | {
"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_721 | {
"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 testReadIntegerFromByteLengthGreaterThan8() {\n\t\t// Setup the resources for the test.\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Length must be between 0 and 8.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tByteUtils.... | {
"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_234 | {
"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 testSetDestPortNegative() {\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 setDestPort(int destPort) {\n\t\tif (destPort < 0 || destPort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_DEST_PORT_ILLEGAL);\n\n\t\tthis.destPort = destPort;\n\t}",
"class_method_signature": "RXIPv6Packet.setDestPort(int destPort)",
"constructor": false,
"full_signature": "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_664 | {
"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\n\tpublic void testStopListeningSuccess() throws TimeoutException, XBeeException {\n\t\t// Do nothing when setting any parameter.\n\t\tMockito.doNothing().when(ipDevice).setParameter(Mockito.anyString(), Mockito.any(byte[].class));\n\t\t\n\t\tipDevice.stopListening();\n\t\t\n\t\t// Verify that source... | {
"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": "public void stopListening() throws TimeoutException, XBeeException {\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)0));\n\t\tsourcePort = 0;\n\t}",
"class_method_signature": "IPDevice.stopListening()",
"constructor": false,
"full_signature": "public void stopListening()",
"identifier"... | {
"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_808 | {
"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 testCreateWithValidByteArray() {\n\t\t// Test with valid byte array.\n\t\tXBeeIMEIAddress imei = null;\n\t\ttry {\n\t\t\timei = new XBeeIMEIAddress(VALID_BYTE_ARRAY);\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\tassertEqua... | {
"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_737 | {
"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 testNewByteArrayFinalSizeSameAsOriginal() {\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[]{'1', '2', '3', '4'};\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.newBy... | {
"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_367 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/packet/XBeeChecksumTest.java",
"identifier": "XBeeChecksumTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testReset() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] array = new byte[] {2, 6, 1};\n\t\tint expectedResult = 0xFF;\n\t\tXBeeChecksum c = new XBeeChecksum();\n\t\tc.add(array);\n\t\t\n\t\t// Call the method under test.\n\t\tc.reset();\n\t\t\n\t\t// Verify the result... | {
"fields": [
{
"declarator": "value = 0",
"modifier": "private",
"original_string": "private int value = 0;",
"type": "int",
"var_name": "value"
}
],
"file": "library/src/main/java/com/digi/xbee/api/packet/XBeeChecksum.java",
"identifier": "XBeeChecksum",
"interfaces": "... | {
"body": "public void reset() {\n\t\tvalue = 0;\n\t}",
"class_method_signature": "XBeeChecksum.reset()",
"constructor": false,
"full_signature": "public void reset()",
"identifier": "reset",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "void",
"signature": "void reset()",... | {
"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_672 | {
"fields": [
{
"declarator": "PARAMETER_MY = \"MY\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_MY = \"MY\";",
"type": "String",
"var_name": "PARAMETER_MY"
},
{
"declarator": "PARAMETER_C0 = \"C0\"",
"modifier":... | {
"body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationReadDataTimeout() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that sho... | {
"fields": [
{
"declarator": "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 XBeeMessage readData() {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPDevice.readData()",
"constructor": false,
"full_signature": "@Override public XBeeMessage readData()",
"identifier... | {
"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_388 | {
"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 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(\"Remote AT Command Response (Wi-Fi) packet payload cannot be null.\")));\n\n\t\t// Cal... | {
"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_222 | {
"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 testSetProtocolNull() {\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(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Protocol cann... | {
"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 setProtocol(IPProtocol protocol) {\n\t\tif (protocol == null)\n\t\t\tthrow new NullPointerException(ERROR_PROTOCOL_NULL);\n\n\t\tthis.protocol = protocol;\n\t}",
"class_method_signature": "TXIPv6Packet.setProtocol(IPProtocol protocol)",
"constructor": false,
"full_signature": "public void... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_449 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n\tpublic",
"original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
}
],
"file": "library/src/te... | {
"body": "@Test\n\tpublic final void testIsBroadcastWithBroadcastOptionBit2Enabled() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 75;\n\t\tint options = 0x34; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{(byte)0xFF, ... | {
"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_85 | {
"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.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];\n\t\tp... | {
"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 ATCommandPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"AT Command 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 new Illega... | {
"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_330 | {
"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 testSetProtocolNull() {\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(NullPointerException.class);\n\t\texception.expectMessage(is(equalT... | {
"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 setProtocol(IPProtocol protocol) {\n\t\tif (protocol == null)\n\t\t\tthrow new NullPointerException(ERROR_PROTOCOL_NULL);\n\n\t\tthis.protocol = protocol;\n\t}",
"class_method_signature": "TXIPv4Packet.setProtocol(IPProtocol protocol)",
"constructor": false,
"full_signature": "public void... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_760 | {
"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 testPrettyHexStringNullByteArray() {\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 test.\n... | {
"fields": [
{
"declarator": "HEXES = \"0123456789ABCDEF\"",
"modifier": "private static final",
"original_string": "private static final String HEXES = \"0123456789ABCDEF\";",
"type": "String",
"var_name": "HEXES"
},
{
"declarator": "HEX_HEADER = \"0x\"",
"modif... | {
"body": "public static String prettyHexString(String hexString) {\n\t\tif (hexString == null)\n\t\t\tthrow new NullPointerException(\"Hexadecimal string cannot be null.\");\n\t\t\n\t\tString copy = hexString.toUpperCase();\n\t\tfor (final char c : copy.toCharArray()) {\n\t\t\tif (!HEXES.contains(\"\"+c))\n\t\t\t\tt... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_275 | {
"fields": [
{
"declarator": "frameType = APIFrameType.DEVICE_RESPONSE_STATUS.getValue()",
"modifier": "private",
"original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE_STATUS.getValue();",
"type": "int",
"var_name": "frameType"
},
{
"declarator": "fr... | {
"body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[3];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)status.getID();\n\t\tpayload[2] = (byte)status.getID();\n\n\t\texception.expect(IllegalArgumentE... | {
"fields": [
{
"declarator": "MIN_API_PAYLOAD_LENGTH = 3",
"modifier": "private static final",
"original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;",
"type": "int",
"var_name": "MIN_API_PAYLOAD_LENGTH"
},
{
"declarator": "ERROR_PAYLOAD_NULL = \"Devi... | {
"body": "public static DeviceResponseStatusPacket 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)... | {
"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_625 | {
"fields": [],
"file": "library/src/test/java/com/digi/xbee/api/exceptions/ATCommandExceptionTest.java",
"identifier": "ATCommandExceptionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic final void testGetMessageOnlyCommandStatusNull() {\n\t\t// Setup the resources for the test.\n\t\tATCommandStatus atCommandStatus = null;\n\t\tATCommandException e = new ATCommandException(atCommandStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tString result = e.getMessage();\n\t\t... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "DEFAULT_MESSAGE = \"There was a problem s... | {
"body": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (atCommandStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + atCommandStatus.getDescripti... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_432 | {
"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.TX_16.getValue();\n\t\tint frameID = 0xE7;\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"EF13\");\n\t\t\n\t\tbyte[] payload = new byte[4];\n\t\tpay... | {
"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": "transmitOptions",
"mo... | {
"body": "public static TX16Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"TX16 Request packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (address) + 1 (transmit options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\... | {
"created": null,
"fork": null,
"fork_count": 54,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 21871478,
"size": 3156,
"stargazer_count": 76,
"stars": null,
"updates": null,
"url": "https://github.com/digidotcom/xbee-java"
} |
21871478_598 | {
"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 testNotSupportedOperationSendData() 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// All the following operations sh... | {
"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 sendData(RemoteXBeeDevice remoteXBeeDevice, byte[] data)\n\t\t\tthrows TimeoutException, XBeeException {\n\t\t// Not supported in IPv6 modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}",
"class_method_signature": "IPv6Device.sendData(RemoteXBeeDevic... | {
"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.