id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
45257264_30
{ "fields": [ { "declarator": "boxes", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantBoxes boxes;", "type": "VagrantBoxes", "var_name": "boxes" } ], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/vagrant/VagrantBoxe...
{ "body": "@Test\n\tpublic void testGetName() {\n\t\tassertThat(boxes.getName(SystemSpecification.UBUNTU_1404), is(\"ubuntu/trusty64\"));\n\t}", "class_method_signature": "VagrantBoxesTest.testGetName()", "constructor": false, "full_signature": "@Test public void testGetName()", "identifier": "testGetName", ...
{ "fields": [ { "declarator": "BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecification.UBUNTU_1404)", "modifier": "private static final", "original_string": "private static final Map<String, SystemSpecification> BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecific...
{ "body": "public String getName(SystemSpecification spec) {\n\t\treturn REVERSE.get(spec);\n\t}", "class_method_signature": "VagrantBoxes.getName(SystemSpecification spec)", "constructor": false, "full_signature": "public String getName(SystemSpecification spec)", "identifier": "getName", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_26
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testDestroyNode() throws IOException {\n\t\tFiles.createDirectories(vagrantPath);\n\n\t\tstrategy.destroyNode(prepareNode());\n\n\t\tverify(executor).execute(vagrantPath, \"vagrant\", \"destroy\", \"-f\");\n\t\tassertFalse(vagrantPath + \" should have been deleted\", Files.exists(vagra...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic void destroyNode(Node node) throws IOException {\n\t\tPath nodePath = getPath(node);\n\t\tif (!Files.exists(nodePath)) {\n\t\t\treturn;\n\t\t}\n\t\texecutor.execute(nodePath, \"vagrant\", \"destroy\", \"-f\");\n\t\tFileUtils.deleteDirectory(nodePath.toFile());\n\t}", "class_method_sig...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_8
{ "fields": [], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/LocalCommandExecutorTest.java", "identifier": "LocalCommandExecutorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testOutput() throws IOException, InterruptedException {\n\t\tCommandExecutor executor = new LocalCommandExecutor();\n\t\tExecutionResult result = executor.tryExecute(\"echo\", \"test string!\");\n\t\tassertThat(result.getOutput().trim(), is(\"test string!\"));\n\t}", "class_method_si...
{ "fields": [ { "declarator": "logger = Logger.getLogger(LocalCommandExecutor.class)", "modifier": "private final", "original_string": "private final Logger logger = Logger.getLogger(LocalCommandExecutor.class);", "type": "Logger", "var_name": "logger" } ], "file": "bugminer-...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tlogger.debug(\"Executing `\" + StringUtils.join(cmd, ' ') + \" in \" + workingDirectory);\n\t\tFile workdir = workingDirectory == null ? null : workingDirectory.toFile();\n\t\tProcess process = Ru...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_51
{ "fields": [ { "declarator": "FILE_NAMES = {\n\t\t\"org/aspectj/ajdt/ajc/AjdtCommand.java\",\n\t\t\"org/aspectj/ajdt/ajc/BuildArgParser.java\"\n\t}", "modifier": "private static final", "original_string": "private static final String[] FILE_NAMES = {\n\t\t\"org/aspectj/ajdt/ajc/AjdtCommand.java...
{ "body": "@Test\n\tpublic void testImport() throws URISyntaxException, SAXException, IOException {\n\t\tPath file = Paths.get(getClass().getResource(\"p_cobertura.xml\").toURI());\n\t\tCoberturaImporter importer = new CoberturaImporter();\n\t\tCoverageReport report = importer.read(ImmutableList.of(file));\n\n\t\tass...
{ "fields": [ { "declarator": "files", "modifier": "private", "original_string": "private List<SourceCodeFile> files;", "type": "List<SourceCodeFile>", "var_name": "files" }, { "declarator": "filesForNames", "modifier": "private", "original_string": "private...
{ "body": "public CoverageReport read(List<Path> allCoverageFiles) throws SAXException, IOException {\n\t\t// filter empty coverage traces\n\t\tfinal List<Path> coverageFiles = allCoverageFiles\n\t\t\t\t.stream()\n\t\t\t\t.filter(f -> {\n\t\t\t\t\ttry (Stream<String> executedLines = Files.lines(f).parallel()\n\t\t\t\...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_47
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test\n\tpublic void testInstallGitSkipsIfAlreadyInstalled() throws IOException {\n\t\twhen(connection.tryExecute(\"which\", \"git\")).thenReturn(\n\t\t\t\tnew ExecutionResult(0, \"\", \"\"));\n\t\tremoteGitHelper.installGit(connection, SystemSpecification.UBUNTU_1404);\n\t\tverify(connection, never()).exe...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public void installGit(SshConnection connection, SystemSpecification os) throws IOException {\n\t\tif (isGitInstalled(connection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!SystemSpecification.UBUNTU.equals(os.getDistributionName())) {\n\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\"Only ubuntu is s...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_10
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test\n\tpublic void testVagrantConfig() {\n\t\tassumeTrue(\"Unix identitfy file path\", SystemUtils.IS_OS_UNIX);\n\t\tSshConfig config = parser.parse(VAGRANT_CONFIG);\n\t\tassertThat(config.getHost(), is(\"127.0.0.1\")); // NOPMD - hard-coded ip\n\t\tassertThat(config.getUser(), is(\"vagrant\"));\n\t\tass...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_4
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "tempDir = new TemporaryDirectory()", "modifier": "@Rule\n\tpublic", ...
{ "body": "@SuppressWarnings(\"resource\")\n\t@Test\n\tpublic void testTryExecuteIn() throws IOException {\n\t\tSession session = mock(Session.class);\n\t\twhen(client.startSession()).thenReturn(session);\n\t\tCommand command = mock(Command.class);\n\t\twhen(session.exec(\"\\\"cd\\\" \\\"/test/dir\\\" && \\\"test com...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "config", "modifier": "private final", "original_string": "private final S...
{ "body": "public ExecutionResult tryExecuteIn(String workingDirectory, String... cmd) throws IOException {\n\t\tString cmdString = escapeCommand(cmd);\n\t\tif (workingDirectory != null) {\n\t\t\tcmdString = escapeCommand(\"cd\", workingDirectory) + \" && \" + cmdString;\n\t\t}\n\n\t\ttry (Command command = client.st...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
148116142_77
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetAndIncrement() {\n\t\tMutableInt i = new MutableInt(\"1\");\n\t\tassertTrue(i.getAndIncrement() == 1);\n\t}", "class_method_signature": "MutableIntTest.testGetAndIncrement()", "constructor": false, "full_signature": "@Test public void testGetAndIncrement()", "identifier"...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "public final int getAndIncrement() {\n\t\tfinal int oldValue = value;\n\t\tthis.value++;\n\t\treturn oldValue;\n\t}", "class_method_signature": "MutableInt.getAndIncrement()", "constructor": false, "full_signature": "public final int getAndIncrement()", "identifier": "getAndIncrement", "invocatio...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_20
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void asciiSizeInBytes() throws Exception {\n\t\tlong value = Long.MIN_VALUE;\n\t\tassertTrue(StringUtils.asciiSizeInBytes(value) == String.valueOf(value).length());\n\t\tbenchmark.doSomething(\"OKIO的方案:\", () -> StringUtils.asciiSizeInBytes(value));\n\t\tbenchmark.doSomething(\"成龙的方案:\", ()...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static int asciiSizeInBytes(long v) {\n\t\tif (v == 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (v == Long.MIN_VALUE) {\n\t\t\treturn 20;\n\t\t}\n\t\tboolean negative = false;\n\t\tif (v < 0) {\n\t\t\tv = -v;\n\t\t\tnegative = true;\n\t\t}\n\t\tint width = v < 100000000L\n\t\t\t\t//\n\t\t\t\t? v < 10000L\n...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_36
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/DateUtilsTest.java", "identifier": "DateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFormatTime() {\n\t\tassertTrue(\"00:01:40\".equals(DateUtils.formatTime(100)));\n\t\tassertTrue(\"00:01:00\".equals(DateUtils.formatTime(60)));\n\t\tassertTrue(\"00:00:00\".equals(DateUtils.formatTime(0)));\n\t\tassertTrue(\"00:00:00\".equals(DateUtils.formatTime(-1)));\n\t\tassert...
{ "fields": [ { "declarator": "MILLISECOND_PER_SECOND = 1000", "modifier": "public static final", "original_string": "public static final int MILLISECOND_PER_SECOND = 1000;", "type": "int", "var_name": "MILLISECOND_PER_SECOND" }, { "declarator": "SECOND_PER_MINUTE = 60"...
{ "body": "public static String formatTime(long seconds) {\n\t\tif (seconds <= 0) {\n\t\t\treturn \"00:00:00\";\n\t\t}\n\t\t// 秒数\n\t\tint second = (int) (seconds % SECOND_PER_MINUTE);\n\t\tseconds = seconds / SECOND_PER_MINUTE;\n\t\t// 分钟\n\t\tint minute = (int) (seconds % MINUTE_PER_HOUR);\n\t\tseconds = seconds / ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_61
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testGroupingBy1() {\n\t\tassertTrue(CollectionUtils.groupingBy(list, Pet::getId).size() == MAX);\n\t}", "class_method_signature": "CollectionUtilsTest.testGroupingBy1()", "constructor": false, "full_signature": "@Test public void testGroupingBy1()", "identifier": "testGroupingB...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static <K, V> Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper) {\n\t\treturn collection.stream().collect(Collectors.groupingBy(keyMapper));\n\t}", "class_method_signature": "CollectionUtils.groupingBy(final Collection<V> collection, Function<? ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_3
{ "fields": [ { "declarator": "benchmark = new Benchmark(1)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1);", "type": "Benchmark", "var_name": "benchmark" }, { "declarator": "bean = new TestBean()", "modifie...
{ "body": "@Test\n\tpublic void testJdkReflect() throws Exception {\n\t\tbenchmark.doSomething(\"testJdkReflect:\", () -> method.invoke(bean, 1));\n\t}", "class_method_signature": "MethodAccessTest.testJdkReflect()", "constructor": false, "full_signature": "@Test public void testJdkReflect()", "identifier": "...
{ "fields": [ { "declarator": "methodNames", "modifier": "private", "original_string": "private String[] methodNames;", "type": "String[]", "var_name": "methodNames" }, { "declarator": "parameterTypes", "modifier": "private", "original_string": "private Clas...
{ "body": "abstract public Object invoke(Object object, int methodIndex, Object... args);", "class_method_signature": "MethodAccess.invoke(Object object, int methodIndex, Object... args)", "constructor": false, "full_signature": "abstract public Object invoke(Object object, int methodIndex, Object... args)", ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_82
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testAddAndGet() {\n\t\tMutableInt i = new MutableInt(0);\n\t\tassertTrue(i.addAndGet(1) == 1);\n\t}", "class_method_signature": "MutableIntTest.testAddAndGet()", "constructor": false, "full_signature": "@Test public void testAddAndGet()", "identifier": "testAddAndGet", "invoc...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "public final int addAndGet(int delta) {\n\t\treturn value += delta;\n\t}", "class_method_signature": "MutableInt.addAndGet(int delta)", "constructor": false, "full_signature": "public final int addAndGet(int delta)", "identifier": "addAndGet", "invocations": [], "modifiers": "public final", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_16
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void testIsEmpty() {\n\t\tassertTrue(StringUtils.isEmpty(\"\"));\n\t\tassertTrue(StringUtils.isEmpty(null));\n\t\tassertTrue(!StringUtils.isEmpty(\" \"));\n\t\tassertTrue(!StringUtils.isEmpty(\"test\"));\n\t\tassertTrue(!StringUtils.isEmpty(\" test \"));\n\t}", "class_method_signature": ...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static boolean isEmpty(final String text) {\n\t\treturn text == null || text.length() == 0;\n\t}", "class_method_signature": "StringUtils.isEmpty(final String text)", "constructor": false, "full_signature": "public static boolean isEmpty(final String text)", "identifier": "isEmpty", "invoc...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_41
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/ByteBufUtilsTest.java", "identifier": "ByteBufUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testWriteRawVarint32() {\n\t\tByteBuf buf = Unpooled.buffer();\n\t\tByteBufUtils.writeRawVarint32(buf, 1);\n\t\tByteBufUtils.writeRawVarint32(buf, 2);\n\t\tByteBufUtils.writeRawVarint32(buf, 111);\n\t\tByteBufUtils.writeRawVarint32(buf, 1234);\n\t\tByteBufUtils.writeRawVarint32(buf, 0)...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/ByteBufUtils.java", "identifier": "ByteBufUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteBufUtils.writeRawVarint32(ByteBuf out, int value)", "constructor": false, "full_signature": "public stat...
{ "body": "public static void writeRawVarint32(ByteBuf out, int value) {\n\t\twhile (true) {\n\t\t\tif ((value & ~0x7F) == 0) {\n\t\t\t\tout.writeByte(value);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t// 取最后7位 前面再加1\n\t\t\t\tout.writeByte((value & 0x7F) | 0x80);\n\t\t\t\tvalue >>>= 7;\n\t\t\t}\n\t\t}\n\t}", "class_...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_57
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/UnsignedUtilsTest.java", "identifier": "UnsignedUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\tshort s = -9563;\n\t\tassertTrue(UnsignedUtils.toUnsigned(s) == 55973);\n\t}", "class_method_signature": "UnsignedUtilsTest.test()", "constructor": false, "full_signature": "@Test public void test()", "identifier": "test", "invocations": [ "assertTrue", ...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/UnsignedUtils.java", "identifier": "UnsignedUtils", "interfaces": "", "methods": [ { "class_method_signature": "UnsignedUtils.toUnsigned(byte num)", "constructor": false, "full_signature": "public static int toUnsigned...
{ "body": "public static int toUnsigned(byte num) {\n\t\treturn num & 0xFF;\n\t}", "class_method_signature": "UnsignedUtils.toUnsigned(byte num)", "constructor": false, "full_signature": "public static int toUnsigned(byte num)", "identifier": "toUnsigned", "invocations": [], "modifiers": "public static", ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_56
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/SystemUtilsTest.java", "identifier": "SystemUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\t// assertTrue(SystemUtils.IS_OS_WINDOWS);\n\t\tassertTrue(SystemUtils.getPid() > 0);\n\t}", "class_method_signature": "SystemUtilsTest.test()", "constructor": false, "full_signature": "@Test public void test()", "identifier": "test", "invocations": [ "assert...
{ "fields": [ { "declarator": "OS_NAME = System.getProperty(\"os.name\")", "modifier": "public static final", "original_string": "public static final String OS_NAME = System.getProperty(\"os.name\");", "type": "String", "var_name": "OS_NAME" }, { "declarator": "IS_OS_LI...
{ "body": "public static long getPid() {\n\t\treturn Long.parseLong(getPidStr());\n\t}", "class_method_signature": "SystemUtils.getPid()", "constructor": false, "full_signature": "public static long getPid()", "identifier": "getPid", "invocations": [ "parseLong", "getPidStr" ], "modifiers": "pub...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_40
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/DateUtilsTest.java", "identifier": "DateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testToSecondsByStartOfDay() throws ParseException {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss:SSS\");\n\t\tDate d1 = sdf.parse(\"2019-02-14 00:00:00:000\");\n\t\tassertTrue(DateUtils.toSeconds(d1) == DateUtils.toSecondsByStartOfDay(LocalDate.of(2019, 02, 14...
{ "fields": [ { "declarator": "MILLISECOND_PER_SECOND = 1000", "modifier": "public static final", "original_string": "public static final int MILLISECOND_PER_SECOND = 1000;", "type": "int", "var_name": "MILLISECOND_PER_SECOND" }, { "declarator": "SECOND_PER_MINUTE = 60"...
{ "body": "public static long toSecondsByStartOfDay(LocalDate localDate) {\n\t\treturn localDate.atStartOfDay(ZoneOffset.systemDefault()).toEpochSecond();\n\t}", "class_method_signature": "DateUtils.toSecondsByStartOfDay(LocalDate localDate)", "constructor": false, "full_signature": "public static long toSecond...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_17
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void testIsNotEmpty() {\n\t\tassertTrue(!StringUtils.isNotEmpty(\"\"));\n\t\tassertTrue(!StringUtils.isNotEmpty(null));\n\t\tassertTrue(StringUtils.isNotEmpty(\" \"));\n\t\tassertTrue(StringUtils.isNotEmpty(\"test\"));\n\t\tassertTrue(StringUtils.isNotEmpty(\" test \"));\n\t}", "class_me...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static boolean isNotEmpty(final String text) {\n\t\treturn !isEmpty(text);\n\t}", "class_method_signature": "StringUtils.isNotEmpty(final String text)", "constructor": false, "full_signature": "public static boolean isNotEmpty(final String text)", "identifier": "isNotEmpty", "invocations":...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_83
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/FixedLinkedListTest.java", "identifier": "FixedLinkedListTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testAdd() {\n\t\tList<String> list = new FixedLinkedList<>(5);\n\t\tlist.add(\"1\");\n\t\tassertTrue(list.size() == 1);\n\t\tlist.add(\"2\");\n\t\tassertTrue(list.size() == 2);\n\t\tlist.add(\"3\");\n\t\tassertTrue(list.size() == 3);\n\t\tlist.add(\"4\");\n\t\tassertTrue(list.size() ==...
{ "fields": [ { "declarator": "serialVersionUID = -3640119007561657834L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = -3640119007561657834L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "len...
{ "body": "@Override\n\tpublic boolean add(E e) {\n\t\tif (size() >= length) {\n\t\t\tthis.removeFirst();\n\t\t}\n\t\treturn super.add(e);\n\t}", "class_method_signature": "FixedLinkedList.add(E e)", "constructor": false, "full_signature": "@Override public boolean add(E e)", "identifier": "add", "invocatio...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_2
{ "fields": [], "file": "noark-orm/src/test/java/xyz/noark/orm/AnnotationEntityMakerTest.java", "identifier": "AnnotationEntityMakerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMake() {\n\t\tDataModular.CheckUnderScoreCase = false;\n\n\t\tAnnotationEntityMaker maker = new AnnotationEntityMaker();\n\t\tmaker.make(Item.class);\n\t}", "class_method_signature": "AnnotationEntityMakerTest.testMake()", "constructor": false, "full_signature": "@Test public...
{ "fields": [ { "declarator": "TABLE_NAME_SET = new HashSet<>(512)", "modifier": "private static final", "original_string": "private static final HashSet<String> TABLE_NAME_SET = new HashSet<>(512);", "type": "HashSet<String>", "var_name": "TABLE_NAME_SET" }, { "declara...
{ "body": "public <T> EntityMapping<T> make(Class<T> klass) {\n\t\t// 没有Entity注解,就认为他不是一个实体对象.\n\t\tif (!klass.isAnnotationPresent(Entity.class)) {\n\t\t\tthrow new NoEntityException(klass.getName(), \"没有@Entity注解标识 ≡ (^(OO)^) ≡\");\n\t\t}\n\t\treturn makeEntity(klass);\n\t}", "class_method_signature": "AnnotationE...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_60
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testGroupingBy() {\n\t\tassertTrue(CollectionUtils.groupingBy(list, Pet::getId, Pet::getLevel).size() == MAX);\n\t}", "class_method_signature": "CollectionUtilsTest.testGroupingBy()", "constructor": false, "full_signature": "@Test public void testGroupingBy()", "identifier": "t...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static <K, V> Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper) {\n\t\treturn collection.stream().collect(Collectors.groupingBy(keyMapper));\n\t}", "class_method_signature": "CollectionUtils.groupingBy(final Collection<V> collection, Function<? ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_37
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/DateUtilsTest.java", "identifier": "DateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testToDays() throws ParseException {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss:SSS\");\n\t\t{\n\t\t\tDate d1 = sdf.parse(\"2018-12-31 00:00:00:990\");\n\t\t\tDate d2 = sdf.parse(\"2018-12-31 23:59:59:001\");\n\t\t\tassertTrue(17896 == DateUtils.toDays(d1));...
{ "fields": [ { "declarator": "MILLISECOND_PER_SECOND = 1000", "modifier": "public static final", "original_string": "public static final int MILLISECOND_PER_SECOND = 1000;", "type": "int", "var_name": "MILLISECOND_PER_SECOND" }, { "declarator": "SECOND_PER_MINUTE = 60"...
{ "body": "public static long toDays(Date date) {\n\t\treturn toDays(date.getTime() + TimeZone.getDefault().getRawOffset());\n\t}", "class_method_signature": "DateUtils.toDays(Date date)", "constructor": false, "full_signature": "public static long toDays(Date date)", "identifier": "toDays", "invocations": ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_21
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void test() throws Exception {\n\t\tString[] strings = new String[] { \"aaaaaaaaaaaaaaaaaaa\", \"bbbbbbbbbbbbbbbbbbbbbbbbb\" };\n\t\tbenchmark.doSomething(\"join:\", () -> StringUtils.build(\",\", \"{\", \"}\", strings));\n\t\tbenchmark.doSomething(\"join1:\", () -> join1(\",\", \"{\", \"}\...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static String build(String delimiter, String prefix, String suffix, String... strings) {\n\t\tint len = prefix.length() + suffix.length() + (strings.length - 1) * delimiter.length();\n\t\tfor (String str : strings) {\n\t\t\tlen += str.length();\n\t\t}\n\t\tStringBuilder result = new StringBuilder(le...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_76
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testToString() {\n\t\tMutableInt i = new MutableInt(\"1\");\n\t\tassertTrue(\"1\".equals(i.toString()));\n\t}", "class_method_signature": "MutableIntTest.testToString()", "constructor": false, "full_signature": "@Test public void testToString()", "identifier": "testToString", ...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic String toString() {\n\t\treturn Integer.toString(value);\n\t}", "class_method_signature": "MutableInt.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "toString" ], "modifiers": "@Over...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_84
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/ioc/NoarkIocTest.java", "identifier": "NoarkIocTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\tIoc ioc = new NoarkIoc(\"xyz.noark.core.ioc.demo\");\n\n\t\tBagService bagService = ioc.get(BagService.class);\n\t\tassertNotNull(bagService);\n\t\tassertNotNull(bagService.getItemService());\n\t\tassertNotNull(bagService.getVipService());\n\t\tassertNotNull(bagService.ge...
{ "fields": [ { "declarator": "singletons = new ConcurrentHashMap<>(512)", "modifier": "private final", "original_string": "private final ConcurrentHashMap<Class<?>, Object> singletons = new ConcurrentHashMap<>(512);", "type": "ConcurrentHashMap<Class<?>, Object>", "var_name": "singl...
{ "body": "@Override\n\tpublic <T> T get(Class<T> klass) {\n\t\treturn klass.cast(singletons.get(klass));\n\t}", "class_method_signature": "NoarkIoc.get(Class<T> klass)", "constructor": false, "full_signature": "@Override public T get(Class<T> klass)", "identifier": "get", "invocations": [ "cast", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_9
{ "fields": [ { "declarator": "scanner", "modifier": "private", "original_string": "private DfaScanner scanner;", "type": "DfaScanner", "var_name": "scanner" } ], "file": "noark-game/src/test/java/xyz/noark/game/dfa/DfaScannerTest.java", "identifier": "DfaScannerTest", "i...
{ "body": "@Test\n\tpublic void testContains() {\n\t\tassertTrue(scanner.contains(\"淘64宝64交64易\"));\n\t\tassertTrue(scanner.contains(\"淘宝交易\"));\n\t\tassertTrue(scanner.contains(\"taobao交易\"));\n\t\tassertTrue(scanner.contains(\"TaoBao交易\"));\n\t\tassertTrue(scanner.contains(\"taobao交易\"));\n\t\tassertTrue(scanner.co...
{ "fields": [ { "declarator": "SBC_CHAR_START = 65281", "modifier": "private static final", "original_string": "private static final char SBC_CHAR_START = 65281;", "type": "char", "var_name": "SBC_CHAR_START" }, { "declarator": "SBC_CHAR_END = 65374", "modifier": ...
{ "body": "public boolean contains(final String text) {\n\t\treturn this.analysis(text, 1, false).isExist();\n\t}", "class_method_signature": "DfaScanner.contains(final String text)", "constructor": false, "full_signature": "public boolean contains(final String text)", "identifier": "contains", "invocations...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_10
{ "fields": [ { "declarator": "scanner", "modifier": "private", "original_string": "private DfaScanner scanner;", "type": "DfaScanner", "var_name": "scanner" } ], "file": "noark-game/src/test/java/xyz/noark/game/dfa/DfaScannerTest.java", "identifier": "DfaScannerTest", "i...
{ "body": "@Test\n\tpublic void testReplace() {\n\t\tassertTrue(scanner.replace(\"64淘44交64易94宝66\").equals(\"**淘44交**易94宝66\"));\n\t\tassertTrue(scanner.replace(\"日淘交易宝\").equals(\"*淘交易宝\"));\n\t\tassertTrue(scanner.replace(\"淘交易宝\").equals(\"淘交易宝\"));\n\t\tassertTrue(scanner.replace(\"淘宝交易\").equals(\"**交易\"));\n\t\...
{ "fields": [ { "declarator": "SBC_CHAR_START = 65281", "modifier": "private static final", "original_string": "private static final char SBC_CHAR_START = 65281;", "type": "char", "var_name": "SBC_CHAR_START" }, { "declarator": "SBC_CHAR_END = 65374", "modifier": ...
{ "body": "public String replace(final String text) {\n\t\treturn this.analysis(text, 0, true).getText();\n\t}", "class_method_signature": "DfaScanner.replace(final String text)", "constructor": false, "full_signature": "public String replace(final String text)", "identifier": "replace", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_47
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/RandomUtilsTest.java", "identifier": "RandomUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testRandomListListOfT() {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tassertTrue(RandomUtils.randomList(list) == null);\n\n\t\tlist.add(1);\n\t\tassertTrue(RandomUtils.randomList(list) == 1);\n\t}", "class_method_signature": "RandomUtilsTest.testRandomListListOfT()", "constru...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/RandomUtils.java", "identifier": "RandomUtils", "interfaces": "", "methods": [ { "class_method_signature": "RandomUtils.nextBoolean()", "constructor": false, "full_signature": "public static boolean nextBoolean()", ...
{ "body": "public static <T> T randomList(List<T> list) {\n\t\t// 没有东东的集合,随机个毛线啊...\n\t\tif (list == null || list.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn list.get(nextInt(list.size()));\n\t}", "class_method_signature": "RandomUtils.randomList(List<T> list)", "constructor": false, "full_signature": "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_51
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMultiplyExactIntInt() {\n\t\tassertTrue(MathUtils.multiplyExact(2, 2) == 4);\n\t\tassertTrue(MathUtils.multiplyExact(2, Integer.MAX_VALUE) == Integer.MAX_VALUE);\n\t}", "class_method_signature": "MathUtilsTest.testMultiplyExactIntInt()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static int multiplyExact(int x, int y) {\n\t\ttry {\n\t\t\treturn Math.multiplyExact(x, y);\n\t\t} catch (ArithmeticException e) {\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t}", "class_method_signature": "MathUtils.multiplyExact(int x, int y)", "constructor": false, "full_signature": "public s...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_71
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFloatValue() {\n\t\tMutableInt i = new MutableInt(1);\n\t\tassertTrue(i.floatValue() == 1F);\n\t}", "class_method_signature": "MutableIntTest.testFloatValue()", "constructor": false, "full_signature": "@Test public void testFloatValue()", "identifier": "testFloatValue", "...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic float floatValue() {\n\t\treturn value;\n\t}", "class_method_signature": "MutableInt.floatValue()", "constructor": false, "full_signature": "@Override public float floatValue()", "identifier": "floatValue", "invocations": [], "modifiers": "@Override public", "parameters": ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_26
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testScanAllField() {\n\t\tassertTrue(FieldUtils.scanAllField(FieldUtilsTest.class, Arrays.asList(TplAttr.class)).length == 1);\n\t}", "class_method_signature": "FieldUtilsTest.testScanAllField()", "constructor": false, "full_signature": "@Test public void testScanAllField()", "...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static Field[] scanAllField(final Class<?> klass, List<Class<? extends Annotation>> annotations) {\n\t\t// 为了返回是有序的添加过程,这里使用LinkedHashMap\n\t\tMap<String, Field> fieldMap = new LinkedHashMap<String, Field>();\n\t\tscanField(klass, fieldMap, annotations);\n\t\treturn fieldMap.values().toArray(new Fie...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_30
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testInjectionStaticField() {\n\t\tMap<String, String> config = new HashMap<>(2);\n\t\tconfig.put(\"name\", \"haha\");\n\t\tFieldUtils.injectionStaticField(config, FieldUtilsTest.class, String::toString);\n\t\tassertTrue(\"haha\".equals(FieldUtilsTest.name));\n\t}", "class_method_sign...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static <T> void injectionStaticField(Map<String, T> templates, Class<?> target, Function<T, String> fun) {\n\t\tfor (Field field : target.getFields()) {\n\t\t\tTplAttr attr = field.getAnnotation(TplAttr.class);\n\t\t\tif (attr != null) {\n\t\t\t\tif (!Modifier.isStatic(field.getModifiers())) {\n\t\t...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_67
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/IntRangeTest.java", "identifier": "IntRangeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testContains() {\n\t\tIntRange range = new IntRange(\"1,3,4-6,8\");\n\t\tassertFalse(range.contains(0));\n\t\tassertTrue(range.contains(1));\n\t\tassertFalse(range.contains(2));\n\t\tassertTrue(range.contains(3));\n\t\tassertTrue(range.contains(4));\n\t\tassertTrue(range.contains(5));\...
{ "fields": [ { "declarator": "sectionList = new LinkedList<>()", "modifier": "private final", "original_string": "private final List<IntSection> sectionList = new LinkedList<>();", "type": "List<IntSection>", "var_name": "sectionList" } ], "file": "noark-core/src/main/java/x...
{ "body": "public boolean contains(final int element) {\n\t\treturn sectionList.stream().filter(v -> v.contains(element)).findFirst().isPresent();\n\t}", "class_method_signature": "IntRange.contains(final int element)", "constructor": false, "full_signature": "public boolean contains(final int element)", "ide...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_5
{ "fields": [], "file": "noark-xml/src/test/java/xyz/noark/xml/XmlTest.java", "identifier": "XmlTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() throws ParserConfigurationException, SAXException, IOException {\n\t\tMapTemplate template = Xml.load(MapTemplate.class);\n\t\tassertTrue(template.getId() == 10000);\n\t\tassertTrue(\"中文\".equals(template.getName()));\n\n\t\tGameConfig config = Xml.load(GameConfig.class);\n\t\ta...
{ "fields": [], "file": "noark-xml/src/main/java/xyz/noark/xml/Xml.java", "identifier": "Xml", "interfaces": "", "methods": [ { "class_method_signature": "Xml.load(Class<T> klass)", "constructor": false, "full_signature": "public static T load(Class<T> klass)", "identifier": "load"...
{ "body": "public static <T> T load(Class<T> klass) {\n\t\tTplFile file = klass.getAnnotation(TplFile.class);\n\t\tif (file == null) {\n\t\t\tthrow new TplConfigurationException(\"这不是XML格式的配置文件类:\" + klass.getName());\n\t\t}\n\n\t\ttry (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStre...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_4
{ "fields": [ { "declarator": "benchmark = new Benchmark(1)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1);", "type": "Benchmark", "var_name": "benchmark" }, { "declarator": "bean = new TestBean()", "modifie...
{ "body": "@Test\n\tpublic void testReflectAsm() throws Exception {\n\t\tbenchmark.doSomething(\"testReflectAsm:\", () -> access.invoke(bean, methodIndex, 1));\n\t}", "class_method_signature": "MethodAccessTest.testReflectAsm()", "constructor": false, "full_signature": "@Test public void testReflectAsm()", "i...
{ "fields": [ { "declarator": "methodNames", "modifier": "private", "original_string": "private String[] methodNames;", "type": "String[]", "var_name": "methodNames" }, { "declarator": "parameterTypes", "modifier": "private", "original_string": "private Clas...
{ "body": "abstract public Object invoke(Object object, int methodIndex, Object... args);", "class_method_signature": "MethodAccess.invoke(Object object, int methodIndex, Object... args)", "constructor": false, "full_signature": "abstract public Object invoke(Object object, int methodIndex, Object... args)", ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_66
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testSumByLong() {\n\t\tList<Long> list = new ArrayList<>();\n\t\tlist.add(0L);\n\t\tlist.add(2L);\n\t\tlist.add(3L);\n\t\tassertTrue(CollectionUtils.sumByLong(list) == 5);\n\t}", "class_method_signature": "CollectionUtilsTest.testSumByLong()", "constructor": false, "full_signatur...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static long sumByLong(Collection<Long> collection) {\n\t\tlong sum = 0;\n\t\tfor (long i : collection) {\n\t\t\tsum += i;\n\t\t}\n\t\treturn sum;\n\t}", "class_method_signature": "CollectionUtils.sumByLong(Collection<Long> collection)", "constructor": false, "full_signature": "public static lo...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_31
{ "fields": [ { "declarator": "test2", "modifier": "private", "original_string": "private int test2;", "type": "int", "var_name": "test2" } ], "file": "noark-core/src/test/java/xyz/noark/core/util/MethodUtilsTest.java", "identifier": "MethodUtilsTest", "interfaces": "", ...
{ "body": "@Test\n\tpublic void testExistSetMethod() {\n\t\tassertTrue(MethodUtils.existSetMethod(MethodUtilsTest.class));\n\t}", "class_method_signature": "MethodUtilsTest.testExistSetMethod()", "constructor": false, "full_signature": "@Test public void testExistSetMethod()", "identifier": "testExistSetMetho...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/MethodUtils.java", "identifier": "MethodUtils", "interfaces": "", "methods": [ { "class_method_signature": "MethodUtils.invoke(final Object target, final Method method, final Object... args)", "constructor": false, "fu...
{ "body": "public static boolean existSetMethod(Class<?> klass) {\n\t\tfor (Class<?> target = klass; target != Object.class; target = target.getSuperclass()) {\n\t\t\tfor (Method method : target.getDeclaredMethods()) {\n\t\t\t\tif (method.getName().startsWith(\"set\")) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_27
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testReadField() {\n\t\tFieldUtilsTest test = new FieldUtilsTest();\n\t\tassertTrue(FieldUtils.readField(test, FieldUtils.getField(FieldUtilsTest.class, \"test1\")).equals(0));\n\t}", "class_method_signature": "FieldUtilsTest.testReadField()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static Object readField(final Object target, final Field field) {\n\t\tif (!field.isAccessible()) {\n\t\t\tfield.setAccessible(true);\n\t\t}\n\t\ttry {\n\t\t\treturn field.get(target);\n\t\t} catch (IllegalArgumentException | IllegalAccessException e) {\n\t\t\tthrow new ServerBootstrapException(targ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_70
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testLongValue() {\n\t\tMutableInt i = new MutableInt(1);\n\t\tassertTrue(i.longValue() == 1L);\n\t}", "class_method_signature": "MutableIntTest.testLongValue()", "constructor": false, "full_signature": "@Test public void testLongValue()", "identifier": "testLongValue", "invoc...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic long longValue() {\n\t\treturn value;\n\t}", "class_method_signature": "MutableInt.longValue()", "constructor": false, "full_signature": "@Override public long longValue()", "identifier": "longValue", "invocations": [], "modifiers": "@Override public", "parameters": "()", ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_50
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testAddExactLongLong() {\n\t\tassertTrue(MathUtils.addExact(1L, 1L) == 2);\n\t\tassertTrue(MathUtils.addExact(1, Long.MAX_VALUE) == Long.MAX_VALUE);\n\t}", "class_method_signature": "MathUtilsTest.testAddExactLongLong()", "constructor": false, "full_signature": "@Test public void...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static int addExact(int x, int y) {\n\t\ttry {\n\t\t\treturn Math.addExact(x, y);\n\t\t} catch (ArithmeticException e) {\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t}", "class_method_signature": "MathUtils.addExact(int x, int y)", "constructor": false, "full_signature": "public static int addEx...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_46
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/RandomUtilsTest.java", "identifier": "RandomUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testNextIntInt() {\n\t\tassertTrue(RandomUtils.nextInt(1, 2) == 1);\n\t\tassertTrue(RandomUtils.nextInt(0, 2) >= 0);\n\t}", "class_method_signature": "RandomUtilsTest.testNextIntInt()", "constructor": false, "full_signature": "@Test public void testNextIntInt()", "identifier": ...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/RandomUtils.java", "identifier": "RandomUtils", "interfaces": "", "methods": [ { "class_method_signature": "RandomUtils.nextBoolean()", "constructor": false, "full_signature": "public static boolean nextBoolean()", ...
{ "body": "public static int nextInt(int bound) {\n\t\treturn ThreadLocalRandom.current().nextInt(bound);\n\t}", "class_method_signature": "RandomUtils.nextInt(int bound)", "constructor": false, "full_signature": "public static int nextInt(int bound)", "identifier": "nextInt", "invocations": [ "nextInt"...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_8
{ "fields": [ { "declarator": "benchmark = new Benchmark()", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark();", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-benchmark/src/test/java/xyz/noark/benchmark/Be...
{ "body": "@Test\n\tpublic void test() throws Exception {\n\t\tbenchmark.doSomething(\"string-->int:\", () -> Integer.parseInt(\"1\"));\n\t\tbenchmark.doSomething(\"int-->string:\", () -> String.valueOf(1));\n\t}", "class_method_signature": "BenchmarkTest.test()", "constructor": false, "full_signature": "@Test ...
{ "fields": [ { "declarator": "PREHEATING_TIMES = 100", "modifier": "private static final", "original_string": "private static final int PREHEATING_TIMES = 100;", "type": "int", "var_name": "PREHEATING_TIMES" }, { "declarator": "times", "modifier": "private final"...
{ "body": "public void doSomething(String name, BenchmarkCallback callback) throws Exception {\n\t\t// 预热100次\n\t\tfor (int i = 0; i < PREHEATING_TIMES; i++) {\n\t\t\tcallback.doSomething();\n\t\t}\n\n\t\t// 计时,跑测试\n\t\tlong start = System.nanoTime();\n\t\tfor (int i = 0; i < times; i++) {\n\t\t\tcallback.doSomething...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_11
{ "fields": [ { "declarator": "scanner", "modifier": "private", "original_string": "private DfaScanner scanner;", "type": "DfaScanner", "var_name": "scanner" } ], "file": "noark-game/src/test/java/xyz/noark/game/dfa/DfaScannerTest.java", "identifier": "DfaScannerTest", "i...
{ "body": "@Test\n\tpublic void testFind() {\n\t\tassertTrue(scanner.find(\"淘交64易宝\").isPresent());\n\t\tassertTrue(!scanner.find(\"淘交易宝\").isPresent());\n\t\tscanner.find(\"淘宝交易\").ifPresent(v -> assertTrue(\"淘宝\".equals(v)));\n\t\tscanner.find(\"taobao交易\").ifPresent(v -> assertTrue(\"taobao\".equals(v)));\n\t\tsca...
{ "fields": [ { "declarator": "SBC_CHAR_START = 65281", "modifier": "private static final", "original_string": "private static final char SBC_CHAR_START = 65281;", "type": "char", "var_name": "SBC_CHAR_START" }, { "declarator": "SBC_CHAR_END = 65374", "modifier": ...
{ "body": "public Optional<String> find(final String text) {\n\t\treturn this.analysis(text, 1, false).getWords().stream().findFirst();\n\t}", "class_method_signature": "DfaScanner.find(final String text)", "constructor": false, "full_signature": "public Optional<String> find(final String text)", "identifier"...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_85
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/ioc/scan/ResourceScanningTest.java", "identifier": "ResourceScanningTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\tList<Resource> rs = new ArrayList<>();\n\t\tResourceScanning.scanPackage(new String[] { \"xyz.noark.core.ioc.scan\" }, (r) -> rs.add(r));\n\t\tassertTrue(!rs.isEmpty());\n\t}", "class_method_signature": "ResourceScanningTest.test()", "constructor": false, "full_sign...
{ "fields": [ { "declarator": "URL_PROTOCOL_FILE = \"file\"", "modifier": "private static final", "original_string": "private static final String URL_PROTOCOL_FILE = \"file\";", "type": "String", "var_name": "URL_PROTOCOL_FILE" }, { "declarator": "URL_PROTOCOL_JAR = \"j...
{ "body": "public static void scanPackage(String[] packages, ResourceCallback callback) {\n\t\tfor (String packagePath : packages) {\n\t\t\tscanPackage(packagePath, callback);\n\t\t}\n\t}", "class_method_signature": "ResourceScanning.scanPackage(String[] packages, ResourceCallback callback)", "constructor": false...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_53
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testDistance() {\n\t\tassertTrue(MathUtils.distance(0, 0, 3, 4) == 5.0D);\n\t\tassertTrue(MathUtils.distance(0.0D, 0.0D, 3.0D, 4.0D) == 5.0D);\n\t\tassertTrue(MathUtils.distance(Point.valueOf(0, 0), Point.valueOf(3, 4)) == 5.0D);\n\t}", "class_method_signature": "MathUtilsTest.testDi...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static double distance(int x1, int y1, int x2, int y2) {\n\t\tfinal double x = Math.abs(x1 - x2);\n\t\tfinal double y = Math.abs(y1 - y2);\n\t\treturn Math.sqrt(x * x + y * y);\n\t}", "class_method_signature": "MathUtils.distance(int x1, int y1, int x2, int y2)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_45
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MapUtilsTest.java", "identifier": "MapUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testAddValue() {\n\t\tMap<Integer, Integer> map = new HashMap<>(16);\n\t\tassertTrue(MapUtils.addValue(map, 1, 0) == 0);\n\t\tassertTrue(MapUtils.addValue(map, 1, 1) == 1);\n\t\tassertTrue(MapUtils.addValue(map, 1, 1) == 2);\n\t\tassertTrue(MapUtils.addValue(map, 1, 0) == 2);\n\t}", ...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/MapUtils.java", "identifier": "MapUtils", "interfaces": "", "methods": [ { "class_method_signature": "MapUtils.isEmpty(final Map<?, ?> map)", "constructor": false, "full_signature": "public static boolean isEmpty(final...
{ "body": "public static <K> Integer addValue(Map<K, Integer> source, K key, int value) {\n\t\treturn source.compute(key, (k, v) -> v == null ? value : value + v);\n\t}", "class_method_signature": "MapUtils.addValue(Map<K, Integer> source, K key, int value)", "constructor": false, "full_signature": "public stat...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_12
{ "fields": [ { "declarator": "scanner", "modifier": "private", "original_string": "private DfaScanner scanner;", "type": "DfaScanner", "var_name": "scanner" } ], "file": "noark-game/src/test/java/xyz/noark/game/dfa/DfaScannerTest.java", "identifier": "DfaScannerTest", "i...
{ "body": "@Test\n\tpublic void testFindAll() {\n\t\tassertTrue(!scanner.findAll(\"64淘交易宝\").isEmpty());\n\t\tassertTrue(!scanner.findAll(\"日淘交易宝\").isEmpty());\n\t\tassertTrue(scanner.findAll(\"出vs售taobao交易\").size() == 2);\n\t\tassertTrue(scanner.findAll(\"交a易TaoBao交易taobao\").size() == 2);\n\t\tassertTrue(scanner....
{ "fields": [ { "declarator": "SBC_CHAR_START = 65281", "modifier": "private static final", "original_string": "private static final char SBC_CHAR_START = 65281;", "type": "char", "var_name": "SBC_CHAR_START" }, { "declarator": "SBC_CHAR_END = 65374", "modifier": ...
{ "body": "public List<String> findAll(final String text) {\n\t\treturn this.analysis(text, 0, false).getWords();\n\t}", "class_method_signature": "DfaScanner.findAll(final String text)", "constructor": false, "full_signature": "public List<String> findAll(final String text)", "identifier": "findAll", "invo...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_69
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIntValue() {\n\t\tMutableInt i = new MutableInt(1);\n\t\tassertTrue(i.intValue() == 1);\n\t}", "class_method_signature": "MutableIntTest.testIntValue()", "constructor": false, "full_signature": "@Test public void testIntValue()", "identifier": "testIntValue", "invocations...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic int intValue() {\n\t\treturn value;\n\t}", "class_method_signature": "MutableInt.intValue()", "constructor": false, "full_signature": "@Override public int intValue()", "identifier": "intValue", "invocations": [], "modifiers": "@Override public", "parameters": "()", "ret...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_28
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testGetField() {\n\t\tassertTrue(FieldUtils.getField(FieldUtilsTest.class, \"test1\") != null);\n\t\tassertTrue(FieldUtils.getField(FieldUtilsTest.class, \"test2\") != null);\n\t\tassertTrue(FieldUtils.getField(FieldUtilsTest.class, \"testx\") == null);\n\t}", "class_method_signature...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static Field getField(final Class<?> klass, String fieldName) {\n\t\tfor (Class<?> target = klass; target != Object.class; target = target.getSuperclass()) {\n\t\t\tfor (Field field : target.getDeclaredFields()) {\n\t\t\t\tif (field.getName().equals(fieldName)) {\n\t\t\t\t\treturn field;\n\t\t\t\t}\...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_49
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testAddExactIntInt() {\n\t\tassertTrue(MathUtils.addExact(1, 1) == 2);\n\t\tassertTrue(MathUtils.addExact(1, Integer.MAX_VALUE) == Integer.MAX_VALUE);\n\t}", "class_method_signature": "MathUtilsTest.testAddExactIntInt()", "constructor": false, "full_signature": "@Test public void...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static int addExact(int x, int y) {\n\t\ttry {\n\t\t\treturn Math.addExact(x, y);\n\t\t} catch (ArithmeticException e) {\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t}", "class_method_signature": "MathUtils.addExact(int x, int y)", "constructor": false, "full_signature": "public static int addEx...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_7
{ "fields": [ { "declarator": "MAX = 5", "modifier": "private static final", "original_string": "private static final int MAX = 5;", "type": "int", "var_name": "MAX" } ], "file": "noark-network/src/test/java/xyz/noark/network/IpManagerTest.java", "identifier": "IpManagerTes...
{ "body": "@Test\n\tpublic void activityTest() {\n\t\tIpManager manager = new IpManager();\n\t\tOldIpManger oldManger = new OldIpManger();\n\t\tfor (int i = 0; i < MAX; i++) {\n\t\t\tString ip = String.valueOf(i);\n\t\t\tassertEquals(oldManger.active(ip), manager.active(ip));\n\t\t}\n\t}", "class_method_signature":...
{ "fields": [ { "declarator": "COUNTS = new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, Integer> COUNTS = new ConcurrentHashMap<>();", "type": "Map<String, Integer>", "var_name": "COUNTS" } ], "file": "noark...
{ "body": "public int active(String ip) {\n\t\treturn COUNTS.merge(ip, 1, Integer::sum);\n\t}", "class_method_signature": "IpManager.active(String ip)", "constructor": false, "full_signature": "public int active(String ip)", "identifier": "active", "invocations": [ "merge" ], "modifiers": "public", ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_65
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testSumByInt() {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(0);\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tassertTrue(CollectionUtils.sumByInt(list) == 5);\n\t}", "class_method_signature": "CollectionUtilsTest.testSumByInt()", "constructor": false, "full_signature":...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static int sumByInt(Collection<Integer> collection) {\n\t\tint sum = 0;\n\t\tfor (int i : collection) {\n\t\t\tsum += i;\n\t\t}\n\t\treturn sum;\n\t}", "class_method_signature": "CollectionUtils.sumByInt(Collection<Integer> collection)", "constructor": false, "full_signature": "public static i...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_32
{ "fields": [ { "declarator": "BENCHMARK = new Benchmark(1000)", "modifier": "private final static", "original_string": "private final static Benchmark BENCHMARK = new Benchmark(1000);", "type": "Benchmark", "var_name": "BENCHMARK" }, { "declarator": "MAX = 10000", ...
{ "body": "@Test\n\tpublic void test() throws Exception {\n\t\tBENCHMARK.doSomething(\"code1:\", () -> IdCodeUtils.toCode(Long.MAX_VALUE));\n\t}", "class_method_signature": "IdCodeUtilsTest.test()", "constructor": false, "full_signature": "@Test public void test()", "identifier": "test", "invocations": [ ...
{ "fields": [ { "declarator": "CHARS = { \n\t\t\t'2', '3', '4', '5', '6', '7', '8', '9', \n\t\t\t'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', \n\t\t\t'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', \n\t\t\t'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', \n\t}", "modifier": "private final static", "original_string": ...
{ "body": "public static String toCode(long id) {\n\t\tchar[] buf = new char[13];\n\t\tint index = buf.length - 1;\n\t\twhile (id >= CODE_CHARS_LENGTH) {\n\t\t\tbuf[index--] = CHARS[(int) (id % CODE_CHARS_LENGTH)];\n\t\t\tid >>>= 5;\n\t\t}\n\t\tbuf[index] = CHARS[(int) (id)];\n\t\treturn new String(buf, index, (buf.l...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_24
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testGenGetMethodName() {\n\t\tassertTrue(\"getTest1\".equals(FieldUtils.genGetMethodName(FieldUtils.getField(FieldUtilsTest.class, \"test1\"))));\n\t}", "class_method_signature": "FieldUtilsTest.testGenGetMethodName()", "constructor": false, "full_signature": "@Test public void t...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static String genGetMethodName(Field field) {\n\t\tint len = field.getName().length();\n\t\tif (field.getType() == boolean.class) {\n\t\t\tStringBuilder sb = new StringBuilder(len + 2);\n\t\t\tsb.append(\"is\").append(field.getName());\n\t\t\tif (Character.isLowerCase(sb.charAt(PREFIX_IS_METHOD_INDE...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_73
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMutableIntString() {\n\t\tMutableInt i = new MutableInt(\"1\");\n\t\tassertTrue(i.intValue() == 1);\n\t}", "class_method_signature": "MutableIntTest.testMutableIntString()", "constructor": false, "full_signature": "@Test public void testMutableIntString()", "identifier": "t...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic int intValue() {\n\t\treturn value;\n\t}", "class_method_signature": "MutableInt.intValue()", "constructor": false, "full_signature": "@Override public int intValue()", "identifier": "intValue", "invocations": [], "modifiers": "@Override public", "parameters": "()", "ret...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_72
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testDoubleValue() {\n\t\tMutableInt i = new MutableInt(1);\n\t\tassertTrue(i.doubleValue() == 1D);\n\t}", "class_method_signature": "MutableIntTest.testDoubleValue()", "constructor": false, "full_signature": "@Test public void testDoubleValue()", "identifier": "testDoubleValue"...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic double doubleValue() {\n\t\treturn value;\n\t}", "class_method_signature": "MutableInt.doubleValue()", "constructor": false, "full_signature": "@Override public double doubleValue()", "identifier": "doubleValue", "invocations": [], "modifiers": "@Override public", "paramet...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_25
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testGenSetMethodName() {\n\t\tassertTrue(\"setTest1\".equals(FieldUtils.genSetMethodName(FieldUtils.getField(FieldUtilsTest.class, \"test1\"))));\n\t}", "class_method_signature": "FieldUtilsTest.testGenSetMethodName()", "constructor": false, "full_signature": "@Test public void t...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static String genSetMethodName(Field field) {\n\t\tint len = field.getName().length();\n\t\tStringBuilder sb = new StringBuilder(len + 3);\n\t\tsb.append(\"set\").append(field.getName());\n\t\tif (Character.isLowerCase(sb.charAt(PREFIX_SET_METHOD_INDEX))) {\n\t\t\tsb.setCharAt(PREFIX_SET_METHOD_INDE...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_33
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/IpUtilsTest.java", "identifier": "IpUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIpToLong() {\n\t\tassertTrue(2130706433 == IpUtils.ipToLong(\"127.0.0.1\"));\n\t}", "class_method_signature": "IpUtilsTest.testIpToLong()", "constructor": false, "full_signature": "@Test public void testIpToLong()", "identifier": "testIpToLong", "invocations": [ "asse...
{ "fields": [ { "declarator": "A_BEGIN = ipToLong(\"10.0.0.0\")", "modifier": "private static", "original_string": "private static long A_BEGIN = ipToLong(\"10.0.0.0\");", "type": "long", "var_name": "A_BEGIN" }, { "declarator": "A_END = ipToLong(\"10.255.255.255\")", ...
{ "body": "public static long ipToLong(String ipAddress) {\n\t\tfinal String[] array = StringUtils.split(ipAddress, \".\");\n\t\tlong result = 0;\n\t\tfor (int i = IP_LOOP_NUM; i >= 0; i--) {\n\t\t\tresult |= Long.parseLong(array[3 - i]) << (i * 8);\n\t\t}\n\t\treturn result;\n\t}", "class_method_signature": "IpUti...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_64
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testMatching2() {\n\t\tassertTrue(CollectionUtils.matching(list, Pet::getLevel, 0).orElse(null).getId() == 0);\n\t\tassertTrue(CollectionUtils.matching(list, Pet::getLevel, 1).orElse(null).getId() == 0);\n\t\tassertTrue(CollectionUtils.matching(list, Pet::getLevel, 25).orElse(null).get...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static <V> Optional<V> matching(final Collection<V> collection, Function<V, ? extends Long> keyMapper, long value) {\n\t\treturn collection.stream().filter(v -> keyMapper.apply(v) <= value).max(Comparator.comparing(keyMapper));\n\t}", "class_method_signature": "CollectionUtils.matching(final Colle...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_6
{ "fields": [], "file": "noark-csv/src/test/java/xyz/noark/csv/CsvTest.java", "identifier": "CsvTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\tConvertManager.getInstance().register(RewardConverter.class);\n\t\tCsv csv = new Csv('\t');\n\t\tFile file = new File(\"src/test/resources/\");\n\t\tList<ItemTemplate> ts = csv.loadAll(file.getAbsolutePath(), ItemTemplate.class);\n\t\tassertTrue(ts.size() == 22);\n\n\t\tL...
{ "fields": [ { "declarator": "convertManager = ConvertManager.getInstance()", "modifier": "private final", "original_string": "private final ConvertManager convertManager = ConvertManager.getInstance();", "type": "ConvertManager", "var_name": "convertManager" }, { "dec...
{ "body": "public <T> List<T> loadAll(String templatePath, Class<T> klass) {\n\t\treturn loadAll(templatePath, StringUtils.EMPTY, klass);\n\t}", "class_method_signature": "Csv.loadAll(String templatePath, Class<T> klass)", "constructor": false, "full_signature": "public List<T> loadAll(String templatePath, Clas...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_48
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/RandomUtilsTest.java", "identifier": "RandomUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testRandomByWeight() {\n\t\tList<TestData> data = new ArrayList<>();\n\t\tTestData e = new TestData();\n\t\te.setId(1);\n\t\te.setWeight(RandomUtils.nextInt(100));\n\t\tdata.add(e);\n\n\t\tTestData random = RandomUtils.randomByWeight(data, TestData::getWeight);\n\t\tassertTrue(random.g...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/RandomUtils.java", "identifier": "RandomUtils", "interfaces": "", "methods": [ { "class_method_signature": "RandomUtils.nextBoolean()", "constructor": false, "full_signature": "public static boolean nextBoolean()", ...
{ "body": "public static <K> K randomByWeight(Map<K, Integer> data) {\n\t\tfinal int sum = data.values().stream().reduce(0, (a, b) -> a + b);\n\t\tif (sum <= 0) {\n\t\t\treturn randomList(new ArrayList<>(data.keySet()));\n\t\t}\n\n\t\tfinal int random = nextInt(sum);\n\t\tint step = 0;\n\t\tfor (Map.Entry<K, Integer>...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_29
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testGetAllField() {\n\t\tassertTrue(!FieldUtils.getAllField(FieldUtilsTest.class).isEmpty());\n\t}", "class_method_signature": "FieldUtilsTest.testGetAllField()", "constructor": false, "full_signature": "@Test public void testGetAllField()", "identifier": "testGetAllField", "...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static List<Field> getAllField(final Class<?> klass) {\n\t\tList<Field> result = new ArrayList<>();\n\t\tfor (Class<?> target = klass; target != Object.class; target = target.getSuperclass()) {\n\t\t\tfor (Field field : target.getDeclaredFields()) {\n\t\t\t\tresult.add(field);\n\t\t\t}\n\t\t}\n\t\tr...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_68
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testHashCode() {\n\t\tMutableInt i = new MutableInt(1);\n\t\tassertTrue(i.hashCode() == 1);\n\t}", "class_method_signature": "MutableIntTest.testHashCode()", "constructor": false, "full_signature": "@Test public void testHashCode()", "identifier": "testHashCode", "invocations...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic int hashCode() {\n\t\treturn Integer.hashCode(value);\n\t}", "class_method_signature": "MutableInt.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "invocations": [ "hashCode" ], "modifiers": "@Override p...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_13
{ "fields": [ { "declarator": "scanner", "modifier": "private", "original_string": "private DfaScanner scanner;", "type": "DfaScanner", "var_name": "scanner" } ], "file": "noark-game/src/test/java/xyz/noark/game/dfa/DfaScannerTest.java", "identifier": "DfaScannerTest", "i...
{ "body": "@Test\n\tpublic void testIssuesIr7r1() {\n\t\tassertTrue(!scanner.findAll(\"今天真是个好日子\").isEmpty());\n\t\tassertTrue(!scanner.findAll(\"今日天真是个好子\").isEmpty());\n\t\tassertTrue(!scanner.findAll(\"日今天日真是个好子\").isEmpty());\n\t\tassertTrue(!scanner.findAll(\"今天真日是个好子日\").isEmpty());\n\t}", "class_method_signa...
{ "fields": [ { "declarator": "SBC_CHAR_START = 65281", "modifier": "private static final", "original_string": "private static final char SBC_CHAR_START = 65281;", "type": "char", "var_name": "SBC_CHAR_START" }, { "declarator": "SBC_CHAR_END = 65374", "modifier": ...
{ "body": "public List<String> findAll(final String text) {\n\t\treturn this.analysis(text, 0, false).getWords();\n\t}", "class_method_signature": "DfaScanner.findAll(final String text)", "constructor": false, "full_signature": "public List<String> findAll(final String text)", "identifier": "findAll", "invo...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_44
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MapUtilsTest.java", "identifier": "MapUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetOrMaxKey() {\n\t\tMap<Integer, Integer> map = new HashMap<>(16);\n\t\tmap.put(1, 10);\n\t\tmap.put(2, 15);\n\t\tmap.put(3, 20);\n\t\tmap.put(4, 25);\n\t\tmap.put(5, 30);\n\t\tmap.put(10, 100);\n\t\tassertTrue(MapUtils.getOrMaxKey(map, 1) == 10);\n\t\tassertTrue(MapUtils.getOrMax...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/MapUtils.java", "identifier": "MapUtils", "interfaces": "", "methods": [ { "class_method_signature": "MapUtils.isEmpty(final Map<?, ?> map)", "constructor": false, "full_signature": "public static boolean isEmpty(final...
{ "body": "public static <V> V getOrMaxKey(final Map<Integer, V> map, Integer key) {\n\t\tV v = map.get(key);\n\t\tif (v != null) {\n\t\t\treturn v;\n\t\t}\n\n\t\t// Key不存在的情况,那就找到Key刚好小于他且是最大的那个值.\n\t\treturn map.entrySet().stream().filter(x -> x.getKey() < key).max(Comparator.comparing(Map.Entry::getKey)).map(Map.E...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_52
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMultiplyExactLongLong() {\n\t\tassertTrue(MathUtils.multiplyExact(2L, 2L) == 4);\n\t\tassertTrue(MathUtils.multiplyExact(2L, Long.MAX_VALUE) == Long.MAX_VALUE);\n\t}", "class_method_signature": "MathUtilsTest.testMultiplyExactLongLong()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static int multiplyExact(int x, int y) {\n\t\ttry {\n\t\t\treturn Math.multiplyExact(x, y);\n\t\t} catch (ArithmeticException e) {\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t}", "class_method_signature": "MathUtils.multiplyExact(int x, int y)", "constructor": false, "full_signature": "public s...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_59
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testIsNotEmpty() {\n\t\tassertTrue(CollectionUtils.isNotEmpty(list));\n\t}", "class_method_signature": "CollectionUtilsTest.testIsNotEmpty()", "constructor": false, "full_signature": "@Test public void testIsNotEmpty()", "identifier": "testIsNotEmpty", "invocations": [ "a...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static boolean isNotEmpty(final Collection<?> collection) {\n\t\treturn !isEmpty(collection);\n\t}", "class_method_signature": "CollectionUtils.isNotEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "public static boolean isNotEmpty(final Collection<?> collection)...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_18
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void testLength() {\n\t\tassertTrue(StringUtils.length(null) == 0);\n\t\tassertTrue(StringUtils.length(\"\") == 0);\n\t\tassertTrue(StringUtils.length(\" \") == 1);\n\t\tassertTrue(StringUtils.length(\"test\") == 4);\n\t\tassertTrue(StringUtils.length(\"我爱中国\") == 8);\n\t}", "class_method...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static int length(final String text) {\n\t\tif (text == null) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tint sum = 0;\n\t\tfor (int i = 0, len = text.length(); i < len; i++) {\n\t\t\tsum += text.charAt(i) > 127 ? 2 : 1;\n\t\t}\n\t\treturn sum;\n\t}", "class_method_signature": "StringUtils.length(final Strin...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_1
{ "fields": [], "file": "noark-log/src/test/java/xyz/noark/log/MessageAnalyzerTest.java", "identifier": "MessageAnalyzerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testBuild() {\n\t\tMessageAnalyzer analyzer = new MessageAnalyzer(\"xx={}\");\n\t\tStringBuilder sb = new StringBuilder();\n\t\tanalyzer.build(sb, new Object[] { new byte[] { 1, 2 } });\n\t\tassertTrue(\"xx=[1, 2]\".equals(sb.toString()));\n\t}", "class_method_signature": "MessageAna...
{ "fields": [ { "declarator": "DELIMIT_START = '{'", "modifier": "private static final", "original_string": "private static final char DELIMIT_START = '{';", "type": "char", "var_name": "DELIMIT_START" }, { "declarator": "DELIMIT_STOP = '}'", "modifier": "private ...
{ "body": "public void build(StringBuilder sb, Object[] args) {\n\t\tfor (Placeholder object : caches) {\n\t\t\tobject.build(sb, args);\n\t\t}\n\n\t\t// 如果参数比占位符多的话,也要输出.\n\t\tif (args.length > count) {\n\t\t\tfor (int i = count; i < args.length; i++) {\n\t\t\t\tappend(sb, \",{\");\n\t\t\t\tappend(sb, i);\n\t\t\t\tap...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_63
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testMatching1() {\n\t\tassertTrue(CollectionUtils.matching(list, Pet::getExp, 0L).orElse(null).getId() == 0);\n\t\tassertTrue(CollectionUtils.matching(list, Pet::getExp, 1L).orElse(null).getId() == 1);\n\t\tassertTrue(CollectionUtils.matching(list, Pet::getExp, 25L).orElse(null).getId(...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static <V> Optional<V> matching(final Collection<V> collection, Function<V, ? extends Long> keyMapper, long value) {\n\t\treturn collection.stream().filter(v -> keyMapper.apply(v) <= value).max(Comparator.comparing(keyMapper));\n\t}", "class_method_signature": "CollectionUtils.matching(final Colle...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_34
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/IpUtilsTest.java", "identifier": "IpUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsInnerIp() {\n\t\tassertTrue(IpUtils.isInnerIp(\"127.0.0.1\"));\n\n\t\tassertTrue(IpUtils.isInnerIp(\"10.0.0.0\"));\n\t\tassertTrue(IpUtils.isInnerIp(\"10.0.0.1\"));\n\t\tassertTrue(IpUtils.isInnerIp(\"10.255.255.254\"));\n\t\tassertTrue(IpUtils.isInnerIp(\"10.255.255.255\"));\n\n...
{ "fields": [ { "declarator": "A_BEGIN = ipToLong(\"10.0.0.0\")", "modifier": "private static", "original_string": "private static long A_BEGIN = ipToLong(\"10.0.0.0\");", "type": "long", "var_name": "A_BEGIN" }, { "declarator": "A_END = ipToLong(\"10.255.255.255\")", ...
{ "body": "public static boolean isInnerIp(String ipAddress) {\n\t\tfinal long ipNum = ipToLong(ipAddress);\n\t\treturn isInner(ipNum, A_BEGIN, A_END) || isInner(ipNum, B_BEGIN, B_END) || isInner(ipNum, C_BEGIN, C_END) || LOCAL_IP.equals(ipAddress);\n\t}", "class_method_signature": "IpUtils.isInnerIp(String ipAddre...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_22
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void testFormat() throws Exception {\n\t\tassertTrue(\"hahatrue,false,10000,false\".equals(StringUtils.format(\"haha{1},{2},{0},{2}\", 10000, true, false, 4)));\n\t}", "class_method_signature": "StringUtilsTest.testFormat()", "constructor": false, "full_signature": "@Test public void ...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static String format(String str, Object... arguments) {\n\t\tif (arguments.length == 0) {\n\t\t\treturn str;\n\t\t}\n\t\t// FIXME 这个方法基本用于日志,邮件内容拼接,可以参考日志中使用的方案做一个缓存策略\n\t\tfor (int i = 0, len = arguments.length; i < len; i++) {\n\t\t\tstr = str.replace(join(\"{\", String.valueOf(i), \"}\"), String....
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_75
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testEqualsObject() {\n\t\tMutableInt x1 = new MutableInt(\"1\");\n\t\tMutableInt x2 = new MutableInt(1);\n\t\tassertTrue(x1.equals(x2));\n\t}", "class_method_signature": "MutableIntTest.testEqualsObject()", "constructor": false, "full_signature": "@Test public void testEqualsObje...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj instanceof MutableInt) {\n\t\t\treturn value == ((MutableInt) obj).intValue();\n\t\t}\n\t\treturn false;\n\t}", "class_method_signature": "MutableInt.equals(Object obj)", "constructor": false, "full_signature": "@Override public boolean eq...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_55
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testPlunder() {\n\t\tLinkedHashMap<Integer, Long> resources = new LinkedHashMap<>();\n\t\tresources.put(301, RandomUtils.nextLong(1, 88888));\n\t\tresources.put(302, RandomUtils.nextLong(1, 88888));\n\t\tresources.put(303, RandomUtils.nextLong(1, 88888));\n\t\tresources.put(304, Random...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static <T> Map<T, Long> plunder(Map<T, Long> resources, long max, Map<T, Integer> ratio) {\n\t\tfinal Map<T, Long> result = new HashMap<>(resources.size());\n\t\tfinal long step = max / Math.min(1000, Math.max(10, ratio.values().stream().reduce(0, (a, b) -> a + b)));\n\t\t// 总计要抢的资源量\n\t\tlong total...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_43
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MapUtilsTest.java", "identifier": "MapUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testOf() {\n\t\tMap<Integer, Integer> map = MapUtils.of(1, 1);\n\t\tassertTrue(map.get(1) == 1);\n\t}", "class_method_signature": "MapUtilsTest.testOf()", "constructor": false, "full_signature": "@Test public void testOf()", "identifier": "testOf", "invocations": [ "of", ...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/MapUtils.java", "identifier": "MapUtils", "interfaces": "", "methods": [ { "class_method_signature": "MapUtils.isEmpty(final Map<?, ?> map)", "constructor": false, "full_signature": "public static boolean isEmpty(final...
{ "body": "public static <K, V> HashMap<K, V> of(K key, V value) {\n\t\tHashMap<K, V> result = new HashMap<>(1, 1);\n\t\tresult.put(key, value);\n\t\treturn result;\n\t}", "class_method_signature": "MapUtils.of(K key, V value)", "constructor": false, "full_signature": "public static HashMap<K, V> of(K key, V va...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_14
{ "fields": [ { "declarator": "scanner", "modifier": "private", "original_string": "private DfaScanner scanner;", "type": "DfaScanner", "var_name": "scanner" } ], "file": "noark-game/src/test/java/xyz/noark/game/dfa/DfaScannerTest.java", "identifier": "DfaScannerTest", "i...
{ "body": "@Test\n\tpublic void testIssuesIzlsa() {\n\t\tassertTrue(\"**********\".equals(scanner.replace(\"<<><><><>>\")));\n\t}", "class_method_signature": "DfaScannerTest.testIssuesIzlsa()", "constructor": false, "full_signature": "@Test public void testIssuesIzlsa()", "identifier": "testIssuesIzlsa", "i...
{ "fields": [ { "declarator": "SBC_CHAR_START = 65281", "modifier": "private static final", "original_string": "private static final char SBC_CHAR_START = 65281;", "type": "char", "var_name": "SBC_CHAR_START" }, { "declarator": "SBC_CHAR_END = 65374", "modifier": ...
{ "body": "public String replace(final String text) {\n\t\treturn this.analysis(text, 0, true).getText();\n\t}", "class_method_signature": "DfaScanner.replace(final String text)", "constructor": false, "full_signature": "public String replace(final String text)", "identifier": "replace", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_80
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIncrementAndGet() {\n\t\tMutableInt i = new MutableInt(0);\n\t\tassertTrue(i.incrementAndGet() == 1);\n\t}", "class_method_signature": "MutableIntTest.testIncrementAndGet()", "constructor": false, "full_signature": "@Test public void testIncrementAndGet()", "identifier": "t...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "public final int incrementAndGet() {\n\t\treturn ++value;\n\t}", "class_method_signature": "MutableInt.incrementAndGet()", "constructor": false, "full_signature": "public final int incrementAndGet()", "identifier": "incrementAndGet", "invocations": [], "modifiers": "public final", "parameters...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_38
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/DateUtilsTest.java", "identifier": "DateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testToSeconds() throws ParseException {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss:SSS\");\n\t\tDate d1 = sdf.parse(\"2018-12-12 23:59:59:888\");\n\t\tDate d2 = sdf.parse(\"2018-12-13 00:00:00:888\");\n\t\tDate d3 = sdf.parse(\"2018-12-13 00:00:01:888\");\n\...
{ "fields": [ { "declarator": "MILLISECOND_PER_SECOND = 1000", "modifier": "public static final", "original_string": "public static final int MILLISECOND_PER_SECOND = 1000;", "type": "int", "var_name": "MILLISECOND_PER_SECOND" }, { "declarator": "SECOND_PER_MINUTE = 60"...
{ "body": "public static long toSeconds(Date date) {\n\t\treturn toSeconds(date.getTime());\n\t}", "class_method_signature": "DateUtils.toSeconds(Date date)", "constructor": false, "full_signature": "public static long toSeconds(Date date)", "identifier": "toSeconds", "invocations": [ "toSeconds", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_79
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetAndAdd() {\n\t\tMutableInt i = new MutableInt(0);\n\t\tassertTrue(i.getAndAdd(1) == 0);\n\t}", "class_method_signature": "MutableIntTest.testGetAndAdd()", "constructor": false, "full_signature": "@Test public void testGetAndAdd()", "identifier": "testGetAndAdd", "invoc...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "public final int getAndAdd(int delta) {\n\t\tfinal int oldValue = value;\n\t\tthis.value += delta;\n\t\treturn oldValue;\n\t}", "class_method_signature": "MutableInt.getAndAdd(int delta)", "constructor": false, "full_signature": "public final int getAndAdd(int delta)", "identifier": "getAndAdd", ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_78
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetAndDecrement() {\n\t\tMutableInt i = new MutableInt(\"1\");\n\t\tassertTrue(i.getAndDecrement() == 1);\n\t}", "class_method_signature": "MutableIntTest.testGetAndDecrement()", "constructor": false, "full_signature": "@Test public void testGetAndDecrement()", "identifier"...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "public final int getAndDecrement() {\n\t\tfinal int oldValue = value;\n\t\tthis.value--;\n\t\treturn oldValue;\n\t}", "class_method_signature": "MutableInt.getAndDecrement()", "constructor": false, "full_signature": "public final int getAndDecrement()", "identifier": "getAndDecrement", "invocatio...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_39
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/DateUtilsTest.java", "identifier": "DateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testDiffDays() throws ParseException {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss:SSS\");\n\t\t{\n\t\t\tDate d1 = sdf.parse(\"2018-12-31 00:00:00:000\");\n\t\t\tDate d2 = sdf.parse(\"2018-12-31 23:59:59:999\");\n\t\t\tassertTrue(DateUtils.diffDays(d1, d2) ==...
{ "fields": [ { "declarator": "MILLISECOND_PER_SECOND = 1000", "modifier": "public static final", "original_string": "public static final int MILLISECOND_PER_SECOND = 1000;", "type": "int", "var_name": "MILLISECOND_PER_SECOND" }, { "declarator": "SECOND_PER_MINUTE = 60"...
{ "body": "public static long diffDays(Date date1, Date date2) {\n\t\tfinal int offset = TimeZone.getDefault().getRawOffset();\n\t\treturn toDays(date1.getTime() + offset) - toDays(date2.getTime() + offset);\n\t}", "class_method_signature": "DateUtils.diffDays(Date date1, Date date2)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_81
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testDecrementAndGet() {\n\t\tMutableInt i = new MutableInt(1);\n\t\tassertTrue(i.decrementAndGet() == 0);\n\t}", "class_method_signature": "MutableIntTest.testDecrementAndGet()", "constructor": false, "full_signature": "@Test public void testDecrementAndGet()", "identifier": "t...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "public final int decrementAndGet() {\n\t\treturn --value;\n\t}", "class_method_signature": "MutableInt.decrementAndGet()", "constructor": false, "full_signature": "public final int decrementAndGet()", "identifier": "decrementAndGet", "invocations": [], "modifiers": "public final", "parameters...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_15
{ "fields": [], "file": "noark-game/src/test/java/xyz/noark/game/NoarkPropertiesLoaderTest.java", "identifier": "NoarkPropertiesLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void test() {\n\t\tNoarkPropertiesLoader loader = new NoarkPropertiesLoader();\n\t\tMap<String, String> config = loader.loadProperties(\"dev\");\n\n\t\tassertTrue(\"中国\".equals(config.get(\"noark.key.test\")));\n\t\tassertTrue(\"2\".equals(config.get(\"noark.server.id\")));\n\t\tassertTrue(...
{ "fields": [ { "declarator": "DEFAULT_PROPERTIES = \"application.properties\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_PROPERTIES = \"application.properties\";", "type": "String", "var_name": "DEFAULT_PROPERTIES" }, { ...
{ "body": "Map<String, String> loadProperties(String profile) {\n\t\tfinal ClassLoader loader = Noark.class.getClassLoader();\n\t\tHashMap<String, String> result = new HashMap<>(256, 1);\n\n\t\tloadProperties(loader, DEFAULT_PROPERTIES, result);\n\n\t\t// 加载指定的Profile\n\t\tif (StringUtils.isNotEmpty(profile)) {\n\t\t...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_42
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/FileUtilsTest.java", "identifier": "FileUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testReadableFileSizeLong() {\n\t\tassertTrue(\"1 KB\".equals(FileUtils.readableFileSize(1024)));\n\t}", "class_method_signature": "FileUtilsTest.testReadableFileSizeLong()", "constructor": false, "full_signature": "@Test public void testReadableFileSizeLong()", "identifier": "t...
{ "fields": [ { "declarator": "UNITS = new String[] { \"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"EB\" }", "modifier": "private static final", "original_string": "private static final String[] UNITS = new String[] { \"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"EB\" };", "type": "String[]", ...
{ "body": "public static String readableFileSize(File file) {\n\t\treturn readableFileSize(file.length());\n\t}", "class_method_signature": "FileUtils.readableFileSize(File file)", "constructor": false, "full_signature": "public static String readableFileSize(File file)", "identifier": "readableFileSize", "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_54
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/util/MathUtilsTest.java", "identifier": "MathUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFormatScale() {\n\t\tassertTrue(MathUtils.formatScale(1.234F, 1) == 1.2F);\n\t\tassertTrue(MathUtils.formatScale(1.254F, 1) == 1.3F);\n\t\tassertTrue(MathUtils.formatScale(1.234D, 1) == 1.2D);\n\t\tassertTrue(MathUtils.formatScale(1.264D, 1) == 1.3D);\n\t}", "class_method_signatu...
{ "fields": [ { "declarator": "ONE = 1.0", "modifier": "public static final", "original_string": "public static final double ONE = 1.0;", "type": "double", "var_name": "ONE" }, { "declarator": "HUNDRED = 100.0", "modifier": "public static final", "original_s...
{ "body": "public static float formatScale(float value, int newScale) {\n\t\treturn formatScale(value, newScale, RoundingMode.HALF_UP);\n\t}", "class_method_signature": "MathUtils.formatScale(float value, int newScale)", "constructor": false, "full_signature": "public static float formatScale(float value, int n...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_74
{ "fields": [], "file": "noark-core/src/test/java/xyz/noark/core/lang/MutableIntTest.java", "identifier": "MutableIntTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetValue() {\n\t\tMutableInt i = new MutableInt(\"1\");\n\t\tassertTrue(i.getValue() == 1);\n\t}", "class_method_signature": "MutableIntTest.testGetValue()", "constructor": false, "full_signature": "@Test public void testGetValue()", "identifier": "testGetValue", "invocat...
{ "fields": [ { "declarator": "serialVersionUID = 1259910250840168103L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1259910250840168103L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "value...
{ "body": "@Override\n\tpublic Integer getValue() {\n\t\treturn Integer.valueOf(value);\n\t}", "class_method_signature": "MutableInt.getValue()", "constructor": false, "full_signature": "@Override public Integer getValue()", "identifier": "getValue", "invocations": [ "valueOf" ], "modifiers": "@Over...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_23
{ "fields": [ { "declarator": "name", "modifier": "@TplAttr(name = \"name\")\n\tpublic static", "original_string": "@TplAttr(name = \"name\")\n\tpublic static String name;", "type": "String", "var_name": "name" }, { "declarator": "test1", "modifier": "@TplAttr(nam...
{ "body": "@Test\n\tpublic void testWriteFieldObjectStringObject() {\n\t\tFieldUtilsTest test = new FieldUtilsTest();\n\t\tFieldUtils.writeField(test, \"test1\", 1);\n\t\tassertTrue(test.test1 == 1);\n\n\t\tFieldUtils.writeField(test, \"test2\", 2);\n\t\tassertTrue(test.getTest2() == 2);\n\t}", "class_method_signat...
{ "fields": [ { "declarator": "PREFIX_IS_METHOD_INDEX = 2", "modifier": "private static final", "original_string": "private static final int PREFIX_IS_METHOD_INDEX = 2;", "type": "int", "var_name": "PREFIX_IS_METHOD_INDEX" }, { "declarator": "PREFIX_GET_METHOD_INDEX = 3...
{ "body": "public static void writeField(final Object target, final Field field, final Object value) {\n\t\tif (!field.isAccessible()) {\n\t\t\tfield.setAccessible(true);\n\t\t}\n\t\ttry {\n\t\t\tfield.set(target, value);\n\t\t} catch (IllegalArgumentException | IllegalAccessException e) {\n\t\t\tthrow new ServerBoot...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_35
{ "fields": [ { "declarator": "BENCHMARK = new Benchmark(1000)", "modifier": "private final static", "original_string": "private final static Benchmark BENCHMARK = new Benchmark(1000);", "type": "Benchmark", "var_name": "BENCHMARK" } ], "file": "noark-core/src/test/java/xyz/n...
{ "body": "@Test\n\tpublic void testCalculate() throws Exception {\n\t\tbyte[] buf = new byte[] { 0x00, 0x64, 0x01, 0x31, 0x31, (byte) 0xD1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x28, 0x23, 0x79, 0x65, 0x61, 0x72, 0x30, 0x5E, 0x30, 0x23, 0x29, 0x28, 0x40, 0x31, 0x40, 0x29, 0x3...
{ "fields": [ { "declarator": "TABLE[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,\n\t\t\t0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddd...
{ "body": "public static int calculate(byte[] array) {\n\t\tint crc = 0xffffffff;\n\t\tfor (byte b : array) {\n\t\t\tcrc = crc >>> 8 ^ TABLE[(crc ^ b) & 0xff];\n\t\t}\n\t\treturn crc ^ 0xffffffff;\n\t}", "class_method_signature": "Crc32Utils.calculate(byte[] array)", "constructor": false, "full_signature": "pub...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_62
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testGroupingBy2() {\n\t\tPairMap<Integer, Integer, List<Pet>> result = CollectionUtils.groupingBy(list, Pet::getId, Pet::getLevel);\n\t\tassertTrue(result.size() == 20);\n\t}", "class_method_signature": "CollectionUtilsTest.testGroupingBy2()", "constructor": false, "full_signatur...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static <K, V> Map<K, List<V>> groupingBy(final Collection<V> collection, Function<? super V, ? extends K> keyMapper) {\n\t\treturn collection.stream().collect(Collectors.groupingBy(keyMapper));\n\t}", "class_method_signature": "CollectionUtils.groupingBy(final Collection<V> collection, Function<? ...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_19
{ "fields": [ { "declarator": "benchmark = new Benchmark(1000)", "modifier": "private final", "original_string": "private final Benchmark benchmark = new Benchmark(1000);", "type": "Benchmark", "var_name": "benchmark" } ], "file": "noark-core/src/test/java/xyz/noark/core/util...
{ "body": "@Test\n\tpublic void testSplit() throws Exception {\n\t\tassertTrue(StringUtils.split(\"1,2,3\", \",\").length == 3);\n\t\tassertTrue(StringUtils.split(\"1,2,3,\", \",\").length == 3);\n\t\tassertTrue(StringUtils.split(\"1,2,3,,,\", \",\").length == 3);\n\t\tassertTrue(StringUtils.split(\"127.0.0.1\", \".\...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "SPACE = \" \"", "modifier": "public static final", "orig...
{ "body": "public static String[] split(final String str, final String separatorChars) {\n\t\treturn splitWorker(str, separatorChars, -1, false);\n\t}", "class_method_signature": "StringUtils.split(final String str, final String separatorChars)", "constructor": false, "full_signature": "public static String[] s...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_0
{ "fields": [], "file": "noark-log/src/test/java/xyz/noark/log/MessageAnalyzerTest.java", "identifier": "MessageAnalyzerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMessageAnalyzer() {\n\t\tMessageAnalyzer analyzer = new MessageAnalyzer(\"1111{}1{}{}1{}\");\n\t\tassertTrue(analyzer.getCount() == 4);\n\t}", "class_method_signature": "MessageAnalyzerTest.testMessageAnalyzer()", "constructor": false, "full_signature": "@Test public void tes...
{ "fields": [ { "declarator": "DELIMIT_START = '{'", "modifier": "private static final", "original_string": "private static final char DELIMIT_START = '{';", "type": "char", "var_name": "DELIMIT_START" }, { "declarator": "DELIMIT_STOP = '}'", "modifier": "private ...
{ "body": "MessageAnalyzer(String key) {\n\t\tinit(key);\n\t\tthis.caches.trimToSize();\n\t}", "class_method_signature": "MessageAnalyzer.MessageAnalyzer(String key)", "constructor": true, "full_signature": " MessageAnalyzer(String key)", "identifier": "MessageAnalyzer", "invocations": [], "modifiers": "...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
148116142_58
{ "fields": [ { "declarator": "MAX = 20", "modifier": "private static final", "original_string": "private static final int MAX = 20;", "type": "int", "var_name": "MAX" }, { "declarator": "list = new ArrayList<>()", "modifier": "", "original_string": "List<Pe...
{ "body": "@Test\n\tpublic void testIsEmpty() {\n\t\tassertFalse(CollectionUtils.isEmpty(list));\n\t}", "class_method_signature": "CollectionUtilsTest.testIsEmpty()", "constructor": false, "full_signature": "@Test public void testIsEmpty()", "identifier": "testIsEmpty", "invocations": [ "assertFalse", ...
{ "fields": [], "file": "noark-core/src/main/java/xyz/noark/core/util/CollectionUtils.java", "identifier": "CollectionUtils", "interfaces": "", "methods": [ { "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "pub...
{ "body": "public static boolean isEmpty(final Collection<?> collection) {\n\t\treturn collection == null || collection.isEmpty();\n\t}", "class_method_signature": "CollectionUtils.isEmpty(final Collection<?> collection)", "constructor": false, "full_signature": "public static boolean isEmpty(final Collection<?...
{ "created": null, "fork": null, "fork_count": 4, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 148116142, "size": 5512, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/xiaoe/noark3" }
52478731_59
{ "fields": [ { "declarator": "log = LogFactory.getLog( DatasetCombinerTest.class.getName() )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( DatasetCombinerTest.class.getName() );", "type": "Log", "var_name": "log" }, ...
{ "body": "@Test\n public void testFindGSE611() throws Exception {\n GeoFamilyParser parser = new GeoFamilyParser();\n\n try (InputStream is = new GZIPInputStream(\n this.getClass().getResourceAsStream( \"/data/loader/expression/geo/GSE611Short/GDS428.soft.gz\" ) )) {\n pars...
{ "fields": [ { "declarator": "factory = DocumentBuilderFactory.newInstance()", "modifier": "static final", "original_string": "static final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();", "type": "DocumentBuilderFactory", "var_name": "factory" }, { ...
{ "body": "public GeoSampleCorrespondence findGSECorrespondence( Collection<GeoDataset> dataSets ) {\n\n if ( dataSets == null )\n return null;\n if ( dataSets.size() == 0 ) {\n throw new IllegalArgumentException( \"No datasets!\" );\n }\n\n this.checkPlatformsMatchSe...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }
52478731_2
{ "fields": [ { "declarator": "suc", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private SignupController suc;", "type": "SignupController", "var_name": "suc" }, { "declarator": "expressionExperimentService", "modifier": "@Autowired\...
{ "body": "@SuppressWarnings(\"Duplicates\") // Not in this project\n @Test\n public void testSignup() throws Exception {\n int numThreads = 10; // too high and we run out of connections, which is not what we're testing.\n final int numsignupsperthread = 20;\n final Random random = new Rand...
{ "fields": [ { "declarator": "passwordEncoder", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private PasswordEncoder passwordEncoder;", "type": "PasswordEncoder", "var_name": "passwordEncoder" }, { "declarator": "userManager", "modif...
{ "body": "@RequestMapping(value = \"/signup.html\", method = RequestMethod.POST)\n public void signup( HttpServletRequest request, HttpServletResponse response ) throws Exception {\n\n JSONUtil jsonUtil = new JSONUtil( request, response );\n String jsonText = null;\n\n String password = reque...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }
52478731_18
{ "fields": [ { "declarator": "log = LogFactory.getLog( PubMedXMLFetcherTest.class.getName() )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( PubMedXMLFetcherTest.class.getName() );", "type": "Log", "var_name": "log" },...
{ "body": "@Test\n public final void testRetrieveByHTTP2() {\n try {\n BibliographicReference br = pmf.retrieveByHTTP( 24850731 );\n\n assertNotNull( br );\n\n assertEquals(\n \"Iwata-Yoshikawa, Naoko; Uda, Akihiko; Suzuki, Tadaki; Tsunetsugu-Yokota, Yasuk...
{ "fields": [ { "declarator": "log = LogFactory.getLog( PubMedXMLFetcher.class )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( PubMedXMLFetcher.class );", "type": "Log", "var_name": "log" }, { "declarator": "...
{ "body": "public Collection<BibliographicReference> retrieveByHTTP( Collection<Integer> pubMedIds ) throws IOException {\n StringBuilder buf = new StringBuilder();\n for ( Integer integer : pubMedIds ) {\n buf.append( integer ).append( \",\" );\n }\n URL toBeGotten = new URL( u...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }
52478731_63
{ "fields": [ { "declarator": "log = LogFactory.getLog( DatasetCombinerTest.class.getName() )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( DatasetCombinerTest.class.getName() );", "type": "Log", "var_name": "log" }, ...
{ "body": "@Test\n public void testGDS186() throws Exception {\n GeoFamilyParser parser = new GeoFamilyParser();\n\n try (InputStream is = new GZIPInputStream(\n this.getClass().getResourceAsStream( \"/data/loader/expression/geo/gse106Short/GDS186.soft.gz\" ) )) {\n parser.p...
{ "fields": [ { "declarator": "factory = DocumentBuilderFactory.newInstance()", "modifier": "static final", "original_string": "static final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();", "type": "DocumentBuilderFactory", "var_name": "factory" }, { ...
{ "body": "public GeoSampleCorrespondence findGSECorrespondence( Collection<GeoDataset> dataSets ) {\n\n if ( dataSets == null )\n return null;\n if ( dataSets.size() == 0 ) {\n throw new IllegalArgumentException( \"No datasets!\" );\n }\n\n this.checkPlatformsMatchSe...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }
52478731_34
{ "fields": [], "file": "gemma-core/src/test/java/ubic/gemma/core/loader/genome/gene/ncbi/NCBIGeneHistoryParserTest.java", "identifier": "NCBIGeneHistoryParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseB() throws Exception {\n\n NcbiGeneHistoryParser parser = new NcbiGeneHistoryParser();\n parser.parse( NCBIGeneHistoryParserTest.class.getResourceAsStream( \"/data/loader/genome/gene/gene_history.rat.sample\" ) );\n\n String r = parser.discontinuedIdForS...
{ "fields": [ { "declarator": "GENE_HISTORY_FILE_NUM_FIELDS = 5", "modifier": "private static final", "original_string": "private static final int GENE_HISTORY_FILE_NUM_FIELDS = 5;", "type": "int", "var_name": "GENE_HISTORY_FILE_NUM_FIELDS" }, { "declarator": "id2histor...
{ "body": "public String discontinuedIdForSymbol( String geneSymbol, Integer taxonId ) {\n if ( !discontinuedGenes.containsKey( taxonId ) )\n return null;\n return discontinuedGenes.get( taxonId ).get( geneSymbol );\n }", "class_method_signature": "NcbiGeneHistoryParser.discontinuedIdFor...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }
52478731_22
{ "fields": [ { "declarator": "log = LogFactory.getLog( PubMedSearchTest.class.getName() )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( PubMedSearchTest.class.getName() );", "type": "Log", "var_name": "log" } ], "...
{ "body": "@Test\n public void testSearchAndRetrieveByHTTPInChunks() throws Exception {\n try {\n PubMedSearch pms = new PubMedSearch();\n Collection<String> searchTerms = new HashSet<>();\n searchTerms.add( \"brain\" );\n searchTerms.add( \"hippocampus\" );\n ...
{ "fields": [ { "declarator": "log = LogFactory.getLog( PubMedSearch.class )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( PubMedSearch.class );", "type": "Log", "var_name": "log" }, { "declarator": "CHUNK_SI...
{ "body": "public Collection<BibliographicReference> searchAndRetrieveByHTTP( Collection<String> searchTerms )\n throws IOException, SAXException, ParserConfigurationException {\n StringBuilder builder = new StringBuilder();\n builder.append( uri );\n builder.append( \"&term=\" );\n ...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }
52478731_75
{ "fields": [ { "declarator": "experimentalFactorService", "modifier": "@Autowired", "original_string": "@Autowired\n ExperimentalFactorService experimentalFactorService;", "type": "ExperimentalFactorService", "var_name": "experimentalFactorService" } ], "file": "gemma-cor...
{ "body": "@Test\n public void testOrderByExperimentalDesignB() {\n\n BioAssayDimension bad = BioAssayDimension.Factory.newInstance();\n\n /*\n * Five factors. Factor4 is a measurmeent.\n */\n\n Collection<ExperimentalFactor> factors = new HashSet<>();\n for ( int i = 0;...
{ "fields": [ { "declarator": "log = LogFactory.getLog( ExpressionDataMatrixColumnSort.class.getName() )", "modifier": "private static final", "original_string": "private static final Log log = LogFactory.getLog( ExpressionDataMatrixColumnSort.class.getName() );", "type": "Log", "var...
{ "body": "public static <R> DoubleMatrix<R, BioAssay> orderByExperimentalDesign( DoubleMatrix<R, BioAssay> mat ) {\n\n List<BioAssay> bioAssays = mat.getColNames();\n\n List<BioMaterial> start = new ArrayList<>();\n Map<BioMaterial, BioAssay> bm2ba = new HashMap<>();\n for ( BioAssay bioA...
{ "created": null, "fork": null, "fork_count": 1, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 52478731, "size": 460145, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/PavlidisLab/Gemma" }