id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
32533210_3 | {
"fields": [],
"file": "libs/Signature_Wrapping_Library/src/test/java/wsattacker/library/signatureWrapping/util/signature/weakness/SignatureManipulationHelperTest.java",
"identifier": "SignatureManipulationHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRemoveSignature_one_contained()\n {\n Document doc = generateDummySamlDocument( true, false, false );\n List<Element> sigList = DomUtilities.findChildren( doc.getDocumentElement(), \"Signature\", URI_NS_DS, true );\n assertEquals( 1, sigList.size() );\n\n ... | {
"fields": [],
"file": "libs/Signature_Wrapping_Library/src/main/java/wsattacker/library/signatureWrapping/util/signature/weakness/SignatureManipulationHelper.java",
"identifier": "SignatureManipulationHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "SignatureManipulationHelper.... | {
"body": "public static void removeSignature( Document msg, int which )\n {\n List<Element> signatures = DomUtilities.findChildren( msg, \"Signature\", NamespaceConstants.URI_NS_DS, true );\n Element toRemove = signatures.get( which );\n toRemove.getParentNode().removeChild( toRemove );\n ... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_118 | {
"fields": [],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33XTest.java",
"identifier": "CollisionDJBX33XTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetHash()\n {\n String s = \"QCMWaIOvpl\";\n CollisionDJBX33X instance = new CollisionDJBX33X();\n int expResult = 0;\n int result = instance.getHash( s );\n assertEquals( expResult, result );\n }",
"class_method_signature": "CollisionDJ... | {
"fields": [],
"file": "plugins/Denial_of_Service/src/main/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33X.java",
"identifier": "CollisionDJBX33X",
"interfaces": "implements CollisionInterface",
"methods": [
{
"class_method_signature": "CollisionDJBX33X.getHash( Strin... | {
"body": "@Override\n public int getHash( String s )\n {\n byte[] byteArray = s.getBytes();\n int n = byteArray.length;\n int hash = 5381;\n for ( int i = 0; i < n; i++ )\n {\n // System.out.println(i\n // +\" out of \"+n+\" mit Byte: \"+(int)byteArray[i... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_134 | {
"fields": [
{
"declarator": "t",
"modifier": "private static",
"original_string": "private static GenericDosPluginTest t;",
"type": "GenericDosPluginTest",
"var_name": "t"
},
{
"declarator": "attackPlugin",
"modifier": "private static",
"original_string": ... | {
"body": "@Test\n public void testCreateTamperedRequest()\n {\n t.testCreateTamperedRequest( attackPlugin );\n }",
"class_method_signature": "SoapArrayAttackTest.testCreateTamperedRequest()",
"constructor": false,
"full_signature": "@Test public void testCreateTamperedRequest()",
"identifier"... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "optionNumberArrayElements",
"modifi... | {
"body": "@Override\n public void createTamperedRequest()\n {\n\n String stringSOAPMessage = this.getOptionTextAreaSoapMessage().getValue();\n\n // Try to find soapArray in SoapMessage\n String regex1 = \"arrayType=\\\"[A-Za-z0-9:_-]*\\\\x5B\";\n // Compiles regular expression into ... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_21 | {
"fields": [
{
"declarator": "m_SchemaAnalyser",
"modifier": "private static",
"original_string": "private static SchemaAnalyzer m_SchemaAnalyser;",
"type": "SchemaAnalyzer",
"var_name": "m_SchemaAnalyser"
},
{
"declarator": "log",
"modifier": "private static",
... | {
"body": "@Test\n public void testExecuteAttack()\n {\n String tempScore = createSimStringStrategy( DICE_COEFF ).getShortDescriptionString();\n /*\n * AttackManager instance = null; byte[] expResult = null; byte[] result = instance.executeAttack();\n * assertArrayEquals(expResult,... | {
"fields": [
{
"declarator": "m_DetectionReport",
"modifier": "private final",
"original_string": "private final DetectionReport m_DetectionReport;",
"type": "DetectionReport",
"var_name": "m_DetectionReport"
},
{
"declarator": "m_InputFile",
"modifier": "private... | {
"body": "public byte[] executeAttack()\n throws CryptoAttackException\n {\n return m_XMLEncryptionAttack.executeAttack();\n }",
"class_method_signature": "AttackManager.executeAttack()",
"constructor": false,
"full_signature": "public byte[] executeAttack()",
"identifier": "executeAttack... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_76 | {
"fields": [
{
"declarator": "list",
"modifier": "private static",
"original_string": "private static SortedUniqueList<AbstractPlugin> list;",
"type": "SortedUniqueList<AbstractPlugin>",
"var_name": "list"
},
{
"declarator": "p1",
"modifier": "private static",
... | {
"body": "@Test\n public void unique()\n {\n list.add( p1 );\n assertTrue( \"List should contain 1 Element\", list.size() == 1 );\n list.add( p3 );\n assertTrue( \"List should contain 2 Elements\", list.size() == 2 );\n list.add( p4 );\n assertTrue( \"List not should c... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "framework/src/main/java/wsattacker/util/SortedUniqueL... | {
"body": "@Override\n public void add( int index, T element )\n {\n return;\n }",
"class_method_signature": "SortedUniqueList.add( int index, T element )",
"constructor": false,
"full_signature": "@Override public void add( int index, T element )",
"identifier": "add",
"invocations": [],
... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_99 | {
"fields": [
{
"declarator": "instance",
"modifier": "",
"original_string": "LogEntryRequest instance;",
"type": "LogEntryRequest",
"var_name": "instance"
}
],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/logEntry/LogEntryRequestTest.ja... | {
"body": "@Test\n public void testSetDuration()\n {\n long duration = 100L;\n instance.setDuration( duration );\n }",
"class_method_signature": "LogEntryRequestTest.testSetDuration()",
"constructor": false,
"full_signature": "@Test public void testSetDuration()",
"identifier": "testSet... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final String type;",
"type": "String",
"var_name": "type"
},
{
"declarator": "tsSend",
"modifier": "private",
"original_string": "private long tsSend;",
"typ... | {
"body": "public void setDuration( long duration )\n {\n this.duration = duration;\n }",
"class_method_signature": "LogEntryRequest.setDuration( long duration )",
"constructor": false,
"full_signature": "public void setDuration( long duration )",
"identifier": "setDuration",
"invocations": [],... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_60 | {
"fields": [
{
"declarator": "notPossibleState = new PossibleState()",
"modifier": "private final",
"original_string": "private final PossibleState notPossibleState = new PossibleState();",
"type": "PossibleState",
"var_name": "notPossibleState"
}
],
"file": "libs/Intelligen... | {
"body": "@Test\n public void attackNotPossibleTest()\n {\n IntelligentDoSLibraryImpl impl = Mockito.mock( IntelligentDoSLibraryImpl.class );\n AttackModel value = new AttackModel();\n when( impl.createNewTampered( false ) ).thenReturn( value );\n when( impl.getCurrentAttack() ).the... | {
"fields": [
{
"declarator": "RESENDS = 1",
"modifier": "private static final",
"original_string": "private static final int RESENDS = 1;",
"type": "int",
"var_name": "RESENDS"
},
{
"declarator": "minParamItem = new CommonParamItem( 1, 1, 1000 )",
"modifier": "pr... | {
"body": "@Override\n public void update( IntelligentDoSLibraryImpl STATE_CONTEXT, AttackModel attackModel )\n {\n switch ( verify )\n {\n case NONE:\n reference = attackModel;\n\n if ( attackModel.isAllSOAPFault() )\n {\n ... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_122 | {
"fields": [],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33XTest.java",
"identifier": "CollisionDJBX33XTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void MeetInTheMiddleHashForthTest()\n {\n\n // Result for should be QCMWaIO\n // - 3B847A2A Hex\n // - 998537770 Dec\n CollisionDJBX33X instance = new CollisionDJBX33X();\n int result = instance.hashForth( \"QCMWaIO\" );\n assertEquals( 9985377... | {
"fields": [],
"file": "plugins/Denial_of_Service/src/main/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33X.java",
"identifier": "CollisionDJBX33X",
"interfaces": "implements CollisionInterface",
"methods": [
{
"class_method_signature": "CollisionDJBX33X.getHash( Strin... | {
"body": "public int hashForth( String s )\n {\n byte[] byteArray = s.getBytes();\n int n = byteArray.length;\n int hash = 5381;\n for ( int i = 0; i < n; i++ )\n {\n // System.out.println(i + \" out of \" + n + \" mit Byte: \" + (int)\n // byteArray[i] + \... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_37 | {
"fields": [
{
"declarator": "successfulState = new SuccessfulState()",
"modifier": "private final",
"original_string": "private final SuccessfulState successfulState = new SuccessfulState();",
"type": "SuccessfulState",
"var_name": "successfulState"
}
],
"file": "libs/Intel... | {
"body": "@Test\n public void testTestProbes()\n {\n successfulState.updateTestProbes( new Metric() );\n }",
"class_method_signature": "SuccessfulStateTest.testTestProbes()",
"constructor": false,
"full_signature": "@Test public void testTestProbes()",
"identifier": "testTestProbes",
"invoc... | {
"fields": [
{
"declarator": "logger = Logger.getLogger( getClass() )",
"modifier": "private final",
"original_string": "private final Logger logger = Logger.getLogger( getClass() );",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "untampered",
"modif... | {
"body": "@Override\n public void updateTestProbes( Metric metric )\n {\n synchronized ( list )\n {\n list.add( metric );\n }\n }",
"class_method_signature": "SuccessfulState.updateTestProbes( Metric metric )",
"constructor": false,
"full_signature": "@Override public v... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_36 | {
"fields": [
{
"declarator": "successfulState = new SuccessfulState()",
"modifier": "private final",
"original_string": "private final SuccessfulState successfulState = new SuccessfulState();",
"type": "SuccessfulState",
"var_name": "successfulState"
}
],
"file": "libs/Intel... | {
"body": "@Test\n public void testSuccessfulWithFurtherUntampered()\n {\n IntelligentDoSLibraryImpl context = mock( IntelligentDoSLibraryImpl.class );\n\n SuccessDecider sd = mock( SuccessDecider.class );\n when( sd.wasSuccessful( new Long[0], new Long[0] ) ).thenReturn( true );\n\n ... | {
"fields": [
{
"declarator": "logger = Logger.getLogger( getClass() )",
"modifier": "private final",
"original_string": "private final Logger logger = Logger.getLogger( getClass() );",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "untampered",
"modif... | {
"body": "@Override\n public void update( final IntelligentDoSLibraryImpl STATE_CONTEXT, final AttackModel attackModel )\n {\n\n SuccessDecider successDecider = STATE_CONTEXT.getSuccessDecider();\n\n if ( untampered == null )\n {\n untampered = attackModel;\n\n // che... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_123 | {
"fields": [],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33XTest.java",
"identifier": "CollisionDJBX33XTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void MeetInTheMiddleHashBackTest()\n throws NoSuchAlgorithmException\n {\n\n // Result for should be QCMWaIO\n // - 3B847A2A Hex\n // - 998537770 Dec\n CollisionDJBX33X instance = new CollisionDJBX33X();\n int result1 = instance.hashBack( \"vpl... | {
"fields": [],
"file": "plugins/Denial_of_Service/src/main/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33X.java",
"identifier": "CollisionDJBX33X",
"interfaces": "implements CollisionInterface",
"methods": [
{
"class_method_signature": "CollisionDJBX33X.getHash( Strin... | {
"body": "public int hashBack( String s, int target )\n {\n byte[] byteArray = s.getBytes();\n int n = byteArray.length;\n int hash = target;\n for ( int i = n; i > 0; i-- )\n {\n // System.out.println(i + \" out of \" + n + \" mit Byte: \" + (int)\n // byt... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_61 | {
"fields": [
{
"declarator": "notPossibleState = new PossibleState()",
"modifier": "private final",
"original_string": "private final PossibleState notPossibleState = new PossibleState();",
"type": "PossibleState",
"var_name": "notPossibleState"
}
],
"file": "libs/Intelligen... | {
"body": "@Test\n public void attackPossibleTest()\n {\n IntelligentDoSLibraryImpl impl = Mockito.mock( IntelligentDoSLibraryImpl.class );\n AttackModel value = new AttackModel();\n when( impl.createNewTampered( false ) ).thenReturn( value );\n when( impl.getCurrentAttack() ).thenRe... | {
"fields": [
{
"declarator": "RESENDS = 1",
"modifier": "private static final",
"original_string": "private static final int RESENDS = 1;",
"type": "int",
"var_name": "RESENDS"
},
{
"declarator": "minParamItem = new CommonParamItem( 1, 1, 1000 )",
"modifier": "pr... | {
"body": "@Override\n public void update( IntelligentDoSLibraryImpl STATE_CONTEXT, AttackModel attackModel )\n {\n switch ( verify )\n {\n case NONE:\n reference = attackModel;\n\n if ( attackModel.isAllSOAPFault() )\n {\n ... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_77 | {
"fields": [
{
"declarator": "list",
"modifier": "private static",
"original_string": "private static SortedUniqueList<AbstractPlugin> list;",
"type": "SortedUniqueList<AbstractPlugin>",
"var_name": "list"
},
{
"declarator": "p1",
"modifier": "private static",
... | {
"body": "@Test\n public void addAll()\n {\n list.add( p1 );\n list.add( p2 );\n list.add( p3 );\n list.addAll( list );\n assertTrue( \"List not should contain double Elements\" + list, list.size() == 3 );\n }",
"class_method_signature": "TestSortedUniqueList.addAll()",
... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
}
],
"file": "framework/src/main/java/wsattacker/util/SortedUniqueL... | {
"body": "@Override\n public boolean addAll( int index, Collection<? extends T> c )\n {\n return false;\n }",
"class_method_signature": "SortedUniqueList.addAll( int index, Collection<? extends T> c )",
"constructor": false,
"full_signature": "@Override public boolean addAll( int index, Collect... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_98 | {
"fields": [
{
"declarator": "instance",
"modifier": "",
"original_string": "LogEntryRequest instance;",
"type": "LogEntryRequest",
"var_name": "instance"
}
],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/logEntry/LogEntryRequestTest.ja... | {
"body": "@Test\n public void testGetDuration()\n {\n long expResult = 100L;\n long result = instance.getDuration();\n assertEquals( expResult, result );\n }",
"class_method_signature": "LogEntryRequestTest.testGetDuration()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final String type;",
"type": "String",
"var_name": "type"
},
{
"declarator": "tsSend",
"modifier": "private",
"original_string": "private long tsSend;",
"typ... | {
"body": "public long getDuration()\n {\n return duration;\n }",
"class_method_signature": "LogEntryRequest.getDuration()",
"constructor": false,
"full_signature": "public long getDuration()",
"identifier": "getDuration",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"ret... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_20 | {
"fields": [
{
"declarator": "m_SchemaAnalyser",
"modifier": "private static",
"original_string": "private static SchemaAnalyzer m_SchemaAnalyser;",
"type": "SchemaAnalyzer",
"var_name": "m_SchemaAnalyser"
},
{
"declarator": "log",
"modifier": "private static",
... | {
"body": "@Test\n public void testGetXMLEncryptionAttack()\n {\n /*\n * System.out.println(\"getXMLEncryptionAttack\"); AttackManager instance = null; XMLEncryptionAttack expResult =\n * null; XMLEncryptionAttack result = instance.getXMLEncryptionAttack(); assertEquals(expResult, result)... | {
"fields": [
{
"declarator": "m_DetectionReport",
"modifier": "private final",
"original_string": "private final DetectionReport m_DetectionReport;",
"type": "DetectionReport",
"var_name": "m_DetectionReport"
},
{
"declarator": "m_InputFile",
"modifier": "private... | {
"body": "public XMLEncryptionAttackBase getXMLEncryptionAttack()\n {\n return m_XMLEncryptionAttack;\n }",
"class_method_signature": "AttackManager.getXMLEncryptionAttack()",
"constructor": false,
"full_signature": "public XMLEncryptionAttackBase getXMLEncryptionAttack()",
"identifier": "getXML... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_135 | {
"fields": [
{
"declarator": "t",
"modifier": "private static",
"original_string": "private static GenericDosPluginTest t;",
"type": "GenericDosPluginTest",
"var_name": "t"
},
{
"declarator": "attackPlugin",
"modifier": "private static",
"original_string": ... | {
"body": "@Test\n public void testCreateTamperedRequest()\n {\n t.testCreateTamperedRequest( attackPlugin );\n }",
"class_method_signature": "XmlOverlongNamesTest.testCreateTamperedRequest()",
"constructor": false,
"full_signature": "@Test public void testCreateTamperedRequest()",
"identifier... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "useLengthOfElementName",
"modifier"... | {
"body": "@Override\n public void createTamperedRequest()\n {\n\n StringBuilder sb = new StringBuilder( \"\" );\n\n // elementname\n if ( useLengthOfElementName.isOn() )\n {\n sb.append( \"<\" );\n for ( int i = 1; i < ( lengthOfElementName.getValue() ); i++ )\... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_119 | {
"fields": [],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33XTest.java",
"identifier": "CollisionDJBX33XTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCollisionsFail()\n {\n CollisionDJBX33X instance = new CollisionDJBX33X();\n\n int t1 = instance.getHash( \"QCMWaIOvpl\" );\n int t2 = instance.getHash( \"QCMWalOwQl\" );\n\n if ( t1 != t2 )\n {\n assertTrue( true );\n }\n ... | {
"fields": [],
"file": "plugins/Denial_of_Service/src/main/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33X.java",
"identifier": "CollisionDJBX33X",
"interfaces": "implements CollisionInterface",
"methods": [
{
"class_method_signature": "CollisionDJBX33X.getHash( Strin... | {
"body": "@Override\n public int getHash( String s )\n {\n byte[] byteArray = s.getBytes();\n int n = byteArray.length;\n int hash = 5381;\n for ( int i = 0; i < n; i++ )\n {\n // System.out.println(i\n // +\" out of \"+n+\" mit Byte: \"+(int)byteArray[i... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_2 | {
"fields": [],
"file": "libs/Signature_Wrapping_Library/src/test/java/wsattacker/library/signatureWrapping/util/signature/weakness/SignatureManipulationHelperTest.java",
"identifier": "SignatureManipulationHelperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDoubleSignature()\n {\n }",
"class_method_signature": "SignatureManipulationHelperTest.testDoubleSignature()",
"constructor": false,
"full_signature": "@Test public void testDoubleSignature()",
"identifier": "testDoubleSignature",
"invocations": [],
"modifiers":... | {
"fields": [],
"file": "libs/Signature_Wrapping_Library/src/main/java/wsattacker/library/signatureWrapping/util/signature/weakness/SignatureManipulationHelper.java",
"identifier": "SignatureManipulationHelper",
"interfaces": "",
"methods": [
{
"class_method_signature": "SignatureManipulationHelper.... | {
"body": "public static void doubleSignature( Document msg, int whichToDouble, int whichToReplace )\n {\n List<Element> signatures = DomUtilities.findChildren( msg, \"Signature\", NamespaceConstants.URI_NS_DS, true );\n Element clone = (Element) signatures.get( whichToDouble ).cloneNode( true );\n ... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_82 | {
"fields": [
{
"declarator": "plugins",
"modifier": "private static",
"original_string": "private static PluginContainer plugins;",
"type": "PluginContainer",
"var_name": "plugins"
},
{
"declarator": "p1",
"modifier": "private static",
"original_string": "p... | {
"body": "@Test\n public void getByName()\n {\n assertTrue( plugins.getByName( \"Zwei\" ) == p2 );\n assertTrue( plugins.getByName( \"Vier\" ) == null );\n }",
"class_method_signature": "TestPluginContainer.getByName()",
"constructor": false,
"full_signature": "@Test public void getByNam... | {
"fields": [
{
"declarator": "serialVersionUID = 1L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 1L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "plugins",
"modifier": "private fina... | {
"body": "public AbstractPlugin getByName( String pluginName )\n {\n for ( AbstractPlugin plugin : plugins )\n {\n if ( plugin.getName().equals( pluginName ) )\n {\n return plugin;\n }\n }\n return null;\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_94 | {
"fields": [
{
"declarator": "instance",
"modifier": "",
"original_string": "LogEntryRequest instance;",
"type": "LogEntryRequest",
"var_name": "instance"
}
],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/logEntry/LogEntryRequestTest.ja... | {
"body": "@Test\n public void testGetTsSend()\n {\n long expResult = 100;\n long result = instance.getTsSend();\n assertEquals( expResult, result );\n }",
"class_method_signature": "LogEntryRequestTest.testGetTsSend()",
"constructor": false,
"full_signature": "@Test public void te... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final String type;",
"type": "String",
"var_name": "type"
},
{
"declarator": "tsSend",
"modifier": "private",
"original_string": "private long tsSend;",
"typ... | {
"body": "public long getTsSend()\n {\n return tsSend;\n }",
"class_method_signature": "LogEntryRequest.getTsSend()",
"constructor": false,
"full_signature": "public long getTsSend()",
"identifier": "getTsSend",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "lon... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_57 | {
"fields": [
{
"declarator": "notPossibleState = new PossibleState()",
"modifier": "private final",
"original_string": "private final PossibleState notPossibleState = new PossibleState();",
"type": "PossibleState",
"var_name": "notPossibleState"
}
],
"file": "libs/Intelligen... | {
"body": "@Test\n public void soapFaultTest()\n {\n IntelligentDoSLibraryImpl impl = Mockito.mock( IntelligentDoSLibraryImpl.class );\n\n // --> TAMPERED\n AttackModel attackModel = create( RequestType.TAMPERED, \"Fault>\" );\n DoSAttack doSAttack = mock( DoSAttack.class );\n ... | {
"fields": [
{
"declarator": "RESENDS = 1",
"modifier": "private static final",
"original_string": "private static final int RESENDS = 1;",
"type": "int",
"var_name": "RESENDS"
},
{
"declarator": "minParamItem = new CommonParamItem( 1, 1, 1000 )",
"modifier": "pr... | {
"body": "@Override\n public void update( IntelligentDoSLibraryImpl STATE_CONTEXT, AttackModel attackModel )\n {\n switch ( verify )\n {\n case NONE:\n reference = attackModel;\n\n if ( attackModel.isAllSOAPFault() )\n {\n ... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_115 | {
"fields": [],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33ATest.java",
"identifier": "CollisionDJBX33ATest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCollisionsOk()\n {\n CollisionDJBX33A instance = new CollisionDJBX33A();\n\n int t1 = instance.getHash( \"Az\" );\n int t2 = instance.getHash( \"C8\" );\n int t3 = instance.getHash( \"AzAz\" );\n int t4 = instance.getHash( \"AzC8\" );\n ... | {
"fields": [],
"file": "plugins/Denial_of_Service/src/main/java/wsattacker/plugin/dos/dosExtension/attackClasses/hashDos/CollisionDJBX33A.java",
"identifier": "CollisionDJBX33A",
"interfaces": "implements CollisionInterface",
"methods": [
{
"class_method_signature": "CollisionDJBX33A.getHash( Strin... | {
"body": "@Override\n public int getHash( String s )\n {\n byte[] byteArray = s.getBytes();\n int n = byteArray.length;\n int hash = 5381;\n for ( int i = 0; i < n; i++ )\n {\n // System.out.println(i\n // +\" out of \"+n+\" mit Byte: \"+(int)byteArray[i... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_103 | {
"fields": [
{
"declarator": "instance",
"modifier": "",
"original_string": "LogEntryRequest instance;",
"type": "LogEntryRequest",
"var_name": "instance"
}
],
"file": "plugins/Denial_of_Service/src/test/java/wsattacker/plugin/dos/dosExtension/logEntry/LogEntryRequestTest.ja... | {
"body": "@Test\n public void testGetErrorFlag()\n {\n boolean expResult = false;\n boolean result = instance.getErrorFlag();\n assertEquals( expResult, result );\n }",
"class_method_signature": "LogEntryRequestTest.testGetErrorFlag()",
"constructor": false,
"full_signature": "@Te... | {
"fields": [
{
"declarator": "type",
"modifier": "private final",
"original_string": "private final String type;",
"type": "String",
"var_name": "type"
},
{
"declarator": "tsSend",
"modifier": "private",
"original_string": "private long tsSend;",
"typ... | {
"body": "public boolean getErrorFlag()\n {\n return errorFlag;\n }",
"class_method_signature": "LogEntryRequest.getErrorFlag()",
"constructor": false,
"full_signature": "public boolean getErrorFlag()",
"identifier": "getErrorFlag",
"invocations": [],
"modifiers": "public",
"parameters": "... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_16 | {
"fields": [],
"file": "libs/Schema_Analyzer_Library/src/test/java/wsattacker/library/schemaanalyzer/AnyElementPropertiesImplTest.java",
"identifier": "AnyElementPropertiesImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetNamespaceAttributeValue()\n throws Exception\n {\n AnyElementPropertiesImpl anyProperties = getSoapBody11AnyElementProperties();\n assertEquals( \"##any\", anyProperties.getNamespaceAttributeValue() );\n }",
"class_method_signature": "AnyElementPro... | {
"fields": [
{
"declarator": "anyElement",
"modifier": "",
"original_string": "Element anyElement, documentElement;",
"type": "Element",
"var_name": "anyElement"
}
],
"file": "libs/Schema_Analyzer_Library/src/main/java/wsattacker/library/schemaanalyzer/AnyElementPropertiesIm... | {
"body": "@Override\n public String getNamespaceAttributeValue()\n {\n String namespace = anyElement.getAttribute( \"namespace\" );\n if ( namespace == null || namespace.isEmpty() )\n {\n namespace = \"##any\";\n }\n return namespace;\n }",
"class_method_signa... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
32533210_41 | {
"fields": [
{
"declarator": "xmlWithPlaceholder = \"<soapenv:Envelope $$PAYLOADATTR$$>\"\n + \" <soapenv:Header $$PAYLOADATTR$$>$$PAYLOADELEMENT$$</soapenv:Header>\"\n + \" <soapenv:Body $$PAYLOADATTR$$>\" + \" <cxf:celsiusToFarenheit>\" + \" <arg0>1</arg0>\"\n + \" ... | {
"body": "@Test\n public void equalsTest()\n {\n Finding finding = new Finding();\n finding.start = 18;\n finding.end = 33;\n finding.placeholder = \"$$PAYLOADATTR$$\";\n MatcherPosition matcherPosition = new MatcherPosition( xmlWithPlaceholder, finding );\n\n assertTh... | {
"fields": [
{
"declarator": "xmlWithPlaceholder",
"modifier": "private final",
"original_string": "private final String xmlWithPlaceholder;",
"type": "String",
"var_name": "xmlWithPlaceholder"
},
{
"declarator": "finding",
"modifier": "private final",
"ori... | {
"body": "@Override\n public boolean equals( Object obj )\n {\n if ( obj == null )\n {\n return false;\n }\n\n if ( obj == this )\n {\n return true;\n }\n\n if ( !obj.getClass().equals( getClass() ) )\n {\n return false;\n... | {
"created": null,
"fork": null,
"fork_count": 114,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 32533210,
"size": 103783,
"stargazer_count": 372,
"stars": null,
"updates": null,
"url": "https://github.com/RUB-NDS/WS-Attacker"
} |
5455452_3 | {
"fields": [],
"file": "asn-impl/src/test/java/org/mobicents/protocols/asn/AsnInputStreamTest.java",
"identifier": "AsnInputStreamTest",
"interfaces": "",
"superclass": "extends TestCase"
} | {
"body": "@Test\n\tpublic void testReadSequence() throws Exception {\n\t\t\n\t\tAsnInputStream asnIs = new AsnInputStream(definiteSeqData());\n\t\tint tag = asnIs.readTag();\n\t\tAsnInputStream asnIs2 = asnIs.readSequenceStream();\n\t\ttestSeqData(tag, asnIs2, asnIs);\n\t\t\n\t\tasnIs = new AsnInputStream(definiteSe... | {
"fields": [
{
"declarator": "_REAL_BASE10_CHARSET = \"US-ASCII\"",
"modifier": "private static final",
"original_string": "private static final String _REAL_BASE10_CHARSET = \"US-ASCII\";",
"type": "String",
"var_name": "_REAL_BASE10_CHARSET"
},
{
"declarator": "DATA_... | {
"body": "public byte[] readSequence() throws AsnException, IOException {\n\n\t\tint length = readLength();\n\t\treturn this.readSequenceData(length);\n\t}",
"class_method_signature": "AsnInputStream.readSequence()",
"constructor": false,
"full_signature": "public byte[] readSequence()",
"identifier": "readS... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5455452,
"size": 483,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/RestComm/jasn"
} |
5455452_2 | {
"fields": [],
"file": "asn-impl/src/test/java/org/mobicents/protocols/asn/ExternalTest.java",
"identifier": "ExternalTest",
"interfaces": "",
"superclass": "extends TestCase"
} | {
"body": "@Test\n\tpublic void testEncode() throws Exception {\n\t\t\n\t\t\n\t\t// This raw data is from wireshark trace of TCAP - MAP\n\t\tbyte[] data = new byte[] { 0x28, 0x23, 0x06, 0x07, 0x04, 0x00,\n\t\t\t\t0x00, 0x01, 0x01, 0x01, 0x01, (byte) 0xa0, 0x18, (byte) 0xa0,\n\t\t\t\t(byte) 0x80, (byte) 0x80, 0x09, (b... | {
"fields": [
{
"declarator": "_TAG_EXTERNAL_CLASS = Tag.CLASS_UNIVERSAL",
"modifier": "protected static final",
"original_string": "protected static final int _TAG_EXTERNAL_CLASS = Tag.CLASS_UNIVERSAL;",
"type": "int",
"var_name": "_TAG_EXTERNAL_CLASS"
},
{
"declarator... | {
"body": "public void encode(AsnOutputStream aos) throws AsnException {\n\n\t\tthis.encode(aos, Tag.CLASS_UNIVERSAL, Tag.EXTERNAL);\n\t}",
"class_method_signature": "External.encode(AsnOutputStream aos)",
"constructor": false,
"full_signature": "public void encode(AsnOutputStream aos)",
"identifier": "encode... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5455452,
"size": 483,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/RestComm/jasn"
} |
5455452_5 | {
"fields": [],
"file": "asn-impl/src/test/java/org/mobicents/protocols/asn/AsnInputStreamTest.java",
"identifier": "AsnInputStreamTest",
"interfaces": "",
"superclass": "extends TestCase"
} | {
"body": "@Test\n\tpublic void testReadIndefinite() throws Exception {\n\t\tbyte[] data = new byte[] { (byte)0x80, (byte)0x80, 0x09, (byte)0x96, 0x02, 0x24, (byte)0x80,\n\t\t\t\t0x03, 0x00, (byte)0x80, 0x00, (byte)0xf2, (byte)0x81, 0x07, (byte)0x91, 0x13, 0x26,\n\t\t\t\t(byte)0x98, (byte)0x86, 0x03, (byte)0xf0, 0x00... | {
"fields": [
{
"declarator": "_REAL_BASE10_CHARSET = \"US-ASCII\"",
"modifier": "private static final",
"original_string": "private static final String _REAL_BASE10_CHARSET = \"US-ASCII\";",
"type": "String",
"var_name": "_REAL_BASE10_CHARSET"
},
{
"declarator": "DATA_... | {
"body": "public byte[] readIndefinite() throws AsnException, IOException {\n\t\t\n\t\tint startPos = this.pos;\n\t\tthis.advanceIndefiniteLength();\n\t\t\n\t\tbyte[] res = new byte[this.pos - startPos - 2];\n\t\tSystem.arraycopy(this.buffer, this.start + startPos, res, 0, this.pos - startPos - 2);\n\t\treturn res;\... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5455452,
"size": 483,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/RestComm/jasn"
} |
5455452_4 | {
"fields": [],
"file": "asn-impl/src/test/java/org/mobicents/protocols/asn/AsnInputStreamTest.java",
"identifier": "AsnInputStreamTest",
"interfaces": "",
"superclass": "extends TestCase"
} | {
"body": "@Test\n\tpublic void testAdvanceElement() throws Exception {\n\t\t\n\t\tAsnInputStream asnIs = new AsnInputStream(definiteSeqData());\n\t\tint tag = asnIs.readTag();\n\t\tasnIs.advanceElement();\n\t\tassertEquals(16, tag);\n\t\tassertEquals(0, asnIs.available());\n\n\t\tasnIs = new AsnInputStream(definiteS... | {
"fields": [
{
"declarator": "_REAL_BASE10_CHARSET = \"US-ASCII\"",
"modifier": "private static final",
"original_string": "private static final String _REAL_BASE10_CHARSET = \"US-ASCII\";",
"type": "String",
"var_name": "_REAL_BASE10_CHARSET"
},
{
"declarator": "DATA_... | {
"body": "public void advanceElement() throws IOException, AsnException {\n\t\tint length = this.readLength();\n\t\tthis.advanceElementData(length);\n\t}",
"class_method_signature": "AsnInputStream.advanceElement()",
"constructor": false,
"full_signature": "public void advanceElement()",
"identifier": "advan... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5455452,
"size": 483,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/RestComm/jasn"
} |
5455452_1 | {
"fields": [],
"file": "asn-impl/src/test/java/org/mobicents/protocols/asn/ExternalTest.java",
"identifier": "ExternalTest",
"interfaces": "",
"superclass": "extends TestCase"
} | {
"body": "@Test\n\tpublic void testDecode() throws Exception {\n\n\t\t// This raw data is from wireshark trace of TCAP - MAP\n\t\tbyte[] data = new byte[] { 0x28, 0x23, 0x06, 0x07, 0x04, 0x00,\n\t\t\t\t0x00, 0x01, 0x01, 0x01, 0x01, (byte) 0xa0, 0x18, (byte) 0xa0,\n\t\t\t\t(byte) 0x80, (byte) 0x80, 0x09, (byte) 0x96,... | {
"fields": [
{
"declarator": "_TAG_EXTERNAL_CLASS = Tag.CLASS_UNIVERSAL",
"modifier": "protected static final",
"original_string": "protected static final int _TAG_EXTERNAL_CLASS = Tag.CLASS_UNIVERSAL;",
"type": "int",
"var_name": "_TAG_EXTERNAL_CLASS"
},
{
"declarator... | {
"body": "public void decode(AsnInputStream ais) throws AsnException {\n\t\t\n\t\tthis.oid = false;\n\t\tthis.integer = false;\n\t\tthis.objDescriptor = false;\n\t\tthis.oidValue = null;\n\t\tthis.indirectReference = 0;\n\t\tthis.objDescriptorValue = null;\n\t\tthis.asn = false;\n\t\tthis.octet = false;\n\t\tthis.ar... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5455452,
"size": 483,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/RestComm/jasn"
} |
5455452_0 | {
"fields": [
{
"declarator": "output",
"modifier": "private",
"original_string": "private AsnOutputStream output;",
"type": "AsnOutputStream",
"var_name": "output"
}
],
"file": "asn-impl/src/test/java/org/mobicents/protocols/asn/AsnOutputStreamTest.java",
"identifier": "As... | {
"body": "@Test\n\tpublic void testReal10_Basic() throws Exception {\n\t\ttry {\n\t\t\tthis.output.writeReal(\"3\", BERStatics.REAL_NR1 - 1);\n\t\t\tfail();\n\t\t} catch (AsnException asne) {\n\n\t\t}\n\t\ttry {\n\t\t\tthis.output.writeReal(\"3\", BERStatics.REAL_NR3 + 1);\n\t\t\tfail();\n\t\t} catch (AsnException a... | {
"fields": [
{
"declarator": "_REAL_BASE10_CHARSET = \"US-ASCII\"",
"modifier": "private static final",
"original_string": "private static final String _REAL_BASE10_CHARSET = \"US-ASCII\";",
"type": "String",
"var_name": "_REAL_BASE10_CHARSET"
},
{
"declarator": "_BOOL... | {
"body": "public void writeReal(String d, int NR) throws IOException, AsnException {\n\n\t\tthis.writeReal(Tag.CLASS_UNIVERSAL, Tag.REAL, d, NR);\n\t}",
"class_method_signature": "AsnOutputStream.writeReal(String d, int NR)",
"constructor": false,
"full_signature": "public void writeReal(String d, int NR)",
... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 5455452,
"size": 483,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/RestComm/jasn"
} |
29964541_14 | {
"fields": [
{
"declarator": "ambariServer = new AmbariServerImpl()",
"modifier": "private",
"original_string": "private AmbariServerImpl ambariServer = new AmbariServerImpl();",
"type": "AmbariServerImpl",
"var_name": "ambariServer"
},
{
"declarator": "JSON_CLUSTER_ST... | {
"body": "@Test\n public void testClusterStateIsreturned() {\n String clusterState = ambariServer.getRequestState().apply(getAsJsonObject(JSON_CLUSTER_STATE));\n\n assertEquals(\"IN_PROGRESS\", clusterState);\n }",
"class_method_signature": "AmbariServerImplTest.testClusterStateIsreturned()",
... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(AmbariServerImpl.class)",
"modifier": "public static final",
"original_string": "public static final Logger LOG = LoggerFactory.getLogger(AmbariServerImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"de... | {
"body": "Function<JsonElement, String> getRequestState() {\n Function<JsonElement, String> path = new Function<JsonElement, String>() {\n @Nullable\n @Override\n public String apply(@Nullable JsonElement jsonElement) {\n String jsonString = jsonElement.toString... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_3 | {
"fields": [
{
"declarator": "ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\";",
"type": "String",
"var_name": "ERR... | {
"body": "@Test(expectedExceptions = PathNotFoundException.class)\n public void testInvalidReponseThrowsParseEx() throws IOException {\n new RequestCheckRunnable.Builder(mockRequest(\"http://www.example.com\"))\n .client(mockHttpClient(\"Invalid body: No Json\"))\n .timeout(Du... | {
"fields": [
{
"declarator": "VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\")",
"modifier": "private static final",
"original_string": "private static final List<String> VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\");",
"type": "L... | {
"body": "@Override\n public void run() {\n boolean done = Repeater.create(String.format(\"Request %s status check\", builder.request.toString()))\n .every(Duration.ONE_SECOND)\n .until(new Callable<Boolean>() {\n @Override\n public Boolea... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_2 | {
"fields": [
{
"declarator": "ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\";",
"type": "String",
"var_name": "ERR... | {
"body": "@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ERROR_MESSAGE)\n public void testTimeoutRequestThrowsRuntimeEx() throws IOException {\n new RequestCheckRunnable.Builder(mockRequest(\"http://www.example.com\"))\n .client(mockHttpClient(\"{\\\"Req... | {
"fields": [
{
"declarator": "VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\")",
"modifier": "private static final",
"original_string": "private static final List<String> VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\");",
"type": "L... | {
"body": "@Override\n public void run() {\n boolean done = Repeater.create(String.format(\"Request %s status check\", builder.request.toString()))\n .every(Duration.ONE_SECOND)\n .until(new Callable<Boolean>() {\n @Override\n public Boolea... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_15 | {
"fields": [],
"file": "ambari/src/test/java/io/brooklyn/ambari/EtcHostsManagerTest.java",
"identifier": "EtcHostsManagerTest",
"interfaces": "",
"superclass": "extends BrooklynAppUnitTestSupport"
} | {
"body": "@Test\n public void testGatherIpHostnameMapping() {\n TestApplication app = TestApplication.Factory.newManagedInstanceForTests();\n List<Entity> entities = Lists.newArrayList(\n entityWithHostnameAndAddress(app, \"a.example.com\", \"1.2.3.4\"),\n entityWithHos... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcHostsManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcHostsManager.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "... | {
"body": "public static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities) {\n return gatherIpHostnameMapping(entities, Attributes.SUBNET_ADDRESS);\n }",
"class_method_signature": "EtcHostsManager.gatherIpHostnameMapping(Iterable<? extends Entity> entities)",
"constructor"... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_5 | {
"fields": [
{
"declarator": "usernamePasswordCredentials = new UsernamePasswordCredentials(\"admin\", \"password\")",
"modifier": "",
"original_string": "UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(\"admin\", \"password\");",
"type": "Usernam... | {
"body": "@Test\n public void addCorrectHeaderToRequest() {\n AmbariRequestInterceptor requestInterceptor = new AmbariRequestInterceptor(usernamePasswordCredentials);\n\n RequestInterceptor.RequestFacade requestFacade = mock(RequestInterceptor.RequestFacade.class);\n requestInterceptor.interc... | {
"fields": [
{
"declarator": "basicAuth",
"modifier": "private final",
"original_string": "private final String basicAuth;",
"type": "String",
"var_name": "basicAuth"
}
],
"file": "ambari/src/main/java/io/brooklyn/ambari/rest/AmbariRequestInterceptor.java",
"identifier": "... | {
"body": "@Override\n public void intercept(RequestFacade requestFacade) {\n requestFacade.addHeader(HttpHeaders.AUTHORIZATION, basicAuth);\n requestFacade.addHeader(\"X-Requested-By\", \"Brooklyn Ambari\");\n requestFacade.addHeader(\"Content-Type\", \"text/plain\");\n }",
"class_method... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_9 | {
"fields": [
{
"declarator": "ambariCluster = new AmbariClusterImpl()",
"modifier": "private",
"original_string": "private AmbariClusterImpl ambariCluster = new AmbariClusterImpl();",
"type": "AmbariClusterImpl",
"var_name": "ambariCluster"
},
{
"declarator": "testMap"... | {
"body": "@Test\n public void testAddingNewRootMap() {\n Map<String, Map> rootMap = ambariCluster.mergeMaps(testMap, newRootMap);\n \n assertEquals(rootMap.get(\"oozie-site\").get(\"oozie.service.ProxyUserService.proxyuser.hue.hosts\"), \"*\");\n assertEquals(rootMap.get(\"hdfs-site\")... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(BasicStartableImpl.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(BasicStartableImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "L... | {
"body": "protected Map<String, Map> mergeMaps(Map<String, Map> configuration, Map<String, Map> servicesConfig) {\n if (servicesConfig == null) {\n return configuration;\n }\n\n MutableMap<String, Map> newConfigurationMap = MutableMap.copyOf(configuration);\n for (Map.Entry<Str... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_12 | {
"fields": [
{
"declarator": "function",
"modifier": "@Mock",
"original_string": "@Mock\n Function<String, ?> function;",
"type": "Function<String, ?>",
"var_name": "function"
},
{
"declarator": "listener = \"I'm a listener\"",
"modifier": "",
"original_... | {
"body": "@Test\n public void testRunCorrectly() {\n FunctionRunningCallable<String> functionRunningCallable = new FunctionRunningCallable<String>(listener, function);\n functionRunningCallable.run();\n\n verify(function).apply(listener);\n }",
"class_method_signature": "FunctionRunningC... | {
"fields": [
{
"declarator": "listener",
"modifier": "final",
"original_string": "final T listener;",
"type": "T",
"var_name": "listener"
},
{
"declarator": "function",
"modifier": "final",
"original_string": "final Function<T, ?> function;",
"type": ... | {
"body": "@Override\n public void run() {\n function.apply(listener);\n }",
"class_method_signature": "FunctionRunningCallable.run()",
"constructor": false,
"full_signature": "@Override public void run()",
"identifier": "run",
"invocations": [
"apply"
],
"modifiers": "@Override public"... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_13 | {
"fields": [
{
"declarator": "ambariServer = new AmbariServerImpl()",
"modifier": "private",
"original_string": "private AmbariServerImpl ambariServer = new AmbariServerImpl();",
"type": "AmbariServerImpl",
"var_name": "ambariServer"
},
{
"declarator": "JSON_CLUSTER_ST... | {
"body": "@Test(expectedExceptions = NullPointerException.class)\n public void testNullJsonThrows() {\n assertThat(ambariServer.getHosts().apply(null), sizeEquals(0));\n }",
"class_method_signature": "AmbariServerImplTest.testNullJsonThrows()",
"constructor": false,
"full_signature": "@Test(expect... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(AmbariServerImpl.class)",
"modifier": "public static final",
"original_string": "public static final Logger LOG = LoggerFactory.getLogger(AmbariServerImpl.class);",
"type": "Logger",
"var_name": "LOG"
},
{
"de... | {
"body": "Function<JsonElement, List<String>> getHosts() {\n Function<JsonElement, List<String>> path = new Function<JsonElement, List<String>>() {\n @Nullable\n @Override\n public List<String> apply(@Nullable JsonElement jsonElement) {\n try {\n ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_8 | {
"fields": [],
"file": "ambari/src/test/java/io/brooklyn/ambari/service/AbstractExtraServiceTest.java",
"identifier": "AbstractExtraServiceTest",
"interfaces": "",
"superclass": "extends BrooklynAppUnitTestSupport"
} | {
"body": "@Test\n public void getComponentMappingsGetHostIfExists() {\n final String defaultHost = \"my-default-host\";\n final String host = \"my-host\";\n final List<ExtraService.ComponentMapping> componentMappings = app.createAndManageChild(createDummyExtraServiceSpec(defaultHost, null, Im... | {
"fields": [
{
"declarator": "componentMappings",
"modifier": "private",
"original_string": "private List<ComponentMapping> componentMappings;",
"type": "List<ComponentMapping>",
"var_name": "componentMappings"
}
],
"file": "ambari/src/main/java/io/brooklyn/ambari/service/Ab... | {
"body": "@Override\n @Nonnull\n public List<ComponentMapping> getComponentMappings() {\n if (componentMappings == null) {\n componentMappings = MutableList.of();\n if (getConfig(COMPONENT_NAMES) != null) {\n for (String mapping : getConfig(COMPONENT_NAMES)) {\n ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_4 | {
"fields": [
{
"declarator": "ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\";",
"type": "String",
"var_name": "ERR... | {
"body": "@Test\n public void testSuccessfulRequestFinishes() {\n Throwable throwable = null;\n\n try {\n new RequestCheckRunnable.Builder(mockRequest(\"http://www.example.com\"))\n .client(mockHttpClient(\"{\\\"Requests\\\":{\\\"request_status\\\": \\\"COMPLETED\\\"}}\... | {
"fields": [
{
"declarator": "VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\")",
"modifier": "private static final",
"original_string": "private static final List<String> VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\");",
"type": "L... | {
"body": "@Override\n public void run() {\n boolean done = Repeater.create(String.format(\"Request %s status check\", builder.request.toString()))\n .every(Duration.ONE_SECOND)\n .until(new Callable<Boolean>() {\n @Override\n public Boolea... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_7 | {
"fields": [],
"file": "ambari/src/test/java/io/brooklyn/ambari/service/AbstractExtraServiceTest.java",
"identifier": "AbstractExtraServiceTest",
"interfaces": "",
"superclass": "extends BrooklynAppUnitTestSupport"
} | {
"body": "@Test\n public void getComponentMappingsGetDefaultHostIfNoHost() {\n final String defaultHost = \"my-default-host\";\n final List<ExtraService.ComponentMapping> componentMappings = app.createAndManageChild(createDummyExtraServiceSpec(defaultHost, null, ImmutableList.of(\"MY_COMPONENT\"))).... | {
"fields": [
{
"declarator": "componentMappings",
"modifier": "private",
"original_string": "private List<ComponentMapping> componentMappings;",
"type": "List<ComponentMapping>",
"var_name": "componentMappings"
}
],
"file": "ambari/src/main/java/io/brooklyn/ambari/service/Ab... | {
"body": "@Override\n @Nonnull\n public List<ComponentMapping> getComponentMappings() {\n if (componentMappings == null) {\n componentMappings = MutableList.of();\n if (getConfig(COMPONENT_NAMES) != null) {\n for (String mapping : getConfig(COMPONENT_NAMES)) {\n ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_10 | {
"fields": [
{
"declarator": "ambariCluster = new AmbariClusterImpl()",
"modifier": "private",
"original_string": "private AmbariClusterImpl ambariCluster = new AmbariClusterImpl();",
"type": "AmbariClusterImpl",
"var_name": "ambariCluster"
},
{
"declarator": "testMap"... | {
"body": "@Test\n public void testAddingNullNewMap() {\n Map<String, Map> tmpMap = ambariCluster.mergeMaps(origMap, null);\n \n assertEquals(tmpMap.get(\"oozie-site\").get(\"oozie.service.ProxyUserService.proxyuser.hue.hosts\"), \"*\");\n }",
"class_method_signature": "AmbariClusterImplT... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(BasicStartableImpl.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(BasicStartableImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "L... | {
"body": "protected Map<String, Map> mergeMaps(Map<String, Map> configuration, Map<String, Map> servicesConfig) {\n if (servicesConfig == null) {\n return configuration;\n }\n\n MutableMap<String, Map> newConfigurationMap = MutableMap.copyOf(configuration);\n for (Map.Entry<Str... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_11 | {
"fields": [
{
"declarator": "ambariCluster = new AmbariClusterImpl()",
"modifier": "private",
"original_string": "private AmbariClusterImpl ambariCluster = new AmbariClusterImpl();",
"type": "AmbariClusterImpl",
"var_name": "ambariCluster"
},
{
"declarator": "testMap"... | {
"body": "@Test\n public void testAddingNullOrigMap() {\n Map<String, Map> tmpMap = ambariCluster.mergeMaps(null, newMap);\n \n assertEquals(tmpMap.get(\"oozie-site\").get(\"oozie.service.ProxyUserService.proxyuser.hue.hosts\"), \"localhost\");\n }",
"class_method_signature": "AmbariClus... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(BasicStartableImpl.class)",
"modifier": "private static final",
"original_string": "private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(BasicStartableImpl.class);",
"type": "org.slf4j.Logger",
"var_name": "L... | {
"body": "protected Map<String, Map> mergeMaps(Map<String, Map> configuration, Map<String, Map> servicesConfig) {\n if (servicesConfig == null) {\n return configuration;\n }\n\n MutableMap<String, Map> newConfigurationMap = MutableMap.copyOf(configuration);\n for (Map.Entry<Str... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_6 | {
"fields": [],
"file": "ambari/src/test/java/io/brooklyn/ambari/service/AbstractExtraServiceTest.java",
"identifier": "AbstractExtraServiceTest",
"interfaces": "",
"superclass": "extends BrooklynAppUnitTestSupport"
} | {
"body": "@Test\n public void getComponentMappingsThrowExIfNoHost() {\n try {\n app.createAndManageChild(createDummyExtraServiceSpec(null, null, ImmutableList.of(\"MY_COMPONENT\"))).getComponentMappings();\n fail();\n } catch (Throwable throwable) {\n Throwable rootC... | {
"fields": [
{
"declarator": "componentMappings",
"modifier": "private",
"original_string": "private List<ComponentMapping> componentMappings;",
"type": "List<ComponentMapping>",
"var_name": "componentMappings"
}
],
"file": "ambari/src/main/java/io/brooklyn/ambari/service/Ab... | {
"body": "@Override\n @Nonnull\n public List<ComponentMapping> getComponentMappings() {\n if (componentMappings == null) {\n componentMappings = MutableList.of();\n if (getConfig(COMPONENT_NAMES) != null) {\n for (String mapping : getConfig(COMPONENT_NAMES)) {\n ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_16 | {
"fields": [],
"file": "ambari/src/test/java/io/brooklyn/ambari/EtcHostsManagerTest.java",
"identifier": "EtcHostsManagerTest",
"interfaces": "",
"superclass": "extends BrooklynAppUnitTestSupport"
} | {
"body": "@Test\n public void testSetHostsOnMachinesDoesNothingIPIsNull() {\n TestApplication app = TestApplication.Factory.newManagedInstanceForTests();\n SshMachineLocation location = mock(SshMachineLocation.class);\n TagSupport tagSupport = mock(TestTagSupport.class);\n when(locatio... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcHostsManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcHostsManager.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "... | {
"body": "public static void setHostsOnMachines(Iterable<? extends Entity> machines) {\n setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS);\n }",
"class_method_signature": "EtcHostsManager.setHostsOnMachines(Iterable<? extends Entity> machines)",
"constructor": false,
"full_signature": "public ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_1 | {
"fields": [
{
"declarator": "ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\";",
"type": "String",
"var_name": "ERR... | {
"body": "@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = \"Request fails with state FAILED. Check here for details http://www.example.com\")\n public void testFailedRequestThrowsRuntimeEx() throws IOException {\n new RequestCheckRunnable.Builder(mockRequest(\"http://ww... | {
"fields": [
{
"declarator": "VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\")",
"modifier": "private static final",
"original_string": "private static final List<String> VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\");",
"type": "L... | {
"body": "@Override\n public void run() {\n boolean done = Repeater.create(String.format(\"Request %s status check\", builder.request.toString()))\n .every(Duration.ONE_SECOND)\n .until(new Callable<Boolean>() {\n @Override\n public Boolea... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_0 | {
"fields": [
{
"declarator": "ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\"",
"modifier": "private static final",
"original_string": "private static final String ERROR_MESSAGE = \"Something went wrong, please check Ambari UI\";",
"type": "String",
"var_name": "ERR... | {
"body": "@Test(expectedExceptions = PropagatedRuntimeException.class)\n public void testRunnablePropagatesEx() throws IOException {\n HttpClient httpClient = mock(HttpClient.class);\n when(httpClient.execute(any(HttpGet.class))).thenThrow(MyCustomException.class);\n\n new RequestCheckRunnabl... | {
"fields": [
{
"declarator": "VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\")",
"modifier": "private static final",
"original_string": "private static final List<String> VALID_STATES = ImmutableList.of(\"IN_PROGRESS\", \"COMPLETED\", \"PENDING\");",
"type": "L... | {
"body": "@Override\n public void run() {\n boolean done = Repeater.create(String.format(\"Request %s status check\", builder.request.toString()))\n .every(Duration.ONE_SECOND)\n .until(new Callable<Boolean>() {\n @Override\n public Boolea... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
29964541_17 | {
"fields": [],
"file": "ambari/src/test/java/io/brooklyn/ambari/EtcHostsManagerTest.java",
"identifier": "EtcHostsManagerTest",
"interfaces": "",
"superclass": "extends BrooklynAppUnitTestSupport"
} | {
"body": "@Test\n public void testSetHostsOnMachinesExecuteCorrectCommands() {\n TestApplication app = TestApplication.Factory.newManagedInstanceForTests();\n SshMachineLocation location1 = mock(SshMachineLocation.class);\n SshMachineLocation location2 = mock(SshMachineLocation.class);\n ... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(EtcHostsManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(EtcHostsManager.class);",
"type": "Logger",
"var_name": "LOG"
}
],
"file": "... | {
"body": "public static void setHostsOnMachines(Iterable<? extends Entity> machines) {\n setHostsOnMachines(machines, Attributes.SUBNET_ADDRESS);\n }",
"class_method_signature": "EtcHostsManager.setHostsOnMachines(Iterable<? extends Entity> machines)",
"constructor": false,
"full_signature": "public ... | {
"created": null,
"fork": null,
"fork_count": 15,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 29964541,
"size": 597,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/brooklyncentral/brooklyn-ambari"
} |
6500041_64 | {
"fields": [
{
"declarator": "context",
"modifier": "",
"original_string": "Mapper.Context context;",
"type": "Mapper.Context",
"var_name": "context"
},
{
"declarator": "mapper",
"modifier": "",
"original_string": "EntityCentricMapper mapper;",
"type"... | {
"body": "@Test\n public void extractSubjectAsKey() throws IOException, InterruptedException {\n final Text value = new Text(\"<http://example.com/A> <http://example.com/B> <http://example.com/C>\");\n mapper.map(new LongWritable(1), value,context);\n verify(context).write(new Text(\"<http://... | {
"fields": [
{
"declarator": "codec=new PrimitiveTripleCodec()",
"modifier": "static final",
"original_string": "static final PrimitiveTripleCodec codec=new PrimitiveTripleCodec();",
"type": "PrimitiveTripleCodec",
"var_name": "codec"
}
],
"file": "bakemono/src/main/java/com... | {
"body": "@Override\n protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {\n PrimitiveTriple t=codec.decode(value.toString());\n context.write(new Text(t.getSubject()),value);\n }",
"class_method_signature": "EntityCentricMapper.map(LongWr... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_33 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "SetDifferenceReducer<Text> that;",
"type": "SetDifferenceReducer<Text>",
"var_name": "that"
},
{
"declarator": "context",
"modifier": "",
"original_string": "Reducer.Context context;",... | {
"body": "@Test\n public void justTwo() throws IOException, InterruptedException {\n that.reduce(\n new TaggedTextItem(\n new Text(\"Canada Goose\")\n ,new VIntWritable(5)\n )\n ,new ArrayList<VIntWritable>() {{\n ... | {
"fields": [],
"file": "bakemono/src/main/java/com/ontology2/bakemono/joins/SetDifferenceReducer.java",
"identifier": "SetDifferenceReducer",
"interfaces": "",
"methods": [
{
"class_method_signature": "SetDifferenceReducer.reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context conte... | {
"body": "@Override\n protected void reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context context) throws IOException, InterruptedException {\n Set<Integer> that= Sets.newHashSet();\n for(VIntWritable tag:values)\n that.add(tag.get());\n\n if(that.contains(1) & !t... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_25 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void weReverseRedirects() throws IOException, InterruptedException {\n String ordinaryTriple = \"ns:A\\tns:dataworld.gardening_hint.replaced_by\\tns:B.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n verify(context).getCounter(FreebasePrefi... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_48 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void beanName() {\n assertEquals(\"wildIsTheWind\",that.getName());\n }",
"class_method_signature": "TestSelfAwareTool.beanName()",
"constructor": false,
"full_signature": "@Test public void beanName()",
"identifier": "beanName",
"invocations": [
"assertEquals",
... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n protected String getName() {\n return beanName;\n }",
"class_method_signature": "SelfAwareTool.getName()",
"constructor": false,
"full_signature": "@Override protected String getName()",
"identifier": "getName",
"invocations": [],
"modifiers": "@Override protected",
"... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_29 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "AcceptWithMatchingKeyReducer<Text,Text> that;",
"type": "AcceptWithMatchingKeyReducer<Text,Text>",
"var_name": "that"
},
{
"declarator": "context",
"modifier": "",
"original_string": "... | {
"body": "@Test\n public void rejectsIfNoMatch() throws IOException, InterruptedException {\n TaggedTextItem key=new TaggedTextItem(\n new Text(\"xanadu\")\n ,2);\n\n Iterable<TaggedItem<Text>> stream=new ArrayList<TaggedItem<Text>>() {{\n add(new TaggedTextI... | {
"fields": [
{
"declarator": "ONE = new VIntWritable(1)",
"modifier": "final static",
"original_string": "final static VIntWritable ONE = new VIntWritable(1);",
"type": "VIntWritable",
"var_name": "ONE"
},
{
"declarator": "TWO = new VIntWritable(2)",
"modifier": ... | {
"body": "@Override\n protected void reduce(TaggedItem<K> key, Iterable<TaggedItem<V>> values, Context context) throws IOException, InterruptedException {\n PeekingIterator<TaggedItem<V>> pi = Iterators.peekingIterator(values.iterator());\n boolean foundObject = false;\n\n while (pi.hasNext()... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_0 | {
"fields": [
{
"declarator": "codec",
"modifier": "private",
"original_string": "private PrimitiveTripleCodec codec;",
"type": "PrimitiveTripleCodec",
"var_name": "codec"
},
{
"declarator": "X=\"<http://example.com/X>\"",
"modifier": "final static",
"origin... | {
"body": "@Test\n public void parsesALinkTriple() {\n String in=X+\" \"+Y+\"\\t\"+Z+\".\";\n PrimitiveTriple out=codec.decode(in);\n assertEquals(X,out.getSubject());\n assertEquals(Y,out.getPredicate());\n assertEquals(Z,out.getObject());\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3)",
"modifier": "final",
"original_string": "final Splitter tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3);",
"type": "Splitter",
"var_name": "t... | {
"body": "@Override\n public PrimitiveTriple decode(String obj) {\n Iterator<String> parts=tripleSplitter.split(obj).iterator();\n String subject = parts.next();\n String predicate = parts.next();\n String object = trimObject(parts.next());\n return new PrimitiveTriple(subject,p... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_52 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void outputValueClass() {\n assertEquals(DoubleWritable.class,that.getOutputValueClass());\n }",
"class_method_signature": "TestSelfAwareTool.outputValueClass()",
"constructor": false,
"full_signature": "@Test public void outputValueClass()",
"identifier": "outputValueCl... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n public Class<? extends Writable> getOutputValueClass() {\n Class mapperClass=getReducerClass();\n Type[] parameters= TypeDetective.sniffTypeParameters(getReducerClass(), Reducer.class);\n return toWritableClass(parameters[3]);\n }",
"class_method_signature": "SelfAw... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_44 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void acceptsAGoodDateTime() throws IOException, InterruptedException {\n pse3mapper.map(\n new LongWritable(24562L),\n new Text(\"<http://example.com/A>\\t<http://example.com/B>\\t\\\"2001-06-01T13:11:12Z\\\"^^<http://www.w3.org/2001/XMLSchema#dateTime... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_13 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void testRecentFreebaseDumpFormat() throws Exception {\n List<String> parts = mapper\n .expandTripleParts(\"<http://rdf.freebase.com/ns/automotive.engine.engine_type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#P... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "List<String> expandTripleParts(String line) throws InvalidNodeException {\n List<String> parts=splitTriple(line);\n\n parts.set(0,rewriteNode(expandIRINode(parts.get(0))));\n parts.set(1,rewriteNode(expandIRINode(parts.get(1))));\n parts.set(2,rewriteNode(expandAnyNode(parts.get... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_12 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void testExpandTripleParts() throws Exception {\n List<String> parts = mapper\n .expandTripleParts(\"ns:aviation.aircraft.first_flight\\tns:type.property.unique\\ttrue.\");\n assertEquals(3, parts.size());\n assertEquals(\n \"<http://rdf.... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "List<String> expandTripleParts(String line) throws InvalidNodeException {\n List<String> parts=splitTriple(line);\n\n parts.set(0,rewriteNode(expandIRINode(parts.get(0))));\n parts.set(1,rewriteNode(expandIRINode(parts.get(1))));\n parts.set(2,rewriteNode(expandAnyNode(parts.get... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_45 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void optionType() {\n assertEquals(TestOptions.class, that.getOptionsClass());\n }",
"class_method_signature": "TestSelfAwareTool.optionType()",
"constructor": false,
"full_signature": "@Test public void optionType()",
"identifier": "optionType",
"invocations": [
"... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n public Class getOptionsClass() {\n return (Class) (TypeDetective.sniffTypeParameters(getClass(), SelfAwareTool.class))[0];\n }",
"class_method_signature": "SelfAwareTool.getOptionsClass()",
"constructor": false,
"full_signature": "@Override public Class getOptionsClass()",
... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_53 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void inputs() {\n Iterator<Path> inputs=that.getInputPaths().iterator();\n assertEquals(new Path(\"/are\"), inputs.next());\n assertEquals(new Path(\"/friends\"),inputs.next());\n assertEquals(new Path(\"/electric\"),inputs.next());\n assertFalse(inputs.... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n public Iterable<Path> getInputPaths() {\n Map<Field,Integer> declaredInputPaths=searchForInputPaths(getOptionsClass());\n if(declaredInputPaths.size()>1) {\n List<Path> allPaths=newArrayList();\n tagMap=HashMultimap.create();\n for(Map.Entry<Fie... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_1 | {
"fields": [
{
"declarator": "codec",
"modifier": "private",
"original_string": "private PrimitiveTripleCodec codec;",
"type": "PrimitiveTripleCodec",
"var_name": "codec"
},
{
"declarator": "X=\"<http://example.com/X>\"",
"modifier": "final static",
"origin... | {
"body": "@Test\n public void parsesASingleSpaceTriple() {\n String in=X+\" \"+Y+\" \"+Z+\" .\";\n PrimitiveTriple out=codec.decode(in);\n assertEquals(X,out.getSubject());\n assertEquals(Y,out.getPredicate());\n assertEquals(Z,out.getObject());\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3)",
"modifier": "final",
"original_string": "final Splitter tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3);",
"type": "Splitter",
"var_name": "t... | {
"body": "@Override\n public PrimitiveTriple decode(String obj) {\n Iterator<String> parts=tripleSplitter.split(obj).iterator();\n String subject = parts.next();\n String predicate = parts.next();\n String object = trimObject(parts.next());\n return new PrimitiveTriple(subject,p... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_28 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void arnoldSchwarzeneggerIsAFilmActor() throws IOException, InterruptedException {\n String extraordinaryTriple = \"<http://rdf.freebase.com/ns/m.0tc7> <http://rdf.freebase.com/ns/type.object.type> <http://rdf.freebase.com/ns/film.actor> .\";\n mapper.map(new LongWritable(19... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_49 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void mapOutputKeyClass() {\n assertEquals(FloatWritable.class,that.getMapOutputKeyClass());\n }",
"class_method_signature": "TestSelfAwareTool.mapOutputKeyClass()",
"constructor": false,
"full_signature": "@Test public void mapOutputKeyClass()",
"identifier": "mapOutputK... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n public Class<? extends Writable> getMapOutputKeyClass() {\n Type[] parameters= TypeDetective.sniffTypeParameters(getMapperClass(), Mapper.class);\n return toWritableClass(parameters[2]);\n }",
"class_method_signature": "SelfAwareTool.getMapOutputKeyClass()",
"constructor... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_24 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void usuallyTypeObjectTypeRewritesToA() throws IOException,\n InterruptedException {\n String ordinaryTriple = \"ns:aviation.aircraft.first_flight\\tns:type.object.type\\tns:whatever.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n verif... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_32 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "SetDifferenceReducer<Text> that;",
"type": "SetDifferenceReducer<Text>",
"var_name": "that"
},
{
"declarator": "context",
"modifier": "",
"original_string": "Reducer.Context context;",... | {
"body": "@Test\n public void justOne() throws IOException, InterruptedException {\n that.reduce(\n new TaggedTextItem(\n new Text(\"Canada Goose\")\n ,new VIntWritable(5)\n )\n ,new ArrayList<VIntWritable>() {{\n add(new... | {
"fields": [],
"file": "bakemono/src/main/java/com/ontology2/bakemono/joins/SetDifferenceReducer.java",
"identifier": "SetDifferenceReducer",
"interfaces": "",
"methods": [
{
"class_method_signature": "SetDifferenceReducer.reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context conte... | {
"body": "@Override\n protected void reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context context) throws IOException, InterruptedException {\n Set<Integer> that= Sets.newHashSet();\n for(VIntWritable tag:values)\n that.add(tag.get());\n\n if(that.contains(1) & !t... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_65 | {
"fields": [
{
"declarator": "extractIsATool",
"modifier": "@Resource",
"original_string": "@Resource\n ExtractIsATool extractIsATool;",
"type": "ExtractIsATool",
"var_name": "extractIsATool"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/entityCentric/Extrac... | {
"body": "@Test\n public void parsesArgumentsCorrectly() throws IllegalAccessException {\n List<String> arguments= Lists.newArrayList(\n \"-dir\",\n \"s3n://basekb-now/2013-12-08-00-00/sieved\",\n \"-input\",\n \"a/a-m-00000.nt.gz\",\n \"-prefix\",\n ... | {
"fields": [],
"file": "bakemono/src/main/java/com/ontology2/bakemono/entityCentric/ExtractIsATool.java",
"identifier": "ExtractIsATool",
"interfaces": "",
"methods": [
{
"class_method_signature": "ExtractIsATool.run(String[] strings)",
"constructor": false,
"full_signature": "@Override... | {
"body": "ExtractIsAOptions extractOptions(List<String> strings) throws IllegalAccessException {\n OptionParser parser=new OptionParser(ExtractIsAOptions.class);\n applicationContext.getAutowireCapableBeanFactory().autowireBean(parser);\n\n ExtractIsAOptions options=(ExtractIsAOptions) parser.pa... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_39 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void rejects$Escapes() throws IOException,InterruptedException {\n pse3mapper.map(\n new LongWritable(944L),\n new Text(\"<http://rdf.basekb.com/ns/m.0tc7> <http://rdf.basekb.com/ns/common.topic.topic_equivalent_webpage> <http://www.ranker.com/review/a... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_6 | {
"fields": [
{
"declarator": "rewriter",
"modifier": "private",
"original_string": "private Function<PrimitiveTriple,PrimitiveTriple> rewriter;",
"type": "Function<PrimitiveTriple,PrimitiveTriple>",
"var_name": "rewriter"
}
],
"file": "bakemono/src/test/java/com/ontology2/ba... | {
"body": "@Test\n public void ordinaryTriplesPassThrough() {\n PrimitiveTriple p1=new PrimitiveTriple(\"<http://example.com/ats>\",\"<http://example.com/unlocksWithNumber>\",\"\\\"true\\\"^^xsd:boolean\");\n PrimitiveTriple p2=rewriter.apply(p1);\n assertEquals(p1,p2);\n }",
"class_method_s... | {
"fields": [
{
"declarator": "oldTemplate",
"modifier": "private final",
"original_string": "private final String oldTemplate;",
"type": "String",
"var_name": "oldTemplate"
},
{
"declarator": "newType",
"modifier": "private final",
"original_string": "priva... | {
"body": "@Override\n public PrimitiveTriple apply(PrimitiveTriple input) {\n String object=input.getObject();\n \n if(!object.endsWith(oldTemplate))\n return input;\n \n String newObject=object.substring(0,object.length()-oldTemplate.length()+2)+newType;\n ret... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_54 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void output() {\n assertEquals(new Path(\"/horseheads\"),that.getOutputPath());\n }",
"class_method_signature": "TestSelfAwareTool.output()",
"constructor": false,
"full_signature": "@Test public void output()",
"identifier": "output",
"invocations": [
"assertEqual... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n protected Path getOutputPath() {\n String s=readField(options,\"output\");\n if(s==null)\n return null;\n return STRING2PATH.apply(s);\n }",
"class_method_signature": "SelfAwareTool.getOutputPath()",
"constructor": false,
"full_signature": "@Override ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_42 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void rejectsABadDate() throws IOException, InterruptedException {\n pse3mapper.map(\n new LongWritable(24562L),\n new Text(\"<http://example.com/A>\\t<http://example.com/B>\\t\\\"2001-06\\\"^^<http://www.w3.org/2001/XMLSchema#dateTime>.\"),\n ... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_15 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void testExpandAnyNode() throws Exception {\n assertEquals(\"<http://www.w3.org/2000/01/rdf-schema#label>\",\n mapper.expandAnyNode(\"rdfs:label\"));\n assertEquals(\"<http://rdf.freebase.com/ns/type.object.type>\",\n mapper.expandAnyNode(\"ns:t... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "public String expandAnyNode(String string) {\n List<String> parts=Lists.newArrayList(iriSplitter.split(string));\n \n if (string.startsWith(\"<\") && string.endsWith(\">\")) {\n return string;\n }\n if (prefixMap.containsKey(parts.get(0))) {\n return... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_62 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/jena/TestWritableTriple.java",
"identifier": "TestWritableTriple",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void canRoundtripALinkTriple() throws IOException {\n Node s=Node.createURI(\"http://example.com/A1\");\n Node p=Node.createURI(\"http://example.com/B2\");\n Node o=Node.createURI(\"http://example.com/C3\");\n \n Triple source=new Triple(s,p,o);\n ... | {
"fields": [
{
"declarator": "innerTriple",
"modifier": "private",
"original_string": "private Triple innerTriple;",
"type": "Triple",
"var_name": "innerTriple"
},
{
"declarator": "tc=new RawTripleComparator()",
"modifier": "private static final",
"original... | {
"body": "public Triple getTriple() {\n return innerTriple;\n }",
"class_method_signature": "WritableTriple.getTriple()",
"constructor": false,
"full_signature": "public Triple getTriple()",
"identifier": "getTriple",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_35 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void acceptsAGoodTriple() throws IOException, InterruptedException {\n pse3mapper.map(\n new LongWritable(944L),\n new Text(\"<http://example.com/A>\\t<http://example.com/B>\\t<http://example.com/C>.\"),\n mockContext);\n\n verify... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_23 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void ignoreNotableForDisplayNames() throws IOException,\n InterruptedException {\n String ordinaryTriple = \"ns:rock.me.amadeus\\tns:common.notable_for.display_name\\t\\\"Musikale Tracke\\\"@en\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n ... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_58 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/jena/TestWritableNode.java",
"identifier": "TestWritableNode",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serializeAndDeserializeInteger() throws IOException {\n Node n1= NodeFactory.createLiteral(\"77641\",XSDDatatype.XSDinteger);\n assertEquals(XSDDatatype.XSDinteger,n1.getLiteralDatatype());\n WritableNode wn1=new WritableNode(n1);\n WritableNode wn2=new Wr... | {
"fields": [
{
"declarator": "innerNode",
"modifier": "",
"original_string": "Node innerNode;",
"type": "Node",
"var_name": "innerNode"
},
{
"declarator": "URI=0",
"modifier": "final static",
"original_string": "final static int URI=0;",
"type": "int"... | {
"body": "public Node getNode() {\n return innerNode;\n }",
"class_method_signature": "WritableNode.getNode()",
"constructor": false,
"full_signature": "public Node getNode()",
"identifier": "getNode",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Node",
"signat... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_19 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void rejectsMostATriples() throws IOException, InterruptedException {\n String ordinaryTriple = \"ns:aviation.aircraft.first_flight\\trdf:type\\tns:anythingInsideFreebase.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n verify(context).getC... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_18 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void acceptsOrdinaryTriples() throws IOException,\n InterruptedException {\n String ordinaryTriple = \"ns:aviation.aircraft.first_flight\\tns:type.property.unique\\ttrue.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n verify(context).ge... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_59 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/jena/TestWritableNode.java",
"identifier": "TestWritableNode",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serializeAndDeserializeStringWithLanguage() throws IOException {\n Node n1=Node.createLiteral(\"kore wa okane desu\", \"jp\", false);\n\n WritableNode wn1=new WritableNode(n1);\n WritableNode wn2=new WritableNode(null);\n\n roundtrip(wn1, wn2);\n as... | {
"fields": [
{
"declarator": "innerNode",
"modifier": "",
"original_string": "Node innerNode;",
"type": "Node",
"var_name": "innerNode"
},
{
"declarator": "URI=0",
"modifier": "final static",
"original_string": "final static int URI=0;",
"type": "int"... | {
"body": "public Node getNode() {\n return innerNode;\n }",
"class_method_signature": "WritableNode.getNode()",
"constructor": false,
"full_signature": "public Node getNode()",
"identifier": "getNode",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Node",
"signat... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_22 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void ignoreTypeTypeExpectedBy() throws IOException,\n InterruptedException {\n String ordinaryTriple = \"ns:aviation.aircraft.first_flight\\tns:type.type.expected_by\\towl:Thing.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n verify(con... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_34 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "SetDifferenceReducer<Text> that;",
"type": "SetDifferenceReducer<Text>",
"var_name": "that"
},
{
"declarator": "context",
"modifier": "",
"original_string": "Reducer.Context context;",... | {
"body": "@Test\n public void oneAndTwo() throws IOException, InterruptedException {\n that.reduce(\n new TaggedTextItem(\n new Text(\"Canada Goose\")\n ,new VIntWritable(5)\n )\n ,new ArrayList<VIntWritable>() {{\n ... | {
"fields": [],
"file": "bakemono/src/main/java/com/ontology2/bakemono/joins/SetDifferenceReducer.java",
"identifier": "SetDifferenceReducer",
"interfaces": "",
"methods": [
{
"class_method_signature": "SetDifferenceReducer.reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context conte... | {
"body": "@Override\n protected void reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context context) throws IOException, InterruptedException {\n Set<Integer> that= Sets.newHashSet();\n for(VIntWritable tag:values)\n that.add(tag.get());\n\n if(that.contains(1) & !t... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_63 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/jena/TestWritableTriple.java",
"identifier": "TestWritableTriple",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void twoTriplesWithTheSamePOAreNotEqual() {\n WritableTriple croatianKey=new WritableTriple(new Triple(\n Node_URI.createURI(\"http://rdf.basekb.com/ns/m.0tc7\")\n ,Node_URI.createURI(\"http://rdf.basekb.com/ns/type.object.key\")\n ,Node... | {
"fields": [
{
"declarator": "innerTriple",
"modifier": "private",
"original_string": "private Triple innerTriple;",
"type": "Triple",
"var_name": "innerTriple"
},
{
"declarator": "tc=new RawTripleComparator()",
"modifier": "private static final",
"original... | {
"body": "@Override\n public int compareTo(Object that) {\n return tc.compare(this, ((WritableTriple) that));\n }",
"class_method_signature": "WritableTriple.compareTo(Object that)",
"constructor": false,
"full_signature": "@Override public int compareTo(Object that)",
"identifier": "compareTo",... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_14 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void testExpandNode() throws Exception {\n assertEquals(\"<http://www.w3.org/2000/01/rdf-schema#label>\",\n mapper.expandIRINode(\"rdfs:label\"));\n assertEquals(\"<http://rdf.freebase.com/ns/type.object.type>\",\n mapper.expandIRINode(\"ns:type... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "public String expandIRINode(String string) throws InvalidNodeException {\n List<String> parts=Lists.newArrayList(iriSplitter.split(string));\n \n if (string.startsWith(\"<\") && string.endsWith(\">\")) {\n return string;\n }\n \n if (prefixMap.containsKe... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_43 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void rejectsOversizedStrings() throws IOException, InterruptedException {\n pse3mapper.map(\n new LongWritable(24562L),\n new Text(\"<http://example.com/A>\\t<http://example.com/B>\\t\\\"\"+ repeat(\"x\", 70000)+\"\\\"@en.\"),\n mockCont... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_55 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void reduceTasks() {\n assertEquals(33,that.getNumReduceTasks());\n }",
"class_method_signature": "TestSelfAwareTool.reduceTasks()",
"constructor": false,
"full_signature": "@Test public void reduceTasks()",
"identifier": "reduceTasks",
"invocations": [
"assertEqua... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n public int getNumReduceTasks() {\n Integer numReduceTasks=readField(options,\"reducerCount\");\n return numReduceTasks==null ? 0 : numReduceTasks;\n }",
"class_method_signature": "SelfAwareTool.getNumReduceTasks()",
"constructor": false,
"full_signature": "@Override pu... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_7 | {
"fields": [
{
"declarator": "rewriter",
"modifier": "private",
"original_string": "private Function<PrimitiveTriple,PrimitiveTriple> rewriter;",
"type": "Function<PrimitiveTriple,PrimitiveTriple>",
"var_name": "rewriter"
}
],
"file": "bakemono/src/test/java/com/ontology2/ba... | {
"body": "@Test\n public void datetimeIsRewritten() {\n PrimitiveTriple p1=new PrimitiveTriple(\"<http://example.com/ats>\",\"<http://example.com/oxygenSensorBurnedOutOn>\",\"\\\"true\\\"^^xsd:datetime\");\n PrimitiveTriple p2=rewriter.apply(p1);\n assertNotEquals(p1,p2);\n }",
"class_metho... | {
"fields": [
{
"declarator": "oldTemplate",
"modifier": "private final",
"original_string": "private final String oldTemplate;",
"type": "String",
"var_name": "oldTemplate"
},
{
"declarator": "newType",
"modifier": "private final",
"original_string": "priva... | {
"body": "@Override\n public PrimitiveTriple apply(PrimitiveTriple input) {\n String object=input.getObject();\n \n if(!object.endsWith(oldTemplate))\n return input;\n \n String newObject=object.substring(0,object.length()-oldTemplate.length()+2)+newType;\n ret... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_38 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void acceptsARealFreebaseTripleWithSpaces() throws IOException,InterruptedException {\n pse3mapper.map(\n new LongWritable(944L),\n new Text(\"<http://rdf.basekb.com/ns/m.06fm3lj> <http://rdf.basekb.com/ns/book.written_work.author> <http://rdf.basekb.c... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_17 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void ignoresPrefixDeclarations() throws IOException,\n InterruptedException {\n mapper.map(new LongWritable(1L), new Text(\n \"@prefix foo: <http://bar.com/>.\"), context);\n verify(context).getCounter(FreebasePrefilterCounter.PREFIX_DECL);\n verifyN... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_40 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void closesMosOnShutdown() throws IOException, InterruptedException {\n pse3mapper.cleanup(mock(Context.class));\n }",
"class_method_signature": "TestPSE3Mapper.closesMosOnShutdown()",
"constructor": false,
"full_signature": "@Test public void closesMosOnShutdown()",
"id... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)\n throws IOException, InterruptedException {\n super.cleanup(context);\n }",
"class_method_signature": "PSE3Mapper.cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)",
"constructor": ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_56 | {
"fields": [
{
"declarator": "that",
"modifier": "",
"original_string": "TestTool that;",
"type": "TestTool",
"var_name": "that"
}
],
"file": "bakemono/src/test/java/com/ontology2/bakemono/mapreduce/TestSelfAwareTool.java",
"identifier": "TestSelfAwareTool",
"interfaces"... | {
"body": "@Test\n public void inputFormat() {\n assertEquals(TextInputFormat.class,that.getInputFormatClass());\n }",
"class_method_signature": "TestSelfAwareTool.inputFormat()",
"constructor": false,
"full_signature": "@Test public void inputFormat()",
"identifier": "inputFormat",
"invocation... | {
"fields": [
{
"declarator": "LOG= LogFactory.getLog(SelfAwareTool.class)",
"modifier": "",
"original_string": "Log LOG= LogFactory.getLog(SelfAwareTool.class);",
"type": "Log",
"var_name": "LOG"
},
{
"declarator": "beanName",
"modifier": "",
"original_stri... | {
"body": "@Override\n public Class<? extends InputFormat> getInputFormatClass() {\n Class inKey=getMapInputKeyClass();\n Class inValue=getMapInputValueClass();\n if ( inValue==Text.class) {\n if(inKey==LongWritable.class) {\n return TextInputFormat.class;\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_4 | {
"fields": [
{
"declarator": "codec",
"modifier": "private",
"original_string": "private PrimitiveTripleCodec codec;",
"type": "PrimitiveTripleCodec",
"var_name": "codec"
},
{
"declarator": "X=\"<http://example.com/X>\"",
"modifier": "final static",
"origin... | {
"body": "@Test\n public void parsesALiteralTripleWithNoSpaceBeforeTerminalPeriod() {\n String in=X+\"\\t\"+Y+\"\\t \"+L1+\".\";\n PrimitiveTriple out=codec.decode(in);\n assertEquals(X,out.getSubject());\n assertEquals(Y,out.getPredicate());\n assertEquals(L1,out.getObject());\... | {
"fields": [
{
"declarator": "tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3)",
"modifier": "final",
"original_string": "final Splitter tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3);",
"type": "Splitter",
"var_name": "t... | {
"body": "@Override\n public PrimitiveTriple decode(String obj) {\n Iterator<String> parts=tripleSplitter.split(obj).iterator();\n String subject = parts.next();\n String predicate = parts.next();\n String object = trimObject(parts.next());\n return new PrimitiveTriple(subject,p... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_8 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/configuration/TestBeans.java",
"identifier": "TestBeans",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void linkTriplesAreAcceptedAsSuchByFunction() {\n PrimitiveTriple pt=new PrimitiveTriple(\n \"<http://example.com/A>\",\n \"<http://example.com/B>\",\n \"<http://example.com/C>\"\n );\n \n assertTrue(Beans.is... | {
"fields": [],
"file": "bakemono/src/main/java/com/ontology2/bakemono/configuration/Beans.java",
"identifier": "Beans",
"interfaces": "",
"methods": [
{
"class_method_signature": "Beans.matchesPredicate(final String that)",
"constructor": false,
"full_signature": "private static Predica... | {
"body": "static Predicate<PrimitiveTriple> isLinkRelationship() {\n return new Predicate<PrimitiveTriple>() {\n @Override public boolean apply(PrimitiveTriple input) {\n return input.getObject().startsWith(\"<\") && input.getObject().endsWith(\">\");\n }\n };\n}",
"class_method_signature": "B... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_21 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void rejectTypeTypeInstanceOutsideFreebase() throws IOException,\n InterruptedException {\n String ordinaryTriple = \"ns:aviation.aircraft.first_flight\\tns:type.type.instance\\towl:Thing.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n ... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_37 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void arnoldSchwarzeneggerIsAFilmActor() throws IOException, InterruptedException {\n pse3mapper.map(\n new LongWritable(944L),\n new Text(\"<http://rdf.basekb.com/ns/m.0tc7> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>\\t<http://rdf.basekb.com/ns/... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_60 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/jena/TestWritableNode.java",
"identifier": "TestWritableNode",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serializeAndDeserializeStringWithoutLanguage() throws IOException {\n Node n1=Node.createLiteral(\"jjshsbn7\");\n WritableNode wn1=new WritableNode(n1);\n WritableNode wn2=new WritableNode(null);\n\n roundtrip(wn1, wn2);\n assertEquals(\"jjshsbn7\",... | {
"fields": [
{
"declarator": "innerNode",
"modifier": "",
"original_string": "Node innerNode;",
"type": "Node",
"var_name": "innerNode"
},
{
"declarator": "URI=0",
"modifier": "final static",
"original_string": "final static int URI=0;",
"type": "int"... | {
"body": "public Node getNode() {\n return innerNode;\n }",
"class_method_signature": "WritableNode.getNode()",
"constructor": false,
"full_signature": "public Node getNode()",
"identifier": "getNode",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Node",
"signat... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_61 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/jena/TestWritableNode.java",
"identifier": "TestWritableNode",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serializeAndDeserialize100_000CharString() throws IOException {\n String bigString= repeat(\"TEN DIGITS\", 10000);\n assertEquals((int) Math.pow(10,5),bigString.length());\n Node n1=Node.createLiteral(bigString);\n WritableNode wn1=new WritableNode(n1);\n ... | {
"fields": [
{
"declarator": "innerNode",
"modifier": "",
"original_string": "Node innerNode;",
"type": "Node",
"var_name": "innerNode"
},
{
"declarator": "URI=0",
"modifier": "final static",
"original_string": "final static int URI=0;",
"type": "int"... | {
"body": "public Node getNode() {\n return innerNode;\n }",
"class_method_signature": "WritableNode.getNode()",
"constructor": false,
"full_signature": "public Node getNode()",
"identifier": "getNode",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "Node",
"signat... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_36 | {
"fields": [
{
"declarator": "MAX_STRING_LENGTH=63999",
"modifier": "static final",
"original_string": "static final int MAX_STRING_LENGTH=63999;",
"type": "int",
"var_name": "MAX_STRING_LENGTH"
},
{
"declarator": "pse3mapper",
"modifier": "",
"original_str... | {
"body": "@Test\n public void acceptsARealFreebaseTriple() throws IOException,InterruptedException {\n pse3mapper.map(\n new LongWritable(944L),\n new Text(\"<http://rdf.basekb.com/ns/m.06fm3lj>\\t<http://rdf.basekb.com/ns/book.written_work.author>\\t<http://rdf.basekb.com/ns/... | {
"fields": [
{
"declarator": "ONE = new LongWritable(1)",
"modifier": "private static final",
"original_string": "private static final LongWritable ONE = new LongWritable(1);",
"type": "LongWritable",
"var_name": "ONE"
},
{
"declarator": "logger = LogFactory.getLog(PSE... | {
"body": "@Override\n public void map(LongWritable arg0, Text arg1, Context c) throws IOException, InterruptedException {\n PrimitiveTriple row3=p3Codec.decode(arg1.toString());\n try {\n String rawSubject = nodePreprocessor.apply(row3.getSubject());\n String rawPredicate = nod... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_20 | {
"fields": [
{
"declarator": "mapper",
"modifier": "private",
"original_string": "private FreebaseRDFMapper mapper;",
"type": "FreebaseRDFMapper",
"var_name": "mapper"
},
{
"declarator": "context",
"modifier": "private",
"original_string": "private Context ... | {
"body": "@Test\n public void acceptsForeignATriples() throws IOException,\n InterruptedException {\n String ordinaryTriple = \"ns:aviation.aircraft.first_flight\\trdf:type\\towl:Thing.\";\n mapper.map(new LongWritable(1L), new Text(ordinaryTriple), context);\n verify(context).getCounter(F... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FreebaseRDFMapper.class)",
"modifier": "private static",
"original_string": "private static org.apache.commons.logging.Log logger = LogFactory.getLog(FreebaseRDFMapper.class);",
"type": "org.apache.commons.logging.Log",
"var_n... | {
"body": "@Override\n public void map(LongWritable k, Text v,Context c) throws IOException, InterruptedException {\n\n String line=v.toString();\n if (line.startsWith(\"@prefix\")) {\n incrementCounter(c,FreebasePrefilterCounter.PREFIX_DECL,1L);\n return;\n }\n\n ... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_9 | {
"fields": [],
"file": "bakemono/src/test/java/com/ontology2/bakemono/configuration/TestBeans.java",
"identifier": "TestBeans",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void nonLinkTriplesTriplesAreNotAcceptedAsSuchByFunction() {\n PrimitiveTriple pt=new PrimitiveTriple(\n \"<http://example.com/A>\",\n \"<http://example.com/B>\",\n \"55\"\n );\n \n assertFalse(Beans.isLinkRe... | {
"fields": [],
"file": "bakemono/src/main/java/com/ontology2/bakemono/configuration/Beans.java",
"identifier": "Beans",
"interfaces": "",
"methods": [
{
"class_method_signature": "Beans.matchesPredicate(final String that)",
"constructor": false,
"full_signature": "private static Predica... | {
"body": "static Predicate<PrimitiveTriple> isLinkRelationship() {\n return new Predicate<PrimitiveTriple>() {\n @Override public boolean apply(PrimitiveTriple input) {\n return input.getObject().startsWith(\"<\") && input.getObject().endsWith(\">\");\n }\n };\n}",
"class_method_signature": "B... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
6500041_5 | {
"fields": [
{
"declarator": "codec",
"modifier": "private",
"original_string": "private PrimitiveTripleCodec codec;",
"type": "PrimitiveTripleCodec",
"var_name": "codec"
},
{
"declarator": "X=\"<http://example.com/X>\"",
"modifier": "final static",
"origin... | {
"body": "@Test\n public void parsesALiteralValueWithSpaces() {\n String in=X+\"\\t\"+Y+\"\\t \"+L2+\"\\t.\";\n PrimitiveTriple out=codec.decode(in);\n assertEquals(X,out.getSubject());\n assertEquals(Y,out.getPredicate());\n assertEquals(L2,out.getObject());\n }",
"class_m... | {
"fields": [
{
"declarator": "tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3)",
"modifier": "final",
"original_string": "final Splitter tripleSplitter=Splitter.on(CharMatcher.WHITESPACE).omitEmptyStrings().limit(3);",
"type": "Splitter",
"var_name": "t... | {
"body": "@Override\n public PrimitiveTriple decode(String obj) {\n Iterator<String> parts=tripleSplitter.split(obj).iterator();\n String subject = parts.next();\n String predicate = parts.next();\n String object = trimObject(parts.next());\n return new PrimitiveTriple(subject,p... | {
"created": null,
"fork": null,
"fork_count": 19,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 6500041,
"size": 4385,
"stargazer_count": 147,
"stars": null,
"updates": null,
"url": "https://github.com/paulhoule/infovore"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.