id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
22790488_225
{ "fields": [], "file": "typeobjectpattern/src/test/java/com/iluwatar/typeobject/CellTest.java", "identifier": "CellTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void crushTest() {\n var c1 = new Candy(\"green jelly\", \"jelly\", Type.CRUSHABLE_CANDY, 5);\n var c2 = new Candy(\"purple candy\", \"candy\", Type.CRUSHABLE_CANDY, 5);\n var matrix = new Cell[4][4];\n matrix[0][0] = new Cell(c1, 0, 0);\n matrix[1][0] = new Cell(c2, 0, 1);\n mat...
{ "fields": [ { "declarator": "candy", "modifier": "", "original_string": "Candy candy;", "type": "Candy", "var_name": "candy" }, { "declarator": "positionX", "modifier": "", "original_string": "int positionX;", "type": "int", "var_name": "positi...
{ "body": "void crush(CellPool pool, Cell[][] cellMatrix) {\n //take out from this position and put back in pool\n pool.addNewCell(this);\n this.fillThisSpace(pool, cellMatrix);\n }", "class_method_signature": "Cell.crush(CellPool pool, Cell[][] cellMatrix)", "constructor": false, "full_signature": " ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_93
{ "fields": [], "file": "hexagonal/src/test/java/com/iluwatar/hexagonal/domain/LotteryNumbersTest.java", "identifier": "LotteryNumbersTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testEquals() {\n var numbers1 = LotteryNumbers.create(Set.of(1, 2, 3, 4));\n var numbers2 = LotteryNumbers.create(Set.of(1, 2, 3, 4));\n assertEquals(numbers1, numbers2);\n var numbers3 = LotteryNumbers.create(Set.of(11, 12, 13, 14));\n assertNotEquals(numbers1, numbers3);\n }...
{ "fields": [ { "declarator": "numbers", "modifier": "private final", "original_string": "private final Set<Integer> numbers;", "type": "Set<Integer>", "var_name": "numbers" }, { "declarator": "MIN_NUMBER = 1", "modifier": "public static final", "original_st...
{ "body": "@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n var other = (LotteryNumbers) obj;\n if (numbers == null) {\n return other...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_360
{ "fields": [], "file": "eip-splitter/src/test/java/com/iluwatar/eip/splitter/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [], "file": "eip-splitter/src/main/java/com/iluwatar/eip/splitter/App.java", "identifier": "App", "interfaces": "", "methods": [ { "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signature": "public static void main(String[] args)", "ide...
{ "body": "public static void main(String[] args) throws Exception {\n // Run Spring Boot application and obtain ApplicationContext\n var context = SpringApplication.run(App.class, args);\n\n // Get CamelContext from ApplicationContext\n var camelContext = (CamelContext) context.getBean(\"camelContext\");...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_419
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "private-class-data/src/test/java/com/iluwatar/privateclassdata/StewTest.java", "identif...
{ "body": "@Test\n public void testMix() {\n final var stew = new ImmutableStew(1, 2, 3, 4);\n final var expectedMessage = \"Mixing the immutable stew we find: 1 potatoes, \"\n + \"2 carrots, 3 meat and 4 peppers\";\n\n for (var i = 0; i < 20; i++) {\n stew.mix();\n assertEquals(expectedMes...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(Stew.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(Stew.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarator": "n...
{ "body": "public void mix() {\n LOGGER.info(\"Mixing the stew we find: {} potatoes, {} carrots, {} meat and {} peppers\",\n numPotatoes, numCarrots, numMeat, numPeppers);\n }", "class_method_signature": "Stew.mix()", "constructor": false, "full_signature": "public void mix()", "identifier": "mix",...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_194
{ "fields": [], "file": "multiton/src/test/java/com/iluwatar/multiton/NazgulTest.java", "identifier": "NazgulTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInstance() {\n for (final var name : NazgulName.values()) {\n final var nazgul = Nazgul.getInstance(name);\n assertNotNull(nazgul);\n assertSame(nazgul, Nazgul.getInstance(name));\n assertEquals(name, nazgul.getName());\n }\n }", "class_method_signat...
{ "fields": [ { "declarator": "nazguls", "modifier": "private static final", "original_string": "private static final Map<NazgulName, Nazgul> nazguls;", "type": "Map<NazgulName, Nazgul>", "var_name": "nazguls" }, { "declarator": "name", "modifier": "private final"...
{ "body": "public static Nazgul getInstance(NazgulName name) {\n return nazguls.get(name);\n }", "class_method_signature": "Nazgul.getInstance(NazgulName name)", "constructor": false, "full_signature": "public static Nazgul getInstance(NazgulName name)", "identifier": "getInstance", "invocations": [ ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_317
{ "fields": [], "file": "model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantModelTest.java", "identifier": "GiantModelTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetNourishment() {\n final var model = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED);\n assertEquals(Nourishment.SATURATED, model.getNourishment());\n var messageFormat = \"The giant looks healthy, alert and %s.\";\n for (final var nourishment : N...
{ "fields": [ { "declarator": "health", "modifier": "private", "original_string": "private Health health;", "type": "Health", "var_name": "health" }, { "declarator": "fatigue", "modifier": "private", "original_string": "private Fatigue fatigue;", "type...
{ "body": "public void setNourishment(Nourishment nourishment) {\n this.nourishment = nourishment;\n }", "class_method_signature": "GiantModel.setNourishment(Nourishment nourishment)", "constructor": false, "full_signature": "public void setNourishment(Nourishment nourishment)", "identifier": "setNourishm...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_252
{ "fields": [], "file": "memento/src/test/java/com/iluwatar/memento/StarTest.java", "identifier": "StarTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTimePasses() {\n final var star = new Star(StarType.SUN, 1, 2);\n assertEquals(\"sun age: 1 years mass: 2 tons\", star.toString());\n\n star.timePasses();\n assertEquals(\"red giant age: 2 years mass: 16 tons\", star.toString());\n\n star.timePasses();\n assertEqu...
{ "fields": [ { "declarator": "type", "modifier": "private", "original_string": "private StarType type;", "type": "StarType", "var_name": "type" }, { "declarator": "ageYears", "modifier": "private", "original_string": "private int ageYears;", "type": "...
{ "body": "public void timePasses() {\n ageYears *= 2;\n massTons *= 8;\n switch (type) {\n case RED_GIANT:\n type = StarType.WHITE_DWARF;\n break;\n case SUN:\n type = StarType.RED_GIANT;\n break;\n case SUPERNOVA:\n type = StarType.DEAD;\n break;\n ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_439
{ "fields": [], "file": "subclass-sandbox/src/test/java/com/iluwatar/subclasssandbox/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test public void shouldExecuteWithoutException()", "identifier": "sho...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "subclass-sandbo...
{ "body": "public static void main(String[] args) {\n LOGGER.info(\"Use superpower: sky launch\");\n var skyLaunch = new SkyLaunch();\n skyLaunch.activate();\n LOGGER.info(\"Use superpower: ground dive\");\n var groundDive = new GroundDive();\n groundDive.activate();\n }", "class_method_signature...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_340
{ "fields": [], "file": "null-object/src/test/java/com/iluwatar/nullobject/NullNodeTest.java", "identifier": "NullNodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testGetInstance() {\n final var instance = NullNode.getInstance();\n assertNotNull(instance);\n assertSame(instance, NullNode.getInstance());\n }", "class_method_signature": "NullNodeTest.testGetInstance()", "constructor": false, "full_signature": "@Test void testGetInstance()...
{ "fields": [ { "declarator": "instance = new NullNode()", "modifier": "private static final", "original_string": "private static final NullNode instance = new NullNode();", "type": "NullNode", "var_name": "instance" } ], "file": "null-object/src/main/java/com/iluwatar/nullob...
{ "body": "public static NullNode getInstance() {\n return instance;\n }", "class_method_signature": "NullNode.getInstance()", "constructor": false, "full_signature": "public static NullNode getInstance()", "identifier": "getInstance", "invocations": [], "modifiers": "public static", "parameters": "...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_205
{ "fields": [], "file": "retry/src/test/java/com/iluwatar/retry/RetryTest.java", "identifier": "RetryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void errors() {\n final var e = new BusinessException(\"unhandled\");\n final var retry = new Retry<String>(\n () -> {\n throw e;\n },\n 2,\n 0\n );\n try {\n retry.perform();\n } catch (BusinessException ex) {\n //ignore\n }\...
{ "fields": [ { "declarator": "op", "modifier": "private final", "original_string": "private final BusinessOperation<T> op;", "type": "BusinessOperation<T>", "var_name": "op" }, { "declarator": "maxAttempts", "modifier": "private final", "original_string": "...
{ "body": "public List<Exception> errors() {\n return Collections.unmodifiableList(this.errors);\n }", "class_method_signature": "Retry.errors()", "constructor": false, "full_signature": "public List<Exception> errors()", "identifier": "errors", "invocations": [ "unmodifiableList" ], "modifiers"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_356
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "twin/src/test/java/com/iluwatar/twin/BallItemTest.java", "identifier": "BallItemTest", ...
{ "body": "@Test\n public void testDoDraw() {\n final var ballItem = new BallItem();\n final var ballThread = mock(BallThread.class);\n ballItem.setTwin(ballThread);\n\n ballItem.draw();\n assertTrue(appender.logContains(\"draw\"));\n assertTrue(appender.logContains(\"doDraw\"));\n\n verifyNoMor...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(BallItem.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(BallItem.class);", "type": "Logger", "var_name": "LOGGER" }, { "declara...
{ "body": "@Override\n public void doDraw() {\n\n LOGGER.info(\"doDraw\");\n }", "class_method_signature": "BallItem.doDraw()", "constructor": false, "full_signature": "@Override public void doDraw()", "identifier": "doDraw", "invocations": [ "info" ], "modifiers": "@Override public", "parame...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_213
{ "fields": [], "file": "decorator/src/test/java/com/iluwatar/decorator/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "decorator/src/m...
{ "body": "public static void main(String[] args) {\n\n // simple troll\n LOGGER.info(\"A simple looking troll approaches.\");\n var troll = new SimpleTroll();\n troll.attack();\n troll.fleeBattle();\n LOGGER.info(\"Simple troll power {}.\\n\", troll.getAttackPower());\n\n // change the behavior ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_182
{ "fields": [ { "declarator": "room", "modifier": "private", "original_string": "private Room room;", "type": "Room", "var_name": "room" }, { "declarator": "ID = 1", "modifier": "private static final", "original_string": "private static final int ID = 1;", ...
{ "body": "@Test\n public void equalsWithSameObjectValues() {\n final var otherRoom = new Room(ID, ROOMTYPE, PRICE, BOOKED);\n assertEquals(room, otherRoom);\n assertEquals(room.hashCode(), otherRoom.hashCode());\n }", "class_method_signature": "RoomTest.equalsWithSameObjectValues()", "constructor": fa...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private int id;", "type": "int", "var_name": "id" }, { "declarator": "roomType", "modifier": "private", "original_string": "private String roomType;", "type": "String", ...
{ "body": "@Override\n public int hashCode() {\n int result = id;\n result = 31 * result + roomType.hashCode();\n result = 31 * result + price;\n result = 31 * result + (booked ? 1 : 0);\n return result;\n }", "class_method_signature": "Room.hashCode()", "constructor": false, "full_signature": ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_301
{ "fields": [], "file": "circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/DelayedServiceTest.java", "identifier": "DelayedServiceTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDefaultConstructor() {\n var obj = new DelayedService();\n assertEquals(obj.response(System.nanoTime()), \"Delayed service is down\");\n }", "class_method_signature": "DelayedServiceTest.testDefaultConstructor()", "constructor": false, "full_signature": "@Test public v...
{ "fields": [ { "declarator": "delay", "modifier": "private final", "original_string": "private final int delay;", "type": "int", "var_name": "delay" } ], "file": "circuit-breaker/src/main/java/com/iluwatar/circuitbreaker/DelayedService.java", "identifier": "DelayedService"...
{ "body": "public String response(long serverStartTime) {\n var currentTime = System.nanoTime();\n //Since currentTime and serverStartTime are both in nanoseconds, we convert it to\n //seconds by diving by 10e9 and ensure floating point division by multiplying it\n //with 1.0 first. We then check if it is...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_244
{ "fields": [], "file": "priority-queue/src/test/java/com/iluwatar/priority/queue/PriorityMessageQueueTest.java", "identifier": "PriorityMessageQueueTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isEmpty() {\n var stringPriorityMessageQueue = new PriorityMessageQueue<>(new Integer[2]);\n assertTrue(stringPriorityMessageQueue.isEmpty());\n stringPriorityMessageQueue.add(1);\n stringPriorityMessageQueue.remove();\n assertTrue(stringPriorityMessageQueue.isEmpty());\...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(PriorityMessageQueue.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(PriorityMessageQueue.class);", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "public boolean isEmpty() {\n return size == 0;\n }", "class_method_signature": "PriorityMessageQueue.isEmpty()", "constructor": false, "full_signature": "public boolean isEmpty()", "identifier": "isEmpty", "invocations": [], "modifiers": "public", "parameters": "()", "return": "boolean"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_403
{ "fields": [], "file": "role-object/src/test/java/com/iluwatar/roleobject/BorrowerRoleTest.java", "identifier": "BorrowerRoleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void borrowTest() {\n var borrowerRole = new BorrowerRole();\n borrowerRole.setName(\"test\");\n Assert.assertEquals(borrowerRole.borrow(), \"Borrower test wants to get some money.\");\n }", "class_method_signature": "BorrowerRoleTest.borrowTest()", "constructor": false, "fu...
{ "fields": [ { "declarator": "name", "modifier": "private", "original_string": "private String name;", "type": "String", "var_name": "name" } ], "file": "role-object/src/main/java/com/iluwatar/roleobject/BorrowerRole.java", "identifier": "BorrowerRole", "interfaces": "",...
{ "body": "public String borrow() {\n return String.format(\"Borrower %s wants to get some money.\", name);\n }", "class_method_signature": "BorrowerRole.borrow()", "constructor": false, "full_signature": "public String borrow()", "identifier": "borrow", "invocations": [ "format" ], "modifiers":...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_116
{ "fields": [ { "declarator": "arithmetic = new OldArithmetic(new OldSource())", "modifier": "private static final", "original_string": "private static final OldArithmetic arithmetic = new OldArithmetic(new OldSource());", "type": "OldArithmetic", "var_name": "arithmetic" } ], ...
{ "body": "@Test\n public void testMul() {\n assertEquals(0, arithmetic.mul(-1, 0, 1));\n }", "class_method_signature": "OldArithmeticTest.testMul()", "constructor": false, "full_signature": "@Test public void testMul()", "identifier": "testMul", "invocations": [ "assertEquals", "mul" ], "m...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(OldArithmetic.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(OldArithmetic.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public int mul(int... nums) {\n LOGGER.info(\"Arithmetic mul {}\", VERSION);\n return source.accumulateMul(nums);\n }", "class_method_signature": "OldArithmetic.mul(int... nums)", "constructor": false, "full_signature": "public int mul(int... nums)", "identifier": "mul", "invocations": [ ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_395
{ "fields": [ { "declarator": "target", "modifier": "private", "original_string": "private DomesticTaxCalculator target;", "type": "DomesticTaxCalculator", "var_name": "target" } ], "file": "separated-interface/src/test/java/com/iluwatar/separatedinterface/taxes/DomesticTaxCa...
{ "body": "@Test\n public void testTaxCalculation(){\n target = new DomesticTaxCalculator();\n\n var tax=target.calculate(100.0);\n Assertions.assertEquals(tax,20.0);\n }", "class_method_signature": "DomesticTaxCalculatorTest.testTaxCalculation()", "constructor": false, "full_signature": "@Test publi...
{ "fields": [ { "declarator": "TAX_PERCENTAGE = 20", "modifier": "public static final", "original_string": "public static final double TAX_PERCENTAGE = 20;", "type": "double", "var_name": "TAX_PERCENTAGE" } ], "file": "separated-interface/src/main/java/com/iluwatar/separatedi...
{ "body": "@Override\n public double calculate(double amount) {\n return amount * TAX_PERCENTAGE / 100.0;\n }", "class_method_signature": "DomesticTaxCalculator.calculate(double amount)", "constructor": false, "full_signature": "@Override public double calculate(double amount)", "identifier": "calculate"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_66
{ "fields": [ { "declarator": "paidUser = new User(\"Jamie Coder\")", "modifier": "final", "original_string": "final User paidUser = new User(\"Jamie Coder\");", "type": "User", "var_name": "paidUser" }, { "declarator": "freeUser = new User(\"Alan Defect\")", "mod...
{ "body": "@Test\n public void testIsEnhancedAlwaysTrueAsTiered() {\n assertTrue(service.isEnhanced());\n }", "class_method_signature": "TieredFeatureToggleVersionTest.testIsEnhancedAlwaysTrueAsTiered()", "constructor": false, "full_signature": "@Test public void testIsEnhancedAlwaysTrueAsTiered()", "ide...
{ "fields": [], "file": "feature-toggle/src/main/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersion.java", "identifier": "TieredFeatureToggleVersion", "interfaces": "implements Service", "methods": [ { "class_method_signature": "TieredFeatureToggleVersion.getWelcomeMess...
{ "body": "@Override\n public boolean isEnhanced() {\n return true;\n }", "class_method_signature": "TieredFeatureToggleVersion.isEnhanced()", "constructor": false, "full_signature": "@Override public boolean isEnhanced()", "identifier": "isEnhanced", "invocations": [], "modifiers": "@Override public...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_89
{ "fields": [ { "declarator": "TEST_DB = \"lotteryTestDB\"", "modifier": "private static final", "original_string": "private static final String TEST_DB = \"lotteryTestDB\";", "type": "String", "var_name": "TEST_DB" }, { "declarator": "TEST_TICKETS_COLLECTION = \"lotter...
{ "body": "@Test\n void testNextId() {\n assertEquals(1, repository.getNextId());\n assertEquals(2, repository.getNextId());\n assertEquals(3, repository.getNextId());\n }", "class_method_signature": "MongoTicketRepositoryTest.testNextId()", "constructor": false, "full_signature": "@Test void testNex...
{ "fields": [ { "declarator": "DEFAULT_DB = \"lotteryDB\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_DB = \"lotteryDB\";", "type": "String", "var_name": "DEFAULT_DB" }, { "declarator": "DEFAULT_TICKETS_COLLECTION = \"lo...
{ "body": "public int getNextId() {\n var find = new Document(\"_id\", TICKET_ID);\n var increase = new Document(\"seq\", 1);\n var update = new Document(\"$inc\", increase);\n var result = countersCollection.findOneAndUpdate(find, update);\n return result.getInteger(\"seq\");\n }", "class_method_si...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_141
{ "fields": [ { "declarator": "rangeShardManager", "modifier": "private", "original_string": "private RangeShardManager rangeShardManager;", "type": "RangeShardManager", "var_name": "rangeShardManager" } ], "file": "sharding/src/test/java/com/iluwatar/sharding/RangeShardManag...
{ "body": "@Test\n public void testStoreData() {\n var data = new Data(1, \"test\", Data.DataType.TYPE_1);\n rangeShardManager.storeData(data);\n Assert.assertEquals(data, rangeShardManager.getShardById(1).getDataById(1));\n }", "class_method_signature": "RangeShardManagerTest.testStoreData()", "constr...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RangeShardManager.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RangeShardManager.class);", "type": "Logger", "var_name": "LOGGER" } ]...
{ "body": "@Override\n public int storeData(Data data) {\n var shardId = allocateShard(data);\n var shard = shardMap.get(shardId);\n shard.storeData(data);\n LOGGER.info(data.toString() + \" is stored in Shard \" + shardId);\n return shardId;\n }", "class_method_signature": "RangeShardManager.store...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_31
{ "fields": [], "file": "property/src/test/java/com/iluwatar/property/CharacterTest.java", "identifier": "CharacterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testType() {\n final var prototype = new Character();\n prototype.set(Stats.ARMOR, 1);\n prototype.set(Stats.INTELLECT, 2);\n assertNull(prototype.type());\n\n final var stupid = new Character(Type.ROGUE, prototype);\n stupid.remove(Stats.INTELLECT);\n assertEquals...
{ "fields": [ { "declarator": "prototype", "modifier": "private final", "original_string": "private final Prototype prototype;", "type": "Prototype", "var_name": "prototype" }, { "declarator": "properties = new HashMap<>()", "modifier": "private final", "ori...
{ "body": "public Type type() {\n return type;\n }", "class_method_signature": "Character.type()", "constructor": false, "full_signature": "public Type type()", "identifier": "type", "invocations": [], "modifiers": "public", "parameters": "()", "return": "Type", "signature": "Type type()", "te...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_268
{ "fields": [], "file": "specification/src/test/java/com/iluwatar/specification/app/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWith...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "specification/s...
{ "body": "public static void main(String[] args) {\n // initialize creatures list\n var creatures = List.of(\n new Goblin(),\n new Octopus(),\n new Dragon(),\n new Shark(),\n new Troll(),\n new KillerBee()\n );\n // so-called \"hard-coded\" specification\n LOG...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_287
{ "fields": [ { "declarator": "student1 = new Student(1, \"Ram\", \"street 9, cupertino\")", "modifier": "private final", "original_string": "private final Student student1 = new Student(1, \"Ram\", \"street 9, cupertino\");", "type": "Student", "var_name": "student1" }, { ...
{ "body": "@Test\n public void shouldSaveDeletedStudentWithoutWritingToDb() {\n studentRepository.registerDeleted(student1);\n studentRepository.registerDeleted(student2);\n\n assertEquals(2, context.get(UnitActions.DELETE.getActionValue()).size());\n verifyNoMoreInteractions(studentDatabase);\n }", "...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StudentRepository.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StudentRepository.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public void registerDeleted(Student student) {\n LOGGER.info(\"Registering {} for delete in context.\", student.getName());\n register(student, UnitActions.DELETE.getActionValue());\n }", "class_method_signature": "StudentRepository.registerDeleted(Student student)", "constructor": ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_442
{ "fields": [], "file": "tls/src/test/java/com/iluwatar/tls/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "tls/src/main/ja...
{ "body": "public static void main(String[] args) {\n var counterDateValues = 0;\n var counterExceptions = 0;\n\n // Create a callable\n var callableDf = new DateFormatCallable(\"dd/MM/yyyy\", \"15/12/2015\");\n // start 4 threads, each using the same Callable instance\n var executor = Executors.new...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_157
{ "fields": [], "file": "model-view-presenter/src/test/java/com/iluwatar/model/view/presenter/FileLoaderTest.java", "identifier": "FileLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadData() {\n final var fileLoader = new FileLoader();\n fileLoader.setFileName(\"non-existing-file\");\n assertNull(fileLoader.loadData());\n }", "class_method_signature": "FileLoaderTest.testLoadData()", "constructor": false, "full_signature": "@Test public void ...
{ "fields": [ { "declarator": "serialVersionUID = -4745803872902019069L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -4745803872902019069L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOG...
{ "body": "public String loadData() {\n var dataFileName = this.fileName;\n try (var br = new BufferedReader(new FileReader(new File(dataFileName)))) {\n var result = br.lines().collect(Collectors.joining(\"\\n\"));\n this.loaded = true;\n return result;\n } catch (Exception e) {\n LOGGER...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_2
{ "fields": [], "file": "strategy/src/test/java/com/iluwatar/strategy/DragonSlayerTest.java", "identifier": "DragonSlayerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChangeStrategy() {\n final var initialStrategy = mock(DragonSlayingStrategy.class);\n final var dragonSlayer = new DragonSlayer(initialStrategy);\n\n dragonSlayer.goToBattle();\n verify(initialStrategy).execute();\n\n final var newStrategy = mock(DragonSlayingStrateg...
{ "fields": [ { "declarator": "strategy", "modifier": "private", "original_string": "private DragonSlayingStrategy strategy;", "type": "DragonSlayingStrategy", "var_name": "strategy" } ], "file": "strategy/src/main/java/com/iluwatar/strategy/DragonSlayer.java", "identifier"...
{ "body": "public void changeStrategy(DragonSlayingStrategy strategy) {\n this.strategy = strategy;\n }", "class_method_signature": "DragonSlayer.changeStrategy(DragonSlayingStrategy strategy)", "constructor": false, "full_signature": "public void changeStrategy(DragonSlayingStrategy strategy)", "identifi...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_27
{ "fields": [ { "declarator": "context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES)", "modifier": "@Rule\n public", "original_string": "@Rule\n public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);", "type": "JUnitRuleMockery2", ...
{ "body": "@Test\n public void testListAll() {\n\n // given\n final List<SimpleObject> all = Lists.newArrayList();\n\n context.checking(new Expectations() {\n {\n oneOf(mockContainer).allInstances(SimpleObject.class);\n will(returnValue(all));\n }\n });\n\n // when\n final L...
{ "fields": [ { "declarator": "container", "modifier": "@javax.inject.Inject", "original_string": "@javax.inject.Inject\n DomainObjectContainer container;", "type": "DomainObjectContainer", "var_name": "container" } ], "file": "naked-objects/dom/src/main/java/domainapp/dom/m...
{ "body": "@Action(semantics = SemanticsOf.SAFE)\n @ActionLayout(bookmarking = BookmarkPolicy.AS_ROOT)\n @MemberOrder(sequence = \"1\")\n public List<SimpleObject> listAll() {\n return container.allInstances(SimpleObject.class);\n }", "class_method_signature": "SimpleObjects.listAll()", "constructor": fals...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_291
{ "fields": [ { "declarator": "student1 = new Student(1, \"Ram\", \"street 9, cupertino\")", "modifier": "private final", "original_string": "private final Student student1 = new Student(1, \"Ram\", \"street 9, cupertino\");", "type": "Student", "var_name": "student1" }, { ...
{ "body": "@Test\n public void shouldNotWriteToDbIfNothingToCommit() {\n var studentRepository = new StudentRepository(new HashMap<>(), studentDatabase);\n\n studentRepository.commit();\n\n verifyZeroInteractions(studentDatabase);\n }", "class_method_signature": "StudentRepositoryTest.shouldNotWriteToDbI...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StudentRepository.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StudentRepository.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public void commit() {\n if (context == null || context.size() == 0) {\n return;\n }\n LOGGER.info(\"Commit started\");\n if (context.containsKey(UnitActions.INSERT.getActionValue())) {\n commitInsert();\n }\n\n if (context.containsKey(UnitActions.MODIFY.getActionVa...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_415
{ "fields": [], "file": "leader-election/src/test/java/com/iluwatar/leaderelection/MessageTest.java", "identifier": "MessageTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetType() {\n var message = new Message(MessageType.HEARTBEAT, \"\");\n assertEquals(MessageType.HEARTBEAT, message.getType());\n }", "class_method_signature": "MessageTest.testGetType()", "constructor": false, "full_signature": "@Test public void testGetType()", "id...
{ "fields": [ { "declarator": "type", "modifier": "private", "original_string": "private MessageType type;", "type": "MessageType", "var_name": "type" }, { "declarator": "content", "modifier": "private", "original_string": "private String content;", "t...
{ "body": "public MessageType getType() {\n return type;\n }", "class_method_signature": "Message.getType()", "constructor": false, "full_signature": "public MessageType getType()", "identifier": "getType", "invocations": [], "modifiers": "public", "parameters": "()", "return": "MessageType", "s...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_100
{ "fields": [], "file": "bridge/src/test/java/com/iluwatar/bridge/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "bridge/src/main...
{ "body": "public static void main(String[] args) {\n LOGGER.info(\"The knight receives an enchanted sword.\");\n var enchantedSword = new Sword(new SoulEatingEnchantment());\n enchantedSword.wield();\n enchantedSword.swing();\n enchantedSword.unwield();\n\n LOGGER.info(\"The valkyrie receives an en...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_70
{ "fields": [], "file": "flux/src/test/java/com/iluwatar/flux/view/ContentViewTest.java", "identifier": "ContentViewTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStoreChanged() {\n final var store = mock(ContentStore.class);\n when(store.getContent()).thenReturn(Content.PRODUCTS);\n\n final var view = new ContentView();\n view.storeChanged(store);\n\n verify(store, times(1)).getContent();\n verifyNoMoreInteractions(store);...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ContentView.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ContentView.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "@Override\n public void storeChanged(Store store) {\n var contentStore = (ContentStore) store;\n content = contentStore.getContent();\n render();\n }", "class_method_signature": "ContentView.storeChanged(Store store)", "constructor": false, "full_signature": "@Override public void storeCha...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_229
{ "fields": [ { "declarator": "fieldJsonMapper", "modifier": "@Mock\n private static", "original_string": "@Mock\n private static FieldJsonMapper fieldJsonMapper;", "type": "FieldJsonMapper", "var_name": "fieldJsonMapper" }, { "declarator": "resource", "modifier...
{ "body": "@Test\n void shouldGiveSpecifiedFieldsInformationOfVideo() throws Exception {\n var fields = new String[]{\"id\", \"title\", \"length\"};\n\n var expectedDetails = \"{\\\"id\\\": 1,\\\"title\\\": \\\"Avatar\\\",\\\"length\\\": 178}\";\n Mockito.when(fieldJsonMapper.toJson(Matchers.any(Video.class...
{ "fields": [ { "declarator": "fieldJsonMapper", "modifier": "private final", "original_string": "private final FieldJsonMapper fieldJsonMapper;", "type": "FieldJsonMapper", "var_name": "fieldJsonMapper" }, { "declarator": "videos", "modifier": "private final", ...
{ "body": "public String getDetails(Integer id, String... fields) throws Exception {\n if (fields.length == 0) {\n return videos.get(id).toString();\n }\n return fieldJsonMapper.toJson(videos.get(id), fields);\n }", "class_method_signature": "VideoResource.getDetails(Integer id, String... fields)", ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_383
{ "fields": [], "file": "layers/src/test/java/com/iluwatar/layers/app/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [ { "declarator": "cakeBakingService = new CakeBakingServiceImpl()", "modifier": "private static final", "original_string": "private static final CakeBakingService cakeBakingService = new CakeBakingServiceImpl();", "type": "CakeBakingService", "var_name": "cakeBakingServi...
{ "body": "public static void main(String[] args) {\n\n // initialize example data\n initializeData(cakeBakingService);\n\n // create view and render it\n var cakeView = new CakeViewImpl(cakeBakingService);\n cakeView.render();\n }", "class_method_signature": "App.main(String[] args)", "constructo...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_197
{ "fields": [], "file": "value-object/src/test/java/com/iluwatar/value/object/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "value-object/sr...
{ "body": "public static void main(String[] args) {\n var statA = HeroStat.valueOf(10, 5, 0);\n var statB = HeroStat.valueOf(10, 5, 0);\n var statC = HeroStat.valueOf(5, 1, 8);\n\n LOGGER.info(statA.toString());\n\n LOGGER.info(\"Is statA and statB equal : {}\", statA.equals(statB));\n LOGGER.info(\...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_178
{ "fields": [], "file": "repository/src/test/java/com/iluwatar/repository/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWith...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "repository/src/...
{ "body": "public static void main(String[] args) {\n\n var context = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\n var repository = context.getBean(PersonRepository.class);\n\n var peter = new Person(\"Peter\", \"Sagan\", 17);\n var nasta = new Person(\"Nasta\", \"Kuzminova\", 25);\n ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_251
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "dependency-injection/src/test/java/com/iluwatar/dependency/injection/SimpleWizardTest.jav...
{ "body": "@Test\n public void testSmoke() {\n final var simpleWizard = new SimpleWizard();\n simpleWizard.smoke();\n assertEquals(\"SimpleWizard smoking OldTobyTobacco\", appender.getLastMessage());\n assertEquals(1, appender.getLogSize());\n }", "class_method_signature": "SimpleWizardTest.testSmoke(...
{ "fields": [ { "declarator": "tobacco = new OldTobyTobacco()", "modifier": "private final", "original_string": "private final OldTobyTobacco tobacco = new OldTobyTobacco();", "type": "OldTobyTobacco", "var_name": "tobacco" } ], "file": "dependency-injection/src/main/java/com...
{ "body": "public void smoke() {\n tobacco.smoke(this);\n }", "class_method_signature": "SimpleWizard.smoke()", "constructor": false, "full_signature": "public void smoke()", "identifier": "smoke", "invocations": [ "smoke" ], "modifiers": "public", "parameters": "()", "return": "void", "si...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_314
{ "fields": [], "file": "model-view-controller/src/test/java/com/iluwatar/model/view/controller/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [], "file": "model-view-controller/src/main/java/com/iluwatar/model/view/controller/App.java", "identifier": "App", "interfaces": "", "methods": [ { "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signature": "public static void main(String[] ...
{ "body": "public static void main(String[] args) {\n // create model, view and controller\n var giant = new GiantModel(Health.HEALTHY, Fatigue.ALERT, Nourishment.SATURATED);\n var view = new GiantView();\n var controller = new GiantController(giant, view);\n // initial display\n controller.updateVi...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_206
{ "fields": [], "file": "retry/src/test/java/com/iluwatar/retry/RetryTest.java", "identifier": "RetryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void attempts() {\n final var e = new BusinessException(\"unhandled\");\n final var retry = new Retry<String>(\n () -> {\n throw e;\n },\n 2,\n 0\n );\n try {\n retry.perform();\n } catch (BusinessException ex) {\n //ignore\n ...
{ "fields": [ { "declarator": "op", "modifier": "private final", "original_string": "private final BusinessOperation<T> op;", "type": "BusinessOperation<T>", "var_name": "op" }, { "declarator": "maxAttempts", "modifier": "private final", "original_string": "...
{ "body": "public int attempts() {\n return this.attempts.intValue();\n }", "class_method_signature": "Retry.attempts()", "constructor": false, "full_signature": "public int attempts()", "identifier": "attempts", "invocations": [ "intValue" ], "modifiers": "public", "parameters": "()", "retu...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_343
{ "fields": [], "file": "fluentinterface/src/test/java/com/iluwatar/fluentinterface/app/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWith...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "fluentinterface...
{ "body": "public static void main(String[] args) {\n\n var integerList = List.of(1, -61, 14, -22, 18, -87, 6, 64, -82, 26, -98, 97, 45, 23, 2, -68);\n\n prettyPrint(\"The initial list contains: \", integerList);\n\n var firstFiveNegatives = SimpleFluentIterable\n .fromCopyOf(integerList)\n .fi...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_139
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private Data data;", "type": "Data", "var_name": "data" }, { "declarator": "shard", "modifier": "private", "original_string": "private Shard shard;", "type": "Shard", ...
{ "body": "@Test\n public void testStoreData() {\n try {\n shard.storeData(data);\n var field = Shard.class.getDeclaredField(\"dataStore\");\n field.setAccessible(true);\n var dataMap = (Map<Integer, Data>) field.get(shard);\n Assert.assertEquals(1, dataMap.size());\n Assert.assertEq...
{ "fields": [ { "declarator": "id", "modifier": "private final", "original_string": "private final int id;", "type": "int", "var_name": "id" }, { "declarator": "dataStore", "modifier": "private final", "original_string": "private final Map<Integer, Data> dat...
{ "body": "public void storeData(Data data) {\n dataStore.put(data.getKey(), data);\n }", "class_method_signature": "Shard.storeData(Data data)", "constructor": false, "full_signature": "public void storeData(Data data)", "identifier": "storeData", "invocations": [ "put", "getKey" ], "modifi...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_210
{ "fields": [ { "declarator": "nonEmptyRoot", "modifier": "private", "original_string": "private TreeNode<Integer> nonEmptyRoot;", "type": "TreeNode<Integer>", "var_name": "nonEmptyRoot" }, { "declarator": "emptyRoot", "modifier": "private", "original_string...
{ "body": "@Test\n void nextOverEntirePopulatedTree() {\n var iter = new BstIterator<>(nonEmptyRoot);\n assertEquals(Integer.valueOf(1), iter.next().getVal(), \"First Node is 1.\");\n assertEquals(Integer.valueOf(3), iter.next().getVal(), \"Second Node is 3.\");\n assertEquals(Integer.valueOf(4), iter.ne...
{ "fields": [ { "declarator": "pathStack", "modifier": "private final", "original_string": "private final ArrayDeque<TreeNode<T>> pathStack;", "type": "ArrayDeque<TreeNode<T>>", "var_name": "pathStack" } ], "file": "iterator/src/main/java/com/iluwatar/iterator/bst/BstIterator...
{ "body": "@Override\n public TreeNode<T> next() throws NoSuchElementException {\n if (pathStack.isEmpty()) {\n throw new NoSuchElementException();\n }\n var next = pathStack.pop();\n pushPathToNextSmallest(next.getRight());\n return next;\n }", "class_method_signature": "BstIterator.next()", ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_49
{ "fields": [], "file": "proxy/src/test/java/com/iluwatar/proxy/WizardTest.java", "identifier": "WizardTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() {\n List.of(\"Gandalf\", \"Dumbledore\", \"Oz\", \"Merlin\")\n .forEach(name -> assertEquals(name, new Wizard(name).toString()));\n }", "class_method_signature": "WizardTest.testToString()", "constructor": false, "full_signature": "@Test public void test...
{ "fields": [ { "declarator": "name", "modifier": "private final", "original_string": "private final String name;", "type": "String", "var_name": "name" } ], "file": "proxy/src/main/java/com/iluwatar/proxy/Wizard.java", "identifier": "Wizard", "interfaces": "", "methods...
{ "body": "@Override\n public String toString() {\n return name;\n }", "class_method_signature": "Wizard.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [], "modifiers": "@Override public", "parameters": "()", "re...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_355
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "twin/src/test/java/com/iluwatar/twin/BallItemTest.java", "identifier": "BallItemTest", ...
{ "body": "@Test\n public void testClick() {\n final var ballThread = mock(BallThread.class);\n final var ballItem = new BallItem();\n ballItem.setTwin(ballThread);\n\n final var inOrder = inOrder(ballThread);\n\n IntStream.range(0, 10).forEach(i -> {\n ballItem.click();\n inOrder.verify(bal...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(BallItem.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(BallItem.class);", "type": "Logger", "var_name": "LOGGER" }, { "declara...
{ "body": "@Override\n public void click() {\n\n isSuspended = !isSuspended;\n\n if (isSuspended) {\n twin.suspendMe();\n } else {\n twin.resumeMe();\n }\n }", "class_method_signature": "BallItem.click()", "constructor": false, "full_signature": "@Override public void click()", "identi...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_181
{ "fields": [ { "declarator": "room", "modifier": "private", "original_string": "private Room room;", "type": "Room", "var_name": "room" }, { "declarator": "ID = 1", "modifier": "private static final", "original_string": "private static final int ID = 1;", ...
{ "body": "@Test\n public void notEqualWithDifferentId() {\n final var newId = 2;\n final var otherRoom = new Room(newId, ROOMTYPE, PRICE, BOOKED);\n assertNotEquals(room, otherRoom);\n assertNotEquals(room.hashCode(), otherRoom.hashCode());\n }", "class_method_signature": "RoomTest.notEqualWithDiffer...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private int id;", "type": "int", "var_name": "id" }, { "declarator": "roomType", "modifier": "private", "original_string": "private String roomType;", "type": "String", ...
{ "body": "@Override\n public int hashCode() {\n int result = id;\n result = 31 * result + roomType.hashCode();\n result = 31 * result + price;\n result = 31 * result + (booked ? 1 : 0);\n return result;\n }", "class_method_signature": "Room.hashCode()", "constructor": false, "full_signature": ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_247
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "dependency-injection/src/test/java/com/iluwatar/dependency/injection/GuiceWizardTest.java...
{ "body": "@Test\n public void testSmokeEveryThingThroughConstructor() throws Exception {\n\n List<Tobacco> tobaccos = List.of(\n new OldTobyTobacco(),\n new RivendellTobacco(),\n new SecondBreakfastTobacco()\n );\n\n // Verify if the wizard is smoking the correct tobacco ...\n tobac...
{ "fields": [ { "declarator": "tobacco", "modifier": "private final", "original_string": "private final Tobacco tobacco;", "type": "Tobacco", "var_name": "tobacco" } ], "file": "dependency-injection/src/main/java/com/iluwatar/dependency/injection/GuiceWizard.java", "identif...
{ "body": "@Override\n public void smoke() {\n tobacco.smoke(this);\n }", "class_method_signature": "GuiceWizard.smoke()", "constructor": false, "full_signature": "@Override public void smoke()", "identifier": "smoke", "invocations": [ "smoke" ], "modifiers": "@Override public", "parameters":...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_302
{ "fields": [], "file": "circuit-breaker/src/test/java/com/iluwatar/circuitbreaker/CircuitBreakerTest.java", "identifier": "CircuitBreakerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetState() {\n var circuitBreaker = new CircuitBreaker(1, 1, 100);\n //Right now, failureCount<failureThreshold, so state should be closed\n assertEquals(circuitBreaker.getState(), \"CLOSED\");\n circuitBreaker.failureCount = 4;\n circuitBreaker.lastFailureTime = Sys...
{ "fields": [ { "declarator": "timeout", "modifier": "private final", "original_string": "private final long timeout;", "type": "long", "var_name": "timeout" }, { "declarator": "retryTimePeriod", "modifier": "private final", "original_string": "private final...
{ "body": "protected void setState() {\n if (failureCount > failureThreshold) { //Then something is wrong with remote service\n if ((System.nanoTime() - lastFailureTime) > retryTimePeriod) {\n //We have waited long enough and should try checking if service is up\n state = State.HALF_OPEN;\n ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_115
{ "fields": [ { "declarator": "arithmetic = new OldArithmetic(new OldSource())", "modifier": "private static final", "original_string": "private static final OldArithmetic arithmetic = new OldArithmetic(new OldSource());", "type": "OldArithmetic", "var_name": "arithmetic" } ], ...
{ "body": "@Test\n public void testSum() {\n assertEquals(0, arithmetic.sum(-1, 0, 1));\n }", "class_method_signature": "OldArithmeticTest.testSum()", "constructor": false, "full_signature": "@Test public void testSum()", "identifier": "testSum", "invocations": [ "assertEquals", "sum" ], "m...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(OldArithmetic.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(OldArithmetic.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public int sum(int... nums) {\n LOGGER.info(\"Arithmetic sum {}\", VERSION);\n return source.accumulateSum(nums);\n }", "class_method_signature": "OldArithmetic.sum(int... nums)", "constructor": false, "full_signature": "public int sum(int... nums)", "identifier": "sum", "invocations": [ ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_400
{ "fields": [], "file": "role-object/src/test/java/com/iluwatar/roleobject/CustomerCoreTest.java", "identifier": "CustomerCoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void remRole() {\n var core = new CustomerCore();\n core.addRole(Role.Borrower);\n\n var bRole = core.getRole(Role.Borrower, BorrowerRole.class);\n assertTrue(bRole.isPresent());\n\n assertTrue(core.remRole(Role.Borrower));\n\n var empt = core.getRole(Role.Borrower, Borrow...
{ "fields": [ { "declarator": "roles", "modifier": "private final", "original_string": "private final Map<Role, CustomerRole> roles;", "type": "Map<Role, CustomerRole>", "var_name": "roles" } ], "file": "role-object/src/main/java/com/iluwatar/roleobject/CustomerCore.java", ...
{ "body": "@Override\n public boolean remRole(Role role) {\n return Objects.nonNull(roles.remove(role));\n }", "class_method_signature": "CustomerCore.remRole(Role role)", "constructor": false, "full_signature": "@Override public boolean remRole(Role role)", "identifier": "remRole", "invocations": [ ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_379
{ "fields": [], "file": "layers/src/test/java/com/iluwatar/layers/entity/CakeTest.java", "identifier": "CakeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetTopping() {\n final var cake = new Cake();\n assertNull(cake.getTopping());\n\n final var expectedTopping = new CakeTopping(\"DummyTopping\", 1000);\n cake.setTopping(expectedTopping);\n assertEquals(expectedTopping, cake.getTopping());\n }", "class_method_sign...
{ "fields": [ { "declarator": "id", "modifier": "@Id\n @GeneratedValue\n private", "original_string": "@Id\n @GeneratedValue\n private Long id;", "type": "Long", "var_name": "id" }, { "declarator": "topping", "modifier": "@OneToOne(cascade = CascadeType.REMOVE...
{ "body": "public void setTopping(CakeTopping topping) {\n this.topping = topping;\n }", "class_method_signature": "Cake.setTopping(CakeTopping topping)", "constructor": false, "full_signature": "public void setTopping(CakeTopping topping)", "identifier": "setTopping", "invocations": [], "modifiers": ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_65
{ "fields": [ { "declarator": "paidUser = new User(\"Jamie Coder\")", "modifier": "final", "original_string": "final User paidUser = new User(\"Jamie Coder\");", "type": "User", "var_name": "paidUser" }, { "declarator": "freeUser = new User(\"Alan Defect\")", "mod...
{ "body": "@Test\n public void testGetWelcomeMessageForFreeUser() {\n final var welcomeMessage = service.getWelcomeMessage(freeUser);\n final var expected = \"I suppose you can use this software.\";\n assertEquals(expected, welcomeMessage);\n }", "class_method_signature": "TieredFeatureToggleVersionTest....
{ "fields": [], "file": "feature-toggle/src/main/java/com/iluwatar/featuretoggle/pattern/tieredversion/TieredFeatureToggleVersion.java", "identifier": "TieredFeatureToggleVersion", "interfaces": "implements Service", "methods": [ { "class_method_signature": "TieredFeatureToggleVersion.getWelcomeMess...
{ "body": "@Override\n public String getWelcomeMessage(User user) {\n if (UserGroup.isPaid(user)) {\n return \"You're amazing \" + user + \". Thanks for paying for this awesome software.\";\n }\n\n return \"I suppose you can use this software.\";\n }", "class_method_signature": "TieredFeatureToggleV...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_396
{ "fields": [], "file": "role-object/src/test/java/com/iluwatar/roleobject/ApplicationRoleObjectTest.java", "identifier": "ApplicationRoleObjectTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> ApplicationRoleObject.main(new String[]{}));\n }", "class_method_signature": "ApplicationRoleObjectTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test public v...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(Role.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(Role.class);", "type": "Logger", "var_name": "logger" } ], "file": "role-object/s...
{ "body": "public static void main(String[] args) {\n var customer = Customer.newCustomer(Borrower, Investor);\n\n logger.info(\" the new customer created : {}\", customer);\n\n var hasBorrowerRole = customer.hasRole(Borrower);\n logger.info(\" customer has a borrowed role - {}\", hasBorrowerRole);\n v...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_142
{ "fields": [], "file": "state/src/test/java/com/iluwatar/state/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWith...
{ "fields": [], "file": "state/src/main/java/com/iluwatar/state/App.java", "identifier": "App", "interfaces": "", "methods": [ { "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signature": "public static void main(String[] args)", "identifier": "mai...
{ "body": "public static void main(String[] args) {\n\n var mammoth = new Mammoth();\n mammoth.observe();\n mammoth.timePasses();\n mammoth.observe();\n mammoth.timePasses();\n mammoth.observe();\n\n }", "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signatur...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_284
{ "fields": [], "file": "api-gateway/price-microservice/src/test/java/com/iluwatar/price/microservice/PriceControllerTest.java", "identifier": "PriceControllerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testgetPrice() {\n var priceController = new PriceController();\n var price = priceController.getPrice();\n assertEquals(\"20\", price);\n }", "class_method_signature": "PriceControllerTest.testgetPrice()", "constructor": false, "full_signature": "@Test public void test...
{ "fields": [ { "declarator": "LOGGER = getLogger(PriceController.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = getLogger(PriceController.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "api-gateway/price-m...
{ "body": "@RequestMapping(value = \"/price\", method = RequestMethod.GET)\n public String getPrice() {\n LOGGER.info(\"Successfully found price info\");\n return \"20\";\n }", "class_method_signature": "PriceController.getPrice()", "constructor": false, "full_signature": "@RequestMapping(value = \"/pri...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_32
{ "fields": [], "file": "caching/src/test/java/com/iluwatar/caching/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()",...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "caching/src/mai...
{ "body": "public static void main(String[] args) {\n AppManager.initDb(false); // VirtualDB (instead of MongoDB) was used in running the JUnit tests\n // and the App class to avoid Maven compilation errors. Set flag to\n // true to run the tests with MongoDB (provided that MongoDB is\n // installed and s...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_154
{ "fields": [], "file": "promise/src/test/java/com/iluwatar/promise/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(null));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", "identifi...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarator": "DEF...
{ "body": "public static void main(String[] args) throws InterruptedException {\n var app = new App();\n try {\n app.promiseUsage();\n } finally {\n app.stop();\n }\n }", "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signature": "public static void main(...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_441
{ "fields": [], "file": "subclass-sandbox/src/test/java/com/iluwatar/subclasssandbox/SkyLaunchTest.java", "identifier": "SkyLaunchTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testActivate() throws Exception {\n var skyLaunch = new SkyLaunch();\n var logs = tapSystemOutNormalized(skyLaunch::activate)\n .split(\"\\n\");\n final var expectedSize = 3;\n final var log1 = getLogContent(logs[0]);\n final var expectedLog1 = \"Move to ( 0.0...
{ "fields": [], "file": "subclass-sandbox/src/main/java/com/iluwatar/subclasssandbox/SkyLaunch.java", "identifier": "SkyLaunch", "interfaces": "", "methods": [ { "class_method_signature": "SkyLaunch.SkyLaunch()", "constructor": true, "full_signature": "public SkyLaunch()", "identi...
{ "body": "@Override\n protected void activate() {\n move(0, 0, 20);\n playSound(\"SKYLAUNCH_SOUND\", 1);\n spawnParticles(\"SKYLAUNCH_PARTICLE\", 100);\n }", "class_method_signature": "SkyLaunch.activate()", "constructor": false, "full_signature": "@Override protected void activate()", "identifier...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_292
{ "fields": [ { "declarator": "student1 = new Student(1, \"Ram\", \"street 9, cupertino\")", "modifier": "private final", "original_string": "private final Student student1 = new Student(1, \"Ram\", \"street 9, cupertino\");", "type": "Student", "var_name": "student1" }, { ...
{ "body": "@Test\n public void shouldNotInsertToDbIfNoRegisteredStudentsToBeCommitted() {\n context.put(UnitActions.MODIFY.getActionValue(), List.of(student1));\n context.put(UnitActions.DELETE.getActionValue(), List.of(student1));\n\n studentRepository.commit();\n\n verify(studentDatabase, never()).inse...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StudentRepository.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StudentRepository.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public void commit() {\n if (context == null || context.size() == 0) {\n return;\n }\n LOGGER.info(\"Commit started\");\n if (context.containsKey(UnitActions.INSERT.getActionValue())) {\n commitInsert();\n }\n\n if (context.containsKey(UnitActions.MODIFY.getActionVa...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_338
{ "fields": [ { "declarator": "TASK_COUNT = 128 * 1024", "modifier": "private static final", "original_string": "private static final int TASK_COUNT = 128 * 1024;", "type": "int", "var_name": "TASK_COUNT" }, { "declarator": "THREAD_COUNT = 8", "modifier": "private...
{ "body": "@Test\n public void testTimeMs() {\n for (var i = 0; i < 10; i++) {\n assertEquals(this.expectedExecutionTime * i, this.factory.apply(i).getTimeMs());\n }\n }", "class_method_signature": "TaskTest.testTimeMs()", "constructor": false, "full_signature": "@Test public void testTimeMs()", ...
{ "fields": [ { "declarator": "ID_GENERATOR = new AtomicInteger()", "modifier": "private static final", "original_string": "private static final AtomicInteger ID_GENERATOR = new AtomicInteger();", "type": "AtomicInteger", "var_name": "ID_GENERATOR" }, { "declarator": "i...
{ "body": "public int getTimeMs() {\n return timeMs;\n }", "class_method_signature": "Task.getTimeMs()", "constructor": false, "full_signature": "public int getTimeMs()", "identifier": "getTimeMs", "invocations": [], "modifiers": "public", "parameters": "()", "return": "int", "signature": "int g...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_1
{ "fields": [], "file": "strategy/src/test/java/com/iluwatar/strategy/DragonSlayerTest.java", "identifier": "DragonSlayerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGoToBattle() {\n final var strategy = mock(DragonSlayingStrategy.class);\n final var dragonSlayer = new DragonSlayer(strategy);\n\n dragonSlayer.goToBattle();\n verify(strategy).execute();\n verifyNoMoreInteractions(strategy);\n }", "class_method_signature": "Drag...
{ "fields": [ { "declarator": "strategy", "modifier": "private", "original_string": "private DragonSlayingStrategy strategy;", "type": "DragonSlayingStrategy", "var_name": "strategy" } ], "file": "strategy/src/main/java/com/iluwatar/strategy/DragonSlayer.java", "identifier"...
{ "body": "public void goToBattle() {\n strategy.execute();\n }", "class_method_signature": "DragonSlayer.goToBattle()", "constructor": false, "full_signature": "public void goToBattle()", "identifier": "goToBattle", "invocations": [ "execute" ], "modifiers": "public", "parameters": "()", "r...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_24
{ "fields": [], "file": "reader-writer-lock/src/test/java/com/iluwatar/reader/writer/lock/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWi...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "reader-writer-l...
{ "body": "public static void main(String[] args) {\n\n var executeService = Executors.newFixedThreadPool(10);\n var lock = new ReaderWriterLock();\n\n // Start writers\n for (var i = 0; i < 5; i++) {\n var writingTime = ThreadLocalRandom.current().nextLong(5000);\n executeService.submit(new Wri...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_103
{ "fields": [ { "declarator": "callsCount = new CallsCount()", "modifier": "private final", "original_string": "private final CallsCount callsCount = new CallsCount();", "type": "CallsCount", "var_name": "callsCount" } ], "file": "throttling/src/test/java/com/iluwatar/throttl...
{ "body": "@Test\n public void dummyCustomerApiTest() {\n var tenant = new Tenant(\"testTenant\", 2, callsCount);\n // In order to assure that throttling limits will not be reset, we use an empty throttling implementation\n var timer = (Throttler) () -> {\n };\n var service = new B2BService(timer, cal...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(B2BService.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(B2BService.class);", "type": "Logger", "var_name": "LOGGER" }, { "dec...
{ "body": "public int dummyCustomerApi(Tenant tenant) {\n var tenantName = tenant.getName();\n var count = callsCount.getCount(tenantName);\n LOGGER.debug(\"Counter for {} : {} \", tenant.getName(), count);\n if (count >= tenant.getAllowedCallsPerSecond()) {\n LOGGER.error(\"API access per second lim...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_416
{ "fields": [], "file": "leader-election/src/test/java/com/iluwatar/leaderelection/MessageTest.java", "identifier": "MessageTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetContent() {\n var content = \"test\";\n var message = new Message(MessageType.HEARTBEAT, content);\n assertEquals(content, message.getContent());\n }", "class_method_signature": "MessageTest.testGetContent()", "constructor": false, "full_signature": "@Test public...
{ "fields": [ { "declarator": "type", "modifier": "private", "original_string": "private MessageType type;", "type": "MessageType", "var_name": "type" }, { "declarator": "content", "modifier": "private", "original_string": "private String content;", "t...
{ "body": "public String getContent() {\n return content;\n }", "class_method_signature": "Message.getContent()", "constructor": false, "full_signature": "public String getContent()", "identifier": "getContent", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "s...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_380
{ "fields": [], "file": "layers/src/test/java/com/iluwatar/layers/entity/CakeTest.java", "identifier": "CakeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetLayers() {\n final var cake = new Cake();\n assertNotNull(cake.getLayers());\n assertTrue(cake.getLayers().isEmpty());\n\n final var expectedLayers = Set.of(\n new CakeLayer(\"layer1\", 1000),\n new CakeLayer(\"layer2\", 2000),\n new ...
{ "fields": [ { "declarator": "id", "modifier": "@Id\n @GeneratedValue\n private", "original_string": "@Id\n @GeneratedValue\n private Long id;", "type": "Long", "var_name": "id" }, { "declarator": "topping", "modifier": "@OneToOne(cascade = CascadeType.REMOVE...
{ "body": "public void setLayers(Set<CakeLayer> layers) {\n this.layers = layers;\n }", "class_method_signature": "Cake.setLayers(Set<CakeLayer> layers)", "constructor": false, "full_signature": "public void setLayers(Set<CakeLayer> layers)", "identifier": "setLayers", "invocations": [], "modifiers": ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_73
{ "fields": [], "file": "flux/src/test/java/com/iluwatar/flux/dispatcher/DispatcherTest.java", "identifier": "DispatcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetInstance() {\n assertNotNull(Dispatcher.getInstance());\n assertSame(Dispatcher.getInstance(), Dispatcher.getInstance());\n }", "class_method_signature": "DispatcherTest.testGetInstance()", "constructor": false, "full_signature": "@Test public void testGetInstance()...
{ "fields": [ { "declarator": "instance = new Dispatcher()", "modifier": "private static", "original_string": "private static Dispatcher instance = new Dispatcher();", "type": "Dispatcher", "var_name": "instance" }, { "declarator": "stores = new LinkedList<>()", "...
{ "body": "public static Dispatcher getInstance() {\n return instance;\n }", "class_method_signature": "Dispatcher.getInstance()", "constructor": false, "full_signature": "public static Dispatcher getInstance()", "identifier": "getInstance", "invocations": [], "modifiers": "public static", "paramete...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_318
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantViewTest.java...
{ "body": "@Test\n public void testDisplayGiant() {\n final var view = new GiantView();\n\n final var model = mock(GiantModel.class);\n view.displayGiant(model);\n\n assertEquals(model.toString(), appender.getLastMessage());\n assertEquals(1, appender.getLogSize());\n }", "class_method_signature": ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(GiantView.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(GiantView.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "mod...
{ "body": "public void displayGiant(GiantModel giant) {\n LOGGER.info(giant.toString());\n }", "class_method_signature": "GiantView.displayGiant(GiantModel giant)", "constructor": false, "full_signature": "public void displayGiant(GiantModel giant)", "identifier": "displayGiant", "invocations": [ "i...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_174
{ "fields": [], "file": "composite/src/test/java/com/iluwatar/composite/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n Assertions.assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutExce...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "composite/src/m...
{ "body": "public static void main(String[] args) {\n LOGGER.info(\"Message from the orcs: \");\n\n var orcMessage = new Messenger().messageFromOrcs();\n orcMessage.print();\n\n LOGGER.info(\"\\nMessage from the elves: \");\n\n var elfMessage = new Messenger().messageFromElves();\n elfMessage.print(...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_53
{ "fields": [], "file": "poison-pill/src/test/java/com/iluwatar/poison/pill/SimpleMessageTest.java", "identifier": "SimpleMessageTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUnModifiableHeaders() {\n final var message = new SimpleMessage();\n final var headers = message.getHeaders();\n assertThrows(UnsupportedOperationException.class, () -> {\n headers.put(Message.Headers.SENDER, \"test\");\n });\n }", "class_method_signature": "Sim...
{ "fields": [ { "declarator": "headers = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<Headers, String> headers = new HashMap<>();", "type": "Map<Headers, String>", "var_name": "headers" }, { "declarator": "body", "modifier":...
{ "body": "@Override\n public Map<Headers, String> getHeaders() {\n return Collections.unmodifiableMap(headers);\n }", "class_method_signature": "SimpleMessage.getHeaders()", "constructor": false, "full_signature": "@Override public Map<Headers, String> getHeaders()", "identifier": "getHeaders", "invoc...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_436
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" }, { "declarator": "method", "modifier": "private final", "original_string": "private...
{ "body": "@Test\n public void testStealTheItem() {\n assertEquals(0, appender.getLogSize());\n\n this.method.stealTheItem(this.expectedTarget);\n assertEquals(this.expectedStealMethod, appender.getLastMessage());\n assertEquals(1, appender.getLogSize());\n }", "class_method_signature": "StealingMetho...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StealingMethod.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StealingMethod.class);", "type": "Logger", "var_name": "LOGGER" } ], "f...
{ "body": "protected abstract void stealTheItem(String target);", "class_method_signature": "StealingMethod.stealTheItem(String target)", "constructor": false, "full_signature": "protected abstract void stealTheItem(String target)", "identifier": "stealTheItem", "invocations": [], "modifiers": "protected ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_123
{ "fields": [ { "declarator": "arithmetic = new HalfArithmetic(new HalfSource(), new OldSource())", "modifier": "private static final", "original_string": "private static final HalfArithmetic arithmetic = new HalfArithmetic(new HalfSource(), new OldSource());", "type": "HalfArithmetic", ...
{ "body": "@Test\n public void testSum() {\n assertEquals(0, arithmetic.sum(-1, 0, 1));\n }", "class_method_signature": "HalfArithmeticTest.testSum()", "constructor": false, "full_signature": "@Test public void testSum()", "identifier": "testSum", "invocations": [ "assertEquals", "sum" ], "...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(HalfArithmetic.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(HalfArithmetic.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public int sum(int... nums) {\n LOGGER.info(\"Arithmetic sum {}\", VERSION);\n return newSource.accumulateSum(nums);\n }", "class_method_signature": "HalfArithmetic.sum(int... nums)", "constructor": false, "full_signature": "public int sum(int... nums)", "identifier": "sum", "invocations":...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_45
{ "fields": [ { "declarator": "gameLoop", "modifier": "private", "original_string": "private FixedStepGameLoop gameLoop;", "type": "FixedStepGameLoop", "var_name": "gameLoop" } ], "file": "game-loop/src/test/java/com/iluwatar/gameloop/FixedStepGameLoopTest.java", "identifie...
{ "body": "@Test\n public void testUpdate() {\n gameLoop.update();\n Assert.assertEquals(0.01f, gameLoop.controller.getBulletPosition(), 0);\n }", "class_method_signature": "FixedStepGameLoopTest.testUpdate()", "constructor": false, "full_signature": "@Test public void testUpdate()", "identifier": "te...
{ "fields": [ { "declarator": "MS_PER_FRAME = 20", "modifier": "private static final", "original_string": "private static final long MS_PER_FRAME = 20;", "type": "long", "var_name": "MS_PER_FRAME" } ], "file": "game-loop/src/main/java/com/iluwatar/gameloop/FixedStepGameLoop.j...
{ "body": "protected void update() {\n controller.moveBullet(0.5f * MS_PER_FRAME / 1000);\n }", "class_method_signature": "FixedStepGameLoop.update()", "constructor": false, "full_signature": "protected void update()", "identifier": "update", "invocations": [ "moveBullet" ], "modifiers": "protec...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_359
{ "fields": [], "file": "mutex/src/test/java/com/iluwatar/mutex/JarTest.java", "identifier": "JarTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTakeBeans() {\n var mutex = new Mutex();\n var jar = new Jar(10, mutex);\n IntStream.range(0, 10).mapToObj(i -> jar.takeBean()).forEach(Assertions::assertTrue);\n assertFalse(jar.takeBean());\n }", "class_method_signature": "JarTest.testTakeBeans()", "constructor":...
{ "fields": [ { "declarator": "lock", "modifier": "private final", "original_string": "private final Lock lock;", "type": "Lock", "var_name": "lock" }, { "declarator": "beans", "modifier": "private", "original_string": "private int beans;", "type": "in...
{ "body": "public boolean takeBean() {\n var success = false;\n try {\n lock.acquire();\n success = beans > 0;\n if (success) {\n beans = beans - 1;\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n lock.release();\n }\n\n return success;\n }"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_420
{ "fields": [ { "declarator": "appender", "modifier": "private", "original_string": "private InMemoryAppender appender;", "type": "InMemoryAppender", "var_name": "appender" } ], "file": "private-class-data/src/test/java/com/iluwatar/privateclassdata/ImmutableStewTest.java", ...
{ "body": "@Test\n public void testMix() {\n var stew = new Stew(1, 2, 3, 4);\n var expectedMessage = \"Mixing the stew we find: 1 potatoes, 2 carrots, 3 meat and 4 peppers\";\n\n for (var i = 0; i < 20; i++) {\n stew.mix();\n assertEquals(expectedMessage, appender.getLastMessage());\n }\n\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ImmutableStew.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ImmutableStew.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public void mix() {\n LOGGER\n .info(\"Mixing the immutable stew we find: {} potatoes, {} carrots, {} meat and {} peppers\",\n data.getNumPotatoes(), data.getNumCarrots(), data.getNumMeat(), data.getNumPeppers());\n }", "class_method_signature": "ImmutableStew.mix()", "constructor...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_135
{ "fields": [ { "declarator": "shardManager", "modifier": "private", "original_string": "private ShardManager shardManager;", "type": "ShardManager", "var_name": "shardManager" } ], "file": "sharding/src/test/java/com/iluwatar/sharding/ShardManagerTest.java", "identifier": ...
{ "body": "@Test\n public void testAddNewShard() {\n try {\n var shard = new Shard(1);\n shardManager.addNewShard(shard);\n var field = ShardManager.class.getDeclaredField(\"shardMap\");\n field.setAccessible(true);\n var map = (Map<Integer, Shard>) field.get(shardManager);\n Assert....
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ShardManager.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ShardManager.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public boolean addNewShard(final Shard shard) {\n var shardId = shard.getId();\n if (!shardMap.containsKey(shardId)) {\n shardMap.put(shardId, shard);\n return true;\n } else {\n return false;\n }\n }", "class_method_signature": "ShardManager.addNewShard(final Shard shard)", ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_12
{ "fields": [], "file": "extension-objects/src/test/java/units/CommanderUnitTest.java", "identifier": "CommanderUnitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getUnitExtension() {\n final var unit = new CommanderUnit(\"CommanderUnitName\");\n\n assertNull(unit.getUnitExtension(\"SoldierExtension\"));\n assertNull(unit.getUnitExtension(\"SergeantExtension\"));\n assertNotNull(unit.getUnitExtension(\"CommanderExtension\"));\n }", ...
{ "fields": [], "file": "extension-objects/src/main/java/units/CommanderUnit.java", "identifier": "CommanderUnit", "interfaces": "", "methods": [ { "class_method_signature": "CommanderUnit.CommanderUnit(String name)", "constructor": true, "full_signature": "public CommanderUnit(String n...
{ "body": "@Override\n public UnitExtension getUnitExtension(String extensionName) {\n\n if (extensionName.equals(\"CommanderExtension\")) {\n return Optional.ofNullable(unitExtension).orElseGet(() -> new Commander(this));\n }\n\n return super.getUnitExtension(extensionName);\n }", "class_method_sig...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_162
{ "fields": [], "file": "bytecode/src/test/java/com/iluwatar/bytecode/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "bytecode/src/ma...
{ "body": "public static void main(String[] args) {\n\n var wizard = new Wizard();\n wizard.setHealth(45);\n wizard.setAgility(7);\n wizard.setWisdom(11);\n\n var vm = new VirtualMachine();\n vm.getWizards()[0] = wizard;\n\n String literal = \"LITERAL 0\";\n\n interpretInstruction(literal, vm)...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_86
{ "fields": [], "file": "factory/src/test/java/com/iluwatar/factory/CarsFactoryTest.java", "identifier": "CarsFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tvoid shouldReturnFerrariInstance() {\n\t\tfinal var ferrari = CarsFactory.getCar(CarType.FERRARI);\n\t\tassertTrue(ferrari instanceof Ferrari);\n\t}", "class_method_signature": "CarsFactoryTest.shouldReturnFerrariInstance()", "constructor": false, "full_signature": "@Test void shouldReturnFe...
{ "fields": [], "file": "factory/src/main/java/com/iluwatar/factory/CarsFactory.java", "identifier": "CarsFactory", "interfaces": "", "methods": [ { "class_method_signature": "CarsFactory.getCar(CarType type)", "constructor": false, "full_signature": "public static Car getCar(CarType typ...
{ "body": "public static Car getCar(CarType type) {\n return type.getConstructor().get();\n }", "class_method_signature": "CarsFactory.getCar(CarType type)", "constructor": false, "full_signature": "public static Car getCar(CarType type)", "identifier": "getCar", "invocations": [ "get", "getCons...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_375
{ "fields": [], "file": "eip-aggregator/src/test/java/com/iluwatar/eip/aggregator/routes/MessageAggregationStrategyTest.java", "identifier": "MessageAggregationStrategyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAggregate() {\n var mas = new MessageAggregationStrategy();\n var oldExchange = new DefaultExchange((CamelContext) null);\n oldExchange.getIn().setBody(\"TEST1\");\n\n var newExchange = new DefaultExchange((CamelContext) null);\n newExchange.getIn().setBody(\"TEST2\"...
{ "fields": [], "file": "eip-aggregator/src/main/java/com/iluwatar/eip/aggregator/routes/MessageAggregationStrategy.java", "identifier": "MessageAggregationStrategy", "interfaces": "implements AggregationStrategy", "methods": [ { "class_method_signature": "MessageAggregationStrategy.aggregate(Exchan...
{ "body": "@Override\n public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {\n if (oldExchange == null) {\n return newExchange;\n }\n\n var in1 = (String) oldExchange.getIn().getBody();\n var in2 = (String) newExchange.getIn().getBody();\n\n oldExchange.getIn().setBody(in1 + \";...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_230
{ "fields": [], "file": "partial-response/src/test/java/com/iluwatar/partialresponse/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n Assertions.assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutExce...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "partial-respons...
{ "body": "public static void main(String[] args) throws Exception {\n var videos = Map.of(\n 1, new Video(1, \"Avatar\", 178, \"epic science fiction film\",\n \"James Cameron\", \"English\"),\n 2, new Video(2, \"Godzilla Resurgence\", 120, \"Action & drama movie|\",\n \"Hideaki...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_69
{ "fields": [], "file": "flux/src/test/java/com/iluwatar/flux/store/MenuStoreTest.java", "identifier": "MenuStoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOnAction() {\n final var menuStore = new MenuStore();\n\n final var view = mock(View.class);\n menuStore.registerView(view);\n\n verifyZeroInteractions(view);\n\n // Menu should not react on content action ...\n menuStore.onAction(new ContentAction(Content.COMPANY...
{ "fields": [ { "declarator": "selected = MenuItem.HOME", "modifier": "private", "original_string": "private MenuItem selected = MenuItem.HOME;", "type": "MenuItem", "var_name": "selected" } ], "file": "flux/src/main/java/com/iluwatar/flux/store/MenuStore.java", "identifier...
{ "body": "@Override\n public void onAction(Action action) {\n if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) {\n var menuAction = (MenuAction) action;\n selected = menuAction.getMenuItem();\n notifyChange();\n }\n }", "class_method_signature": "MenuStore.onAction(Action action)"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_119
{ "fields": [ { "declarator": "source = new HalfSource()", "modifier": "private static final", "original_string": "private static final HalfSource source = new HalfSource();", "type": "HalfSource", "var_name": "source" } ], "file": "strangler/src/test/java/com/iluwatar/strang...
{ "body": "@Test\n public void testIfNonZero() {\n assertFalse(source.ifNonZero(-1, 0, 1));\n }", "class_method_signature": "HalfSourceTest.testIfNonZero()", "constructor": false, "full_signature": "@Test public void testIfNonZero()", "identifier": "testIfNonZero", "invocations": [ "assertFalse", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(HalfSource.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(HalfSource.class);", "type": "Logger", "var_name": "LOGGER" }, { "dec...
{ "body": "public boolean ifNonZero(int... nums) {\n LOGGER.info(\"Source module {}\", VERSION);\n return Arrays.stream(nums).allMatch(num -> num != 0);\n }", "class_method_signature": "HalfSource.ifNonZero(int... nums)", "constructor": false, "full_signature": "public boolean ifNonZero(int... nums)", ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_288
{ "fields": [ { "declarator": "student1 = new Student(1, \"Ram\", \"street 9, cupertino\")", "modifier": "private final", "original_string": "private final Student student1 = new Student(1, \"Ram\", \"street 9, cupertino\");", "type": "Student", "var_name": "student1" }, { ...
{ "body": "@Test\n public void shouldSaveModifiedStudentWithoutWritingToDb() {\n studentRepository.registerModified(student1);\n studentRepository.registerModified(student2);\n\n assertEquals(2, context.get(UnitActions.MODIFY.getActionValue()).size());\n verifyNoMoreInteractions(studentDatabase);\n }", ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StudentRepository.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StudentRepository.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public void registerModified(Student student) {\n LOGGER.info(\"Registering {} for modify in context.\", student.getName());\n register(student, UnitActions.MODIFY.getActionValue());\n\n }", "class_method_signature": "StudentRepository.registerModified(Student student)", "constructo...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_322
{ "fields": [], "file": "model-view-controller/src/test/java/com/iluwatar/model/view/controller/GiantControllerTest.java", "identifier": "GiantControllerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUpdateView() {\n final var model = mock(GiantModel.class);\n final var view = mock(GiantView.class);\n final var controller = new GiantController(model, view);\n\n verifyZeroInteractions(model, view);\n\n controller.updateView();\n verify(view).displayGiant(model)...
{ "fields": [ { "declarator": "giant", "modifier": "private final", "original_string": "private final GiantModel giant;", "type": "GiantModel", "var_name": "giant" }, { "declarator": "view", "modifier": "private final", "original_string": "private final Gian...
{ "body": "public void updateView() {\n this.view.displayGiant(giant);\n }", "class_method_signature": "GiantController.updateView()", "constructor": false, "full_signature": "public void updateView()", "identifier": "updateView", "invocations": [ "displayGiant" ], "modifiers": "public", "para...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_267
{ "fields": [], "file": "specification/src/test/java/com/iluwatar/specification/selector/ColorSelectorTest.java", "identifier": "ColorSelectorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testColor() {\n final var greenCreature = mock(Creature.class);\n when(greenCreature.getColor()).thenReturn(Color.GREEN);\n\n final var redCreature = mock(Creature.class);\n when(redCreature.getColor()).thenReturn(Color.RED);\n\n final var greenSelector = new ColorSelect...
{ "fields": [ { "declarator": "color", "modifier": "private final", "original_string": "private final Color color;", "type": "Color", "var_name": "color" } ], "file": "specification/src/main/java/com/iluwatar/specification/selector/ColorSelector.java", "identifier": "ColorS...
{ "body": "@Override\n public boolean test(Creature t) {\n return t.getColor().equals(color);\n }", "class_method_signature": "ColorSelector.test(Creature t)", "constructor": false, "full_signature": "@Override public boolean test(Creature t)", "identifier": "test", "invocations": [ "equals", "...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_334
{ "fields": [ { "declarator": "KEY = \"key\"", "modifier": "private static final", "original_string": "private static final String KEY = \"key\";", "type": "String", "var_name": "KEY" }, { "declarator": "VALUE = \"value\"", "modifier": "private static final", ...
{ "body": "@Test\n public void shouldIncludePropsInToString() {\n var props = Map.of(KEY, (Object) VALUE);\n var document = new DocumentImplementation(props);\n assertTrue(document.toString().contains(KEY));\n assertTrue(document.toString().contains(VALUE));\n }", "class_method_signature": "AbstractDo...
{ "fields": [ { "declarator": "properties", "modifier": "private final", "original_string": "private final Map<String, Object> properties;", "type": "Map<String, Object>", "var_name": "properties" } ], "file": "abstract-document/src/main/java/com/iluwatar/abstractdocument/Abs...
{ "body": "@Override\n public String toString() {\n var builder = new StringBuilder();\n builder.append(getClass().getName()).append(\"[\");\n properties.forEach((key, value) -> builder.append(\"[\").append(key).append(\" : \").append(value)\n .append(\"]\"));\n builder.append(\"]\");\n return ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_271
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MuteTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MuteTest.class);", "type": "Logger", "var_name": "LOGGER" }, { "declara...
{ "body": "@Test\n void muteShouldRethrowUnexpectedExceptionAsAssertionError() {\n assertThrows(AssertionError.class, () -> Mute.mute(this::methodThrowingException));\n }", "class_method_signature": "MuteTest.muteShouldRethrowUnexpectedExceptionAsAssertionError()", "constructor": false, "full_signature": "...
{ "fields": [], "file": "mute-idiom/src/main/java/com/iluwatar/mute/Mute.java", "identifier": "Mute", "interfaces": "", "methods": [ { "class_method_signature": "Mute.Mute()", "constructor": true, "full_signature": "private Mute()", "identifier": "Mute", "modifiers": "privat...
{ "body": "private Mute() {\n }", "class_method_signature": "Mute.Mute()", "constructor": true, "full_signature": "private Mute()", "identifier": "Mute", "invocations": [], "modifiers": "private", "parameters": "()", "return": "", "signature": " Mute()", "testcase": false }
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_28
{ "fields": [], "file": "property/src/test/java/com/iluwatar/property/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWith...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "property/src/ma...
{ "body": "public static void main(String[] args) {\n /* set up */\n var charProto = new Character();\n charProto.set(Stats.STRENGTH, 10);\n charProto.set(Stats.AGILITY, 10);\n charProto.set(Stats.ARMOR, 10);\n charProto.set(Stats.ATTACK_POWER, 10);\n\n var mageProto = new Character(Type.MAGE, ch...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_158
{ "fields": [], "file": "model-view-presenter/src/test/java/com/iluwatar/model/view/presenter/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()", ...
{ "fields": [], "file": "model-view-presenter/src/main/java/com/iluwatar/model/view/presenter/App.java", "identifier": "App", "interfaces": "", "methods": [ { "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signature": "public static void main(String[] ar...
{ "body": "public static void main(String[] args) {\n var loader = new FileLoader();\n var frame = new FileSelectorJFrame();\n var presenter = new FileSelectorPresenter(frame);\n presenter.setLoader(loader);\n presenter.start();\n }", "class_method_signature": "App.main(String[] args)", "construct...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_363
{ "fields": [ { "declarator": "optionalCaptor", "modifier": "@Captor\n private", "original_string": "@Captor\n private ArgumentCaptor<Optional<Exception>> optionalCaptor;", "type": "ArgumentCaptor<Optional<Exception>>", "var_name": "optionalCaptor" }, { "declarator": ...
{ "body": "@Test\n void testSuccessfulTaskWithCallback() throws Exception {\n assertTimeout(ofMillis(3000), () -> {\n // Instantiate a new executor and start a new 'null' task ...\n final var executor = new ThreadAsyncExecutor();\n\n final var result = new Object();\n when(task.call()).thenRet...
{ "fields": [ { "declarator": "idx = new AtomicInteger(0)", "modifier": "private final", "original_string": "private final AtomicInteger idx = new AtomicInteger(0);", "type": "AtomicInteger", "var_name": "idx" } ], "file": "async-method-invocation/src/main/java/com/iluwatar/a...
{ "body": "@Override\n public <T> AsyncResult<T> startProcess(Callable<T> task) {\n return startProcess(task, null);\n }", "class_method_signature": "ThreadAsyncExecutor.startProcess(Callable<T> task)", "constructor": false, "full_signature": "@Override public AsyncResult<T> startProcess(Callable<T> task)"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_90
{ "fields": [], "file": "hexagonal/src/test/java/com/iluwatar/hexagonal/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteApplicationWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n\n }", "class_method_signature": "AppTest.shouldExecuteApplicationWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteApplicationWithoutException()",...
{ "fields": [], "file": "hexagonal/src/main/java/com/iluwatar/hexagonal/App.java", "identifier": "App", "interfaces": "", "methods": [ { "class_method_signature": "App.main(String[] args)", "constructor": false, "full_signature": "public static void main(String[] args)", "identifie...
{ "body": "public static void main(String[] args) {\n\n var injector = Guice.createInjector(new LotteryTestingModule());\n\n // start new lottery round\n var administration = injector.getInstance(LotteryAdministration.class);\n administration.resetLottery();\n\n // submit some lottery tickets\n var ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_226
{ "fields": [], "file": "typeobjectpattern/src/test/java/com/iluwatar/typeobject/CandyGameTest.java", "identifier": "CandyGameTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void adjacentCellsTest() {\n var cg = new CandyGame(3, new CellPool(9));\n var arr1 = cg.adjacentCells(0, 0);\n var arr2 = cg.adjacentCells(1, 2);\n var arr3 = cg.adjacentCells(1, 1);\n assertTrue(arr1.size() == 2 && arr2.size() == 3 && arr3.size() == 4);\n }", "class_method_sign...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CandyGame.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CandyGame.class);", "type": "Logger", "var_name": "LOGGER" }, { "decla...
{ "body": "List<Cell> adjacentCells(int y, int x) {\n var adjacent = new ArrayList<Cell>();\n if (y == 0) {\n adjacent.add(this.cells[1][x]);\n }\n if (x == 0) {\n adjacent.add(this.cells[y][1]);\n }\n if (y == cells.length - 1) {\n adjacent.add(this.cells[cells.length - 2][x]);\n ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_362
{ "fields": [ { "declarator": "optionalCaptor", "modifier": "@Captor\n private", "original_string": "@Captor\n private ArgumentCaptor<Optional<Exception>> optionalCaptor;", "type": "ArgumentCaptor<Optional<Exception>>", "var_name": "optionalCaptor" }, { "declarator": ...
{ "body": "@Test\n void testSuccessfulTaskWithoutCallback() throws Exception {\n assertTimeout(ofMillis(3000), () -> {\n // Instantiate a new executor and start a new 'null' task ...\n final var executor = new ThreadAsyncExecutor();\n\n final var result = new Object();\n when(task.call()).then...
{ "fields": [ { "declarator": "idx = new AtomicInteger(0)", "modifier": "private final", "original_string": "private final AtomicInteger idx = new AtomicInteger(0);", "type": "AtomicInteger", "var_name": "idx" } ], "file": "async-method-invocation/src/main/java/com/iluwatar/a...
{ "body": "@Override\n public <T> AsyncResult<T> startProcess(Callable<T> task) {\n return startProcess(task, null);\n }", "class_method_signature": "ThreadAsyncExecutor.startProcess(Callable<T> task)", "constructor": false, "full_signature": "@Override public AsyncResult<T> startProcess(Callable<T> task)"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_91
{ "fields": [ { "declarator": "TEST_DB = \"lotteryDBTest\"", "modifier": "private static final", "original_string": "private static final String TEST_DB = \"lotteryDBTest\";", "type": "String", "var_name": "TEST_DB" }, { "declarator": "TEST_ACCOUNTS_COLLECTION = \"testA...
{ "body": "@Test\n void testSetup() {\n assertEquals(0, mongoBank.getAccountsCollection().count());\n }", "class_method_signature": "MongoBankTest.testSetup()", "constructor": false, "full_signature": "@Test void testSetup()", "identifier": "testSetup", "invocations": [ "assertEquals", "count",...
{ "fields": [ { "declarator": "DEFAULT_DB = \"lotteryDB\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_DB = \"lotteryDB\";", "type": "String", "var_name": "DEFAULT_DB" }, { "declarator": "DEFAULT_ACCOUNTS_COLLECTION = \"a...
{ "body": "public MongoCollection<Document> getAccountsCollection() {\n return accountsCollection;\n }", "class_method_signature": "MongoBank.getAccountsCollection()", "constructor": false, "full_signature": "public MongoCollection<Document> getAccountsCollection()", "identifier": "getAccountsCollection",...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_227
{ "fields": [], "file": "typeobjectpattern/src/test/java/com/iluwatar/typeobject/CandyGameTest.java", "identifier": "CandyGameTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void continueRoundTest() {\n var matrix = new Cell[2][2];\n var c1 = new Candy(\"green jelly\", \"jelly\", Type.CRUSHABLE_CANDY, 5);\n var c2 = new Candy(\"purple jelly\", \"jelly\", Type.CRUSHABLE_CANDY, 5);\n var c3 = new Candy(\"green apple\", \"apple\", Type.REWARD_FRUIT, 10);\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(CandyGame.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(CandyGame.class);", "type": "Logger", "var_name": "LOGGER" }, { "decla...
{ "body": "boolean continueRound() {\n for (var i = 0; i < this.cells.length; i++) {\n if (this.cells[cells.length - 1][i].candy.getType().equals(Type.REWARD_FRUIT)) {\n return true;\n }\n }\n for (var i = 0; i < this.cells.length; i++) {\n for (var j = 0; j < this.cells.length; j++) {\...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_159
{ "fields": [ { "declarator": "presenter", "modifier": "private", "original_string": "private FileSelectorPresenter presenter;", "type": "FileSelectorPresenter", "var_name": "presenter" }, { "declarator": "stub", "modifier": "private", "original_string": "pr...
{ "body": "@Test\n public void wiring() {\n presenter.start();\n\n assertNotNull(stub.getPresenter());\n assertTrue(stub.isOpened());\n }", "class_method_signature": "FileSelectorPresenterTest.wiring()", "constructor": false, "full_signature": "@Test public void wiring()", "identifier": "wiring", ...
{ "fields": [ { "declarator": "serialVersionUID = 1210314339075855074L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1210314339075855074L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "view"...
{ "body": "public void start() {\n view.setPresenter(this);\n view.open();\n }", "class_method_signature": "FileSelectorPresenter.start()", "constructor": false, "full_signature": "public void start()", "identifier": "start", "invocations": [ "setPresenter", "open" ], "modifiers": "public...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_335
{ "fields": [], "file": "thread-pool/src/test/java/com/iluwatar/threadpool/AppTest.java", "identifier": "AppTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void shouldExecuteWithoutException() {\n assertDoesNotThrow(() -> App.main(new String[]{}));\n }", "class_method_signature": "AppTest.shouldExecuteWithoutException()", "constructor": false, "full_signature": "@Test void shouldExecuteWithoutException()", "identifier": "shouldExecuteWith...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(App.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(App.class);", "type": "Logger", "var_name": "LOGGER" } ], "file": "thread-pool/src...
{ "body": "public static void main(String[] args) {\n\n LOGGER.info(\"Program started\");\n\n // Create a list of tasks to be executed\n var tasks = List.of(\n new PotatoPeelingTask(3),\n new PotatoPeelingTask(6),\n new CoffeeMakingTask(2),\n new CoffeeMakingTask(6),\n new ...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_270
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(MuteTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(MuteTest.class);", "type": "Logger", "var_name": "LOGGER" }, { "declara...
{ "body": "@Test\n void muteShouldRunTheCheckedRunnableAndNotThrowAnyExceptionIfCheckedRunnableDoesNotThrowAnyException() {\n assertDoesNotThrow(() -> Mute.mute(this::methodNotThrowingAnyException));\n }", "class_method_signature": "MuteTest.muteShouldRunTheCheckedRunnableAndNotThrowAnyExceptionIfCheckedRunnab...
{ "fields": [], "file": "mute-idiom/src/main/java/com/iluwatar/mute/Mute.java", "identifier": "Mute", "interfaces": "", "methods": [ { "class_method_signature": "Mute.Mute()", "constructor": true, "full_signature": "private Mute()", "identifier": "Mute", "modifiers": "privat...
{ "body": "private Mute() {\n }", "class_method_signature": "Mute.Mute()", "constructor": true, "full_signature": "private Mute()", "identifier": "Mute", "invocations": [], "modifiers": "private", "parameters": "()", "return": "", "signature": " Mute()", "testcase": false }
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_29
{ "fields": [], "file": "property/src/test/java/com/iluwatar/property/CharacterTest.java", "identifier": "CharacterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() {\n final var prototype = new Character();\n prototype.set(Stats.ARMOR, 1);\n prototype.set(Stats.AGILITY, 2);\n prototype.set(Stats.INTELLECT, 3);\n assertEquals(\"Stats:\\n - AGILITY:2\\n - ARMOR:1\\n - INTELLECT:3\\n\", prototype.toString());\n\n fin...
{ "fields": [ { "declarator": "prototype", "modifier": "private final", "original_string": "private final Prototype prototype;", "type": "Prototype", "var_name": "prototype" }, { "declarator": "properties = new HashMap<>()", "modifier": "private final", "ori...
{ "body": "@Override\n public String toString() {\n var builder = new StringBuilder();\n if (name != null) {\n builder.append(\"Player: \").append(name).append('\\n');\n }\n\n if (type != null) {\n builder.append(\"Character type: \").append(type.name()).append('\\n');\n }\n\n builder.app...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_289
{ "fields": [ { "declarator": "student1 = new Student(1, \"Ram\", \"street 9, cupertino\")", "modifier": "private final", "original_string": "private final Student student1 = new Student(1, \"Ram\", \"street 9, cupertino\");", "type": "Student", "var_name": "student1" }, { ...
{ "body": "@Test\n public void shouldSaveAllLocalChangesToDb() {\n context.put(UnitActions.INSERT.getActionValue(), List.of(student1));\n context.put(UnitActions.MODIFY.getActionValue(), List.of(student1));\n context.put(UnitActions.DELETE.getActionValue(), List.of(student1));\n\n studentRepository.commi...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(StudentRepository.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(StudentRepository.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@Override\n public void commit() {\n if (context == null || context.size() == 0) {\n return;\n }\n LOGGER.info(\"Commit started\");\n if (context.containsKey(UnitActions.INSERT.getActionValue())) {\n commitInsert();\n }\n\n if (context.containsKey(UnitActions.MODIFY.getActionVa...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...
22790488_323
{ "fields": [ { "declarator": "EXPECTED_VALUE = \"test\"", "modifier": "private static final", "original_string": "private static final String EXPECTED_VALUE = \"test\";", "type": "String", "var_name": "EXPECTED_VALUE" } ], "file": "intercepting-filter/src/test/java/com/iluwa...
{ "body": "@Test\n public void testSetName() {\n final var order = new Order();\n order.setName(EXPECTED_VALUE);\n assertEquals(EXPECTED_VALUE, order.getName());\n }", "class_method_signature": "OrderTest.testSetName()", "constructor": false, "full_signature": "@Test public void testSetName()", "id...
{ "fields": [ { "declarator": "name", "modifier": "private", "original_string": "private String name;", "type": "String", "var_name": "name" }, { "declarator": "contactNumber", "modifier": "private", "original_string": "private String contactNumber;", ...
{ "body": "public void setName(String name) {\n this.name = name;\n }", "class_method_signature": "Order.setName(String name)", "constructor": false, "full_signature": "public void setName(String name)", "identifier": "setName", "invocations": [], "modifiers": "public", "parameters": "(String name)"...
{ "created": "8/9/2014 4:45:18 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 22790488, "size": null, "stargazer_count": null, "stars": 55079, "updates": "2020-01-27T17:44:06+00:00", "url": "https://github.com/iluwatar/java-d...