id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
64185596_123
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testLessThanEquals() throws SQLException {\n Clause test = lessThanEquals(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" <= ?\", test.build());\n }", "class_method_signature": "ExpressionsTest.testLessThanEquals()", "constructor": false, ...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static ColumnExpression lessThanEquals(String name) {\n return columnExpression(\"%s <= ?\", name);\n }", "class_method_signature": "Expressions.lessThanEquals(String name)", "constructor": false, "full_signature": "public static ColumnExpression lessThanEquals(String name)", "iden...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_158
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" } ], "file": "dal-client/src/test/java/com/c...
{ "body": "@Test\n\tpublic void testGetCurrentListeners() {\n\t\tfinal DalHints hints = new DalHints();\n\t\tfinal DalTransactionListener testListener = new DalTransactionListener(){\n\t\t\t@Override\n\t\t\tpublic void beforeCommit() {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void beforeRollback() {\n\t\t\t}\n\n\t\t...
{ "fields": [ { "declarator": "connManager", "modifier": "private", "original_string": "private DalConnectionManager connManager;", "type": "DalConnectionManager", "var_name": "connManager" }, { "declarator": "transactionHolder = new ThreadLocal<DalTransaction>()", ...
{ "body": "public static List<DalTransactionListener> getCurrentListeners() throws DalException {\n reqiresTransaction();\n return transactionHolder.get().getListeners();\n }", "class_method_signature": "DalTransactionManager.getCurrentListeners()", "constructor": false, "full_signature": "publ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_37
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java", "identifier": "ConnectionStringParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseMySqlUrl6() {\n String ipUrl = \"jdbc:mysql://10.1.1.1:3308/test?useUnicode=true&characterEncoding=UTF-8&\" +\n \"loadBalanceStrategy=serverAffinity&serverAffinityOrder=\" +\n \"address=(type=master)(protocol=tcp)(host=10.3.3.3)(port=3310...
{ "fields": [ { "declarator": "parser = null", "modifier": "private static", "original_string": "private static ConnectionStringParser parser = null;", "type": "ConnectionStringParser", "var_name": "parser" }, { "declarator": "dburlPattern =\n Pattern.compile...
{ "body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_6
{ "fields": [ { "declarator": "databaseResource", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private DatabaseResource databaseResource;", "type": "DatabaseResource", "var_name": "databaseResource" }, { "declarator": "dalGroupDBDao", ...
{ "body": "@Test\n public void checkCLusterValidTest() throws Exception {\n DatabaseResource resource = Mockito.spy(DatabaseResource.class);\n Mockito.doReturn(false).when(resource).checkValidDalCluster(Mockito.anyString());\n assertEquals(\"this db hasn't applied dalcluster\", resource.checkC...
{ "fields": [ { "declarator": "classLoader", "modifier": "private static", "original_string": "private static ClassLoader classLoader;", "type": "ClassLoader", "var_name": "classLoader" }, { "declarator": "mapper = new ObjectMapper()", "modifier": "private static"...
{ "body": "public Status checkCLusterValid(String nameBase) {\n try {\n Status status = Status.OK();\n if (checkValidDalCluster(nameBase)) {\n status.setInfo(\"\");\n } else {\n status.setInfo(\"this db hasn't applied dalcluster\");\n }\...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_60
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSingleTaskRequestTest.java", "identifier": "DalSingleTaskRequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testDalSingleTaskRequest() {\n\t\tDalSingleTaskRequest<Integer> test = new DalSingleTaskRequest<>(\"\", new DalHints(), 1, new TestSingleTask());\n\t\tList<Integer> pojos = new ArrayList<>();\n\t\ttest = new DalSingleTaskRequest<>(\"\", new DalHints(), pojos, new TestSingleTask());\n\t...
{ "fields": [ { "declarator": "caller", "modifier": "private", "original_string": "private String caller;", "type": "String", "var_name": "caller" }, { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", ...
{ "body": "private DalSingleTaskRequest(String logicDbName, DalHints hints, SingleTask<T> task, PojoExecutionCallback callback) {\n this.logicDbName = logicDbName;\n this.task = task;\n this.hints = hints != null ? hints.clone() : new DalHints();\n this.caller = LogContext.getRequestCaller...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_99
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testEqual() {\n testExpression(wrappedTemplate + \" = ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().equal(template);\n }\n public AbstractFreeSqlBuilder createExpWithParameter() {...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder equal(String name) {\n return append(Expressions.equal(name));\n }", "class_method_signature": "AbstractFreeSqlBuilder.equal(String name)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder equal(String name)", "identifier": "equal", "i...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_119
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testNotEqual() throws SQLException {\n Clause test = notEqual(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" <> ?\", test.build());\n }", "class_method_signature": "ExpressionsTest.testNotEqual()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static ColumnExpression notEqual(String name) {\n return columnExpression(\"%s <> ?\", name);\n }", "class_method_signature": "Expressions.notEqual(String name)", "constructor": false, "full_signature": "public static ColumnExpression notEqual(String name)", "identifier": "notEqual...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_76
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testSetNullable() {\n AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();\n test.setLogicDbName(logicDbName);\n StatementParameters p = new StatementParameters();\n test.with(p);\n test.select(template).from(template).where(equal(template))....
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder setNullable(String name, Object value, int sqlType) {\n return set(value != null, name, value, sqlType);\n }", "class_method_signature": "AbstractFreeSqlBuilder.setNullable(String name, Object value, int sqlType)", "constructor": false, "full_signature": "publi...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_21
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getTableShardIndexShardOffsetTest() {\n final TableShardContext context = new TableShardContext(\"whatever\");\n final Map<String, Object> data = new HashMap<>();\n data.put(\"id\", 8); // ignore\n data.put(\"age\", 18);\n final ShardData shardData ...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)", "constructor": false, "full_s...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_56
{ "fields": [ { "declarator": "all = new ConcurrentHashMap<>()", "modifier": "static", "original_string": "static ConcurrentHashMap<String, Object> all = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<String, Object>", "var_name": "all" } ], "file": "dal-client/src/t...
{ "body": "@Test\n\tpublic void testExecuteNotCrossShard() {\n\t\tDalRequestExecutor test = new DalRequestExecutor();\n\t\tTestDalRequest request = new TestDalRequest(null, new Integer[]{1});\n\t\tDalHints hints = new DalHints();\n\t\t\n\t\ttry {\n\t\t\tInteger result = test.execute(hints, request);\n\t\t\tassertEqua...
{ "fields": [ { "declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()", "modifier": "private static final", "original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();", "type": "ILogger", "var_name": "LOGGER" }, { "declara...
{ "body": "public <T> T execute(final DalHints hints, final DalRequest<T> request) throws SQLException {\n\t\treturn execute(hints, request, null);\n\t}", "class_method_signature": "DalRequestExecutor.execute(final DalHints hints, final DalRequest<T> request)", "constructor": false, "full_signature": "public T ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_139
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" }, { "declarator": "logicShardDbName =...
{ "body": "@Test\n\tpublic void testStartTransaction() {\n\t\tDalTransaction test = null;\n\t\ttry {\n\t\t\ttest = new DalTransaction(getDalConnection(), logicDbName);\n\t\t\tassertEquals(0, test.getLevel());\n\t\t\ttest.startTransaction();\n\t\t\tassertEquals(1, test.getLevel());\n\t\t\ttest.startTransaction();\n\t\...
{ "fields": [ { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", "type": "String", "var_name": "logicDbName" }, { "declarator": "connHolder", "modifier": "private", "original_string": "private DalConnectio...
{ "body": "public int startTransaction() throws SQLException {\n if (rolledBack || completed)\n throw new DalException(ErrorCode.TransactionState);\n\n return level++;\n }", "class_method_signature": "DalTransaction.startTransaction()", "constructor": false, "full_signature": "public...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_181
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/LoggerHelperTest.java", "identifier": "LoggerHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetNormalSimplifiedDBUrl() throws Exception {\n String sqlserverUrl=\"jdbc:sqlserver://SqlServer:55111;jaasConfigurationName=SQLJDBCDriver;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=100000;authenticat...
{ "fields": [ { "declarator": "SQLHIDDENString = \"*\"", "modifier": "public static final", "original_string": "public static final String SQLHIDDENString = \"*\";", "type": "String", "var_name": "SQLHIDDENString" }, { "declarator": "NULL_SET = \"NullSet\"", "modi...
{ "body": "public static String getSimplifiedDBUrl(String url) {\n\t\tif(StringUtils.isBlank(url))\n\t\t\treturn \"blank url\";\n\n\t\tif (url.startsWith(ConnectionStringParser.MYSQL_URL_PREFIX) ||\n\t\t\t\turl.startsWith(ConnectionStringParser.REPLICATION_MYSQL_URL_PREFIX)) {\n\t\t\tString[] mySqlUrlStrings = url.sp...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_17
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getDbShardShardValuedWorkTest() {\n final DbShardContext context = new DbShardContext(\"whatever\");\n context.setShardValue(1002);\n\n final Map<String, Object> data1 = new HashMap<>();\n data1.put(\"id\", 7);\n final ShardData shardData1 = new Map...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)", "constructor": false, "full_signature": "@O...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_178
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/ServiceLoaderHelperTest.java", "identifier": "ServiceLoaderHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOrdered(){\n\n Ordered ordered = ServiceLoaderHelper.getInstance(Ordered.class);\n Assert.assertTrue(ordered instanceof Ordered2);\n\n }", "class_method_signature": "ServiceLoaderHelperTest.testOrdered()", "constructor": false, "full_signature": "@Test publ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ServiceLoaderHelper.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ServiceLoaderHelper.class);", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "public static <T> T getInstance(Class<T> clazz) {\n T instance = null;\n try {\n Iterator<T> iterator = getIterator(clazz);\n\n if (!Ordered.class.isAssignableFrom(clazz)) {\n if (iterator.hasNext())\n return iterator.next();\n ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_40
{ "fields": [ { "declarator": "NAME = \"test\"", "modifier": "private static final", "original_string": "private static final String NAME = \"test\";", "type": "String", "var_name": "NAME" }, { "declarator": "COMMA = \",\"", "modifier": "private static final", ...
{ "body": "@Test\n public void testPropertyFileConnectionStringProvider() throws Exception {\n PropertyFileConnectionStringProvider provider = new PropertyFileConnectionStringProvider();\n Set<String> names = new HashSet<>();\n names.add(NAME);\n Map<String, DalConnectionString> map = p...
{ "fields": [ { "declarator": "PROPERTY_FILE_NAME = \"database.properties\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_FILE_NAME = \"database.properties\";", "type": "String", "var_name": "PROPERTY_FILE_NAME" }, { "dec...
{ "body": "public PropertyFileConnectionStringProvider() {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n if (classLoader == null) {\n classLoader = PropertyFileConnectionStringProvider.class.getClassLoader();\n }\n\n URL url = classLoader.getResou...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_154
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" } ], "file": "dal-client/src/test/java/com/c...
{ "body": "@Test\n\tpublic void testClearCurrentTransaction() {\n\t\tfinal DalHints hints = new DalHints();\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t\tassertFalse(DalTransactionManager.isInTransaction());\n\t\t\tConnectionAction<?> action = new Co...
{ "fields": [ { "declarator": "connManager", "modifier": "private", "original_string": "private DalConnectionManager connManager;", "type": "DalConnectionManager", "var_name": "connManager" }, { "declarator": "transactionHolder = new ThreadLocal<DalTransaction>()", ...
{ "body": "public static void clearCurrentTransaction() {\n transactionHolder.set(null);\n }", "class_method_signature": "DalTransactionManager.clearCurrentTransaction()", "constructor": false, "full_signature": "public static void clearCurrentTransaction()", "identifier": "clearCurrentTransaction",...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_83
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testSelect() {\n String noShardTable = \"noShard\";\n \n AbstractFreeSqlBuilder test = create();\n test.select();\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"SELECT\", test.build());\n \...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder select() {\n return append(SELECT);\n }", "class_method_signature": "AbstractFreeSqlBuilder.select()", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder select()", "identifier": "select", "invocations": [ "append" ], "modifiers"...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_103
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testLessThan() {\n testExpression(wrappedTemplate + \" < ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().lessThan(template);\n }\n public AbstractFreeSqlBuilder createExpWithParamet...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder lessThan(String name) {\n return append(Expressions.lessThan(name));\n }", "class_method_signature": "AbstractFreeSqlBuilder.lessThan(String name)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder lessThan(String name)", "identifier": "...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_115
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testBuildMeltdownAtBegining() throws SQLException {\n FreeSelectSqlBuilder test = createTest();\n\n test = createTest();\n test.where(template).ignoreNull(null).and().appendExpression(template).or().appendExpression(template).ignoreNull(null).groupBy(template);\n...
{ "fields": [ { "declarator": "mapper", "modifier": "@SuppressWarnings(\"rawtypes\")\n private", "original_string": "@SuppressWarnings(\"rawtypes\")\n private DalRowMapper mapper;", "type": "DalRowMapper", "var_name": "mapper" }, { "declarator": "merger", "m...
{ "body": "public String build() {\n String query = super.build();\n\n return count > 0 ? getDbCategory().buildPage(query, start, count) : query;\n }", "class_method_signature": "FreeSelectSqlBuilder.build()", "constructor": false, "full_signature": "public String build()", "identifier": "bui...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_95
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testAnd() {\n AbstractFreeSqlBuilder test = create();\n test.and();\n assertEquals(\"\", test.build());\n \n test = create();\n test.and(template);\n assertEquals(template, test.build());\n\n test = create();\n test.and(t...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder and() {\n return append(Expressions.AND);\n }", "class_method_signature": "AbstractFreeSqlBuilder.and()", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder and()", "identifier": "and", "invocations": [ "append" ], "modifiers": "...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_142
{ "fields": [ { "declarator": "connectionString = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String connectionString = \"dao_test_sqlsvr\";", "type": "String", "var_name": "connectionString" } ], "file": "dal-client/src/...
{ "body": "@Test\n public void testInitLogEntry() {\n TestConnectionAction test = new TestConnectionAction();\n test.initLogEntry(\"dao_test\", new DalHints());\n assertNotNull(test.entry);\n }", "class_method_signature": "ConnectionActionTest.testInitLogEntry()", "constructor": false, ...
{ "fields": [ { "declarator": "envUtils = DalElementFactory.DEFAULT.getEnvUtils()", "modifier": "private static final", "original_string": "private static final EnvUtils envUtils = DalElementFactory.DEFAULT.getEnvUtils();", "type": "EnvUtils", "var_name": "envUtils" }, { ...
{ "body": "public void initLogEntry(String logicDbName, DalHints hints) {\n this.entry = logger.createLogEntry();\n DatabaseSet databaseSet = DalClientFactory.getDalConfigure().getDatabaseSet(logicDbName);\n if (databaseSet instanceof ClusterDatabaseSet) {\n Cluster cluster = ((Cluster...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_143
{ "fields": [ { "declarator": "connectionString = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String connectionString = \"dao_test_sqlsvr\";", "type": "String", "var_name": "connectionString" } ], "file": "dal-client/src/...
{ "body": "@Test\n public void testStart() {\n TestConnectionAction test = new TestConnectionAction();\n test.initLogEntry(connectionString, new DalHints());\n test.start();\n assertTrue(test.start > 0);\n }", "class_method_signature": "ConnectionActionTest.testStart()", "constru...
{ "fields": [ { "declarator": "envUtils = DalElementFactory.DEFAULT.getEnvUtils()", "modifier": "private static final", "original_string": "private static final EnvUtils envUtils = DalElementFactory.DEFAULT.getEnvUtils();", "type": "EnvUtils", "var_name": "envUtils" }, { ...
{ "body": "public void start() {\n start = System.currentTimeMillis();\n logger.start(entry);\n }", "class_method_signature": "ConnectionAction.start()", "constructor": false, "full_signature": "public void start()", "identifier": "start", "invocations": [ "currentTimeMillis", "star...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_114
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testBuildMeltdownAtEnd() throws SQLException {\n FreeSelectSqlBuilder test = createTest();\n test.where(text(template), AND, expression(template).ignoreNull(null)).groupBy(template);\n assertEquals(\"WHERE template GROUP BY [template]\", test.build());\n \...
{ "fields": [ { "declarator": "mapper", "modifier": "@SuppressWarnings(\"rawtypes\")\n private", "original_string": "@SuppressWarnings(\"rawtypes\")\n private DalRowMapper mapper;", "type": "DalRowMapper", "var_name": "mapper" }, { "declarator": "merger", "m...
{ "body": "public String build() {\n String query = super.build();\n\n return count > 0 ? getDbCategory().buildPage(query, start, count) : query;\n }", "class_method_signature": "FreeSelectSqlBuilder.build()", "constructor": false, "full_signature": "public String build()", "identifier": "bui...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_94
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testBracket() {\n //Empty\n AbstractFreeSqlBuilder test = create();\n test.bracket(template);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"(template)\", test.build());\n \n test = create(...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder bracket(String... expressions) {\n return bracket(expressions(expressions));\n }", "class_method_signature": "AbstractFreeSqlBuilder.bracket(String... expressions)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder bracket(String... expres...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_82
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testAppendTable() {\n String noShardTable = \"noShard\";\n \n AbstractFreeSqlBuilder test = create();\n test.appendTable(noShardTable);\n test.setLogicDbName(logicDbName);\n test.setHints(new DalHints());\n assertEquals(\"[\" + noShard...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder appendTable(String tableName) {\n return append(table(tableName));\n }", "class_method_signature": "AbstractFreeSqlBuilder.appendTable(String tableName)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder appendTable(String tableName)", "...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_102
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testGreaterThanEquals() {\n testExpression(wrappedTemplate + \" >= ?\", new ExpressionProvider() {\n public AbstractFreeSqlBuilder createExp() {\n return create().greaterThanEquals(template);\n }\n public AbstractFreeSqlBuilder c...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder greaterThanEquals(String name) {\n return append(Expressions.greaterThanEquals(name));\n }", "class_method_signature": "AbstractFreeSqlBuilder.greaterThanEquals(String name)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder greaterThanEqu...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_155
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" } ], "file": "dal-client/src/test/java/com/c...
{ "body": "@Test\n\tpublic void testDoInTransaction() {\n\t\tfinal DalHints hints = new DalHints();\n\t\ttry {\n\t\t\tfinal DalTransactionManager test = new DalTransactionManager(getDalConnectionManager());\n\t\t\tassertFalse(DalTransactionManager.isInTransaction());\n\t\t\tConnectionAction<?> action = new Connection...
{ "fields": [ { "declarator": "connManager", "modifier": "private", "original_string": "private DalConnectionManager connManager;", "type": "DalConnectionManager", "var_name": "connManager" }, { "declarator": "transactionHolder = new ThreadLocal<DalTransaction>()", ...
{ "body": "public <T> T doInTransaction(ConnectionAction<T> action, DalHints hints) throws SQLException {\n action.initLogEntry(connManager.getLogicDbName(), hints);\n action.start();\n\n Throwable ex = null;\n T result = null;\n int level;\n try {\n level = startT...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_41
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/file/PropertyFilePoolPropertiesProviderTest.java", "identifier": "PropertyFilePoolPropertiesProviderTest", "interfaces": "implements DataSourceConfigureConstants", "superclass": "" }
{ "body": "@Test\n public void testPropertyFilePoolPropertiesProvider() throws Exception {\n PropertyFilePoolPropertiesProvider provider = new PropertyFilePoolPropertiesProvider();\n PoolPropertiesConfigure configure = provider.getPoolProperties();\n // Custom value\n Assert.assertEqual...
{ "fields": [ { "declarator": "PROPERTY_FILE_NAME = \"datasource.properties\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_FILE_NAME = \"datasource.properties\";", "type": "String", "var_name": "PROPERTY_FILE_NAME" }, { ...
{ "body": "public PropertyFilePoolPropertiesProvider() {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n if (classLoader == null) {\n classLoader = PropertyFilePoolPropertiesProvider.class.getClassLoader();\n }\n\n URL url = classLoader.getResource(...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_16
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getDbShardShardIdWorkTest() {\n final DbShardContext context = new DbShardContext(\"whatever\");\n context.setShardId(100);\n context.setShardValue(100);\n\n final Map<String, Object> data1 = new HashMap<>();\n data1.put(\"id\", 7);\n final S...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public Integer getDbShard(String tableName, DbShardContext context) {\n return shardStrategyProxy.getDbShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getDbShard(String tableName, DbShardContext context)", "constructor": false, "full_signature": "@O...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_179
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/ServiceLoaderHelperTest.java", "identifier": "ServiceLoaderHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotOrdered(){\n\n DalConfigLoader instance = ServiceLoaderHelper.getInstance(DalConfigLoader.class);\n Assert.assertNull(instance);\n\n }", "class_method_signature": "ServiceLoaderHelperTest.testNotOrdered()", "constructor": false, "full_signature": "@Test ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ServiceLoaderHelper.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ServiceLoaderHelper.class);", "type": "Logger", "var_name": "LOGGER" }...
{ "body": "public static <T> T getInstance(Class<T> clazz) {\n T instance = null;\n try {\n Iterator<T> iterator = getIterator(clazz);\n\n if (!Ordered.class.isAssignableFrom(clazz)) {\n if (iterator.hasNext())\n return iterator.next();\n ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_180
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/helper/LoggerHelperTest.java", "identifier": "LoggerHelperTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToJSon() throws Exception {\n String finalString = \"{\\\"HasSql\\\":\\\"1\\\",\\\"Hash\\\":\\\"\\\",\\\"SqlTpl\\\":\\\"/*100008424-DRTestDao.insert[MSG_ID:123456]*/INSERT INTO `testTable` (`Name`) VALUES(?)\\\",\\\"Param\\\":\\\"aXuR5QP4NhJhsYi3H+rKEdHG/06mtU6m\\\",\\\"Is...
{ "fields": [ { "declarator": "SQLHIDDENString = \"*\"", "modifier": "public static final", "original_string": "public static final String SQLHIDDENString = \"*\";", "type": "String", "var_name": "SQLHIDDENString" }, { "declarator": "NULL_SET = \"NullSet\"", "modi...
{ "body": "public static String toJson(Object object) {\n\t\ttry {\n\t\t\treturn JsonUtils.toJson(object);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn \"Error convert log value to json string!\";\n\t}", "class_method_signature": "LoggerHelper.toJson(Object object)", "constructor": ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_57
{ "fields": [ { "declarator": "all = new ConcurrentHashMap<>()", "modifier": "static", "original_string": "static ConcurrentHashMap<String, Object> all = new ConcurrentHashMap<>();", "type": "ConcurrentHashMap<String, Object>", "var_name": "all" } ], "file": "dal-client/src/t...
{ "body": "@Test\n\tpublic void testExecuteCrossShard() {\n\t\tDalRequestExecutor test = new DalRequestExecutor();\n\t\tTestDalRequest request = new TestDalRequest(null, new Integer[]{1, 2});\n\t\tDalHints hints = new DalHints();\n\t\t\n\t\ttry {\n\t\t\tInteger result = test.execute(hints, request);\n\t\t\tassertEqua...
{ "fields": [ { "declarator": "LOGGER = DalElementFactory.DEFAULT.getILogger()", "modifier": "private static final", "original_string": "private static final ILogger LOGGER = DalElementFactory.DEFAULT.getILogger();", "type": "ILogger", "var_name": "LOGGER" }, { "declara...
{ "body": "public <T> T execute(final DalHints hints, final DalRequest<T> request) throws SQLException {\n\t\treturn execute(hints, request, null);\n\t}", "class_method_signature": "DalRequestExecutor.execute(final DalHints hints, final DalRequest<T> request)", "constructor": false, "full_signature": "public T ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_138
{ "fields": [ { "declarator": "logicDbName = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String logicDbName = \"dao_test_sqlsvr\";", "type": "String", "var_name": "logicDbName" }, { "declarator": "logicShardDbName =...
{ "body": "@Test\n\tpublic void testGetConnection() {\n\t\tDalTransaction test = null;\n\t\ttry {\n\t\t\ttest = new DalTransaction(getDalConnection(), logicDbName);\n\t\t\tassertNotNull(test.getConnection());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}finally {\n\t\t\tif(test != nul...
{ "fields": [ { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", "type": "String", "var_name": "logicDbName" }, { "declarator": "connHolder", "modifier": "private", "original_string": "private DalConnectio...
{ "body": "public DalConnection getConnection() {\n return connHolder;\n }", "class_method_signature": "DalTransaction.getConnection()", "constructor": false, "full_signature": "public DalConnection getConnection()", "identifier": "getConnection", "invocations": [], "modifiers": "public", "par...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_20
{ "fields": [ { "declarator": "cluster", "modifier": "private static", "original_string": "private static Cluster cluster;", "type": "Cluster", "var_name": "cluster" } ], "file": "dal-cluster-client/src/test/java/com/ctrip/framework/dal/cluster/client/cluster/DefaultClusterTe...
{ "body": "@Test\n public void getTableShardTest() {\n final TableShardContext assignationShardIdContext = new TableShardContext(\"whatever\").setShardId(\"100\");\n final String assignationShardIdShardIndex = cluster.getTableShard(\"table13\", assignationShardIdContext);\n Assert.assertEquals...
{ "fields": [ { "declarator": "clusterConfig", "modifier": "private", "original_string": "private ClusterConfigImpl clusterConfig;", "type": "ClusterConfigImpl", "var_name": "clusterConfig" }, { "declarator": "databaseShards = new HashMap<>()", "modifier": "privat...
{ "body": "@Override\n public String getTableShard(String tableName, TableShardContext context) {\n return shardStrategyProxy.getTableShard(tableName, context);\n }", "class_method_signature": "DefaultCluster.getTableShard(String tableName, TableShardContext context)", "constructor": false, "full_s...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_98
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testWhen() {\n AbstractFreeSqlBuilder test = create();\n Expression exp;\n try {\n test.when(false);\n fail();\n } catch (Exception e) {\n }\n \n test = create();\n try {\n test.append(template)....
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder when(boolean condition) {\n getLastExpression().when(condition);\n return this;\n }", "class_method_signature": "AbstractFreeSqlBuilder.when(boolean condition)", "constructor": false, "full_signature": "public AbstractFreeSqlBuilder when(boolean conditio...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_118
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testEqual() throws SQLException {\n Clause test = equal(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" = ?\", test.build());\n }", "class_method_signature": "ExpressionsTest.testEqual()", "constructor": false, "full_signature": "@Test p...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static ColumnExpression equal(String name) {\n return columnExpression(\"%s = ?\", name);\n }", "class_method_signature": "Expressions.equal(String name)", "constructor": false, "full_signature": "public static ColumnExpression equal(String name)", "identifier": "equal", "invocat...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_77
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testSetIn() throws SQLException {\n AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();\n test.setLogicDbName(logicDbName);\n StatementParameters p = new StatementParameters();\n test.with(p);\n \n List<String> paras = new ArrayList<>...
{ "fields": [ { "declarator": "EMPTY = \"\"", "modifier": "public static final", "original_string": "public static final String EMPTY = \"\";", "type": "String", "var_name": "EMPTY" }, { "declarator": "PLACE_HOLDER = \"?\"", "modifier": "public static final", ...
{ "body": "public AbstractFreeSqlBuilder setIn(String name, List<?> values, int sqlType) {\n context.getParameters().setInParameter(nextIndex(), name, sqlType, values);\n return this;\n }", "class_method_signature": "AbstractFreeSqlBuilder.setIn(String name, List<?> values, int sqlType)", "constr...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_7
{ "fields": [ { "declarator": "daoOfDatabaseSet", "modifier": "@Mock\n private", "original_string": "@Mock\n private DaoOfDatabaseSet daoOfDatabaseSet;", "type": "DaoOfDatabaseSet", "var_name": "daoOfDatabaseSet" } ], "file": "dal-dao-gen/src/test/java/com/ctrip/platfor...
{ "body": "@Test\n public void getAllInOneNameTest() throws SQLException {\n String dbname = \"abtest_dalcluster\";\n assertEquals(dbname, AllInOneNameUtils.getAllInOneName(dbname, \"dalcluster\"));\n\n PowerMockito.mockStatic(BeanGetter.class);\n PowerMockito.when(BeanGetter.getDaoOfDa...
{ "fields": [], "file": "dal-dao-gen/src/main/java/com/ctrip/platform/dal/daogen/utils/AllInOneNameUtils.java", "identifier": "AllInOneNameUtils", "interfaces": "", "methods": [ { "class_method_signature": "AllInOneNameUtils.getAllInOneName(String dbName, String modeType)", "constructor": fals...
{ "body": "public static String getAllInOneName(String dbName, String modeType) throws SQLException {\n if (DbModeTypeEnum.Cluster.getDes().equals(modeType)) {\n return dbName;\n } else {\n DatabaseSetEntry databaseSetEntry =\n BeanGetter.getDaoOfDatabaseSet().ge...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_61
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/task/DalSingleTaskRequestTest.java", "identifier": "DalSingleTaskRequestTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testValidateAndPrepare() {\n\t\tDalSingleTaskRequest<Integer> test = null;\n\t\ttry {\n\t\t\tInteger i = null;\n\t\t\ttest = new DalSingleTaskRequest<>(\"\", new DalHints(), i, new TestSingleTask());\n\t\t\ttest.validateAndPrepare();\n\t\t\tfail();\n\t\t} catch (SQLException e) {\n\t\t...
{ "fields": [ { "declarator": "caller", "modifier": "private", "original_string": "private String caller;", "type": "String", "var_name": "caller" }, { "declarator": "logicDbName", "modifier": "private", "original_string": "private String logicDbName;", ...
{ "body": "@Override\n public void validateAndPrepare() throws SQLException {\n if (isList && null == rawPojos)\n throw new DalException(ErrorCode.ValidatePojoList);\n\n if (!isList && null == rawPojo)\n throw new DalException(ErrorCode.ValidatePojo);\n\n if (task == null...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_159
{ "fields": [ { "declarator": "connectionString = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String connectionString = \"dao_test_sqlsvr\";", "type": "String", "var_name": "connectionString" } ], "file": "dal-client/src/...
{ "body": "@Test\n\tpublic void testDalConnection() throws SQLException {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tDalConnection test = getConnection();\n\t\t\tassertNotNull(test);\n\t\t} catch (Throwable e){\n\t\t\tfail();\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tif(conn != null)\n\t\t\t\tconn.close()...
{ "fields": [ { "declarator": "oldIsolationLevel", "modifier": "private", "original_string": "private Integer oldIsolationLevel;", "type": "Integer", "var_name": "oldIsolationLevel" }, { "declarator": "newIsolationLevel", "modifier": "private", "original_str...
{ "body": "public DalConnection(Connection conn, boolean master, String shardId, DbMeta meta) throws SQLException {\n this.oldIsolationLevel = conn.getTransactionIsolation();\n this.conn = conn;\n this.master = master;\n this.shardId = shardId;\n this.meta = meta;\n this.logg...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_36
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/configure/ConnectionStringParserTest.java", "identifier": "ConnectionStringParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseMySqlUrl5() {\n String ipUrl = \"jdbc:mysql://(host=10.1.1.1,port=3308,type=master,protocol=tcp):3306:3306/\";\n String domainUrl = \"jdbc:mysql://(port=3308,host=test.db.com):3306:3306/\";\n HostAndPort ipAndPort = ConnectionStringParser.parseHostPortFr...
{ "fields": [ { "declarator": "parser = null", "modifier": "private static", "original_string": "private static ConnectionStringParser parser = null;", "type": "ConnectionStringParser", "var_name": "parser" }, { "declarator": "dburlPattern =\n Pattern.compile...
{ "body": "public static HostAndPort parseHostPortFromURL(String url) {\n if (StringUtils.isEmpty(url)) {\n return new HostAndPort();\n }\n\n if (url.toLowerCase().startsWith(MYSQL_URL_PREFIX)) {\n String host = null;\n Integer port = null;\n\n // jdbc:...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_122
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testLessThan() throws SQLException {\n Clause test = lessThan(template);\n setEnv(test);\n\n assertEquals(wrappedTemplate + \" < ?\", test.build());\n }", "class_method_signature": "ExpressionsTest.testLessThan()", "constructor": false, "full_signature":...
{ "fields": [ { "declarator": "NULL = new NullExpression()", "modifier": "public static final", "original_string": "public static final NullExpression NULL = new NullExpression();", "type": "NullExpression", "var_name": "NULL" }, { "declarator": "TRUE = new ImmutableExp...
{ "body": "public static ColumnExpression lessThan(String name) {\n return columnExpression(\"%s < ?\", name);\n }", "class_method_signature": "Expressions.lessThan(String name)", "constructor": false, "full_signature": "public static ColumnExpression lessThan(String name)", "identifier": "lessThan"...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_175
{ "fields": [], "file": "dal-client/src/test/java/com/ctrip/platform/dal/dao/markdown/TimeBucketCounterTest.java", "identifier": "TimeBucketCounterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIncrease() {\n\t\ttry {\n\t\t\t// 0\n\t\t\tTimeBucketCounter test = new TimeBucketCounter(1000, System.currentTimeMillis());\n\t\t\tassertEquals(0, test.getCount());\n\t\t\tThread.sleep(200);\n\t\t\t// 200 [3][0]\n\t\t\ttest.increase();\n\t\t\ttest.increase();\n\t\t\ttest.increase(...
{ "fields": [ { "declarator": "duration", "modifier": "private", "original_string": "private long duration;", "type": "long", "var_name": "duration" }, { "declarator": "bucketInterval", "modifier": "private", "original_string": "private long bucketInterval;"...
{ "body": "public void increase() {\n\t\tcheckBucket();\n\t\tcounters[0]++;\n\t}", "class_method_signature": "TimeBucketCounter.increase()", "constructor": false, "full_signature": "public void increase()", "identifier": "increase", "invocations": [ "checkBucket" ], "modifiers": "public", "paramet...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_163
{ "fields": [ { "declarator": "connectionString = \"dao_test_sqlsvr\"", "modifier": "private static final", "original_string": "private static final String connectionString = \"dao_test_sqlsvr\";", "type": "String", "var_name": "connectionString" } ], "file": "dal-client/src/...
{ "body": "@Test\n\tpublic void testApplyHints() throws SQLException {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tDalConnection test = getConnection();\n\t\t\tDalHints hints = new DalHints();\n\t\t\thints.setIsolationLevel(Connection.TRANSACTION_SERIALIZABLE);\n\t\t\ttest.applyHints(hints);\n\t\t\tconn = test.get...
{ "fields": [ { "declarator": "oldIsolationLevel", "modifier": "private", "original_string": "private Integer oldIsolationLevel;", "type": "Integer", "var_name": "oldIsolationLevel" }, { "declarator": "newIsolationLevel", "modifier": "private", "original_str...
{ "body": "public void applyHints(DalHints hints) throws SQLException {\n Integer level = hints.getInt(DalHintEnum.isolationLevel);\n\n if (level == null || oldIsolationLevel.equals(level))\n return;\n\n newIsolationLevel = level;\n conn.setTransactionIsolation(level);\n }", ...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
64185596_134
{ "fields": [ { "declarator": "template = \"template\"", "modifier": "private static final", "original_string": "private static final String template = \"template\";", "type": "String", "var_name": "template" }, { "declarator": "wrappedTemplate = \"[template]\"", ...
{ "body": "@Test\n public void testUpdate() throws SQLException {\n FreeUpdateSqlBuilder test = createTest();\n\n test.update(noShardTableName);\n assertEquals(\"UPDATE \" + wrappedNoShardTableName, test.build());\n \n test = createTest();\n\n test.update(table(noShardTabl...
{ "fields": [ { "declarator": "INSERT_INTO = \"INSERT INTO\"", "modifier": "public static final", "original_string": "public static final String INSERT_INTO = \"INSERT INTO\";", "type": "String", "var_name": "INSERT_INTO" }, { "declarator": "VALUES = \"VALUES\"", ...
{ "body": "public FreeUpdateSqlBuilder update(String tableName) {\n return update(table(tableName));\n }", "class_method_signature": "FreeUpdateSqlBuilder.update(String tableName)", "constructor": false, "full_signature": "public FreeUpdateSqlBuilder update(String tableName)", "identifier": "update"...
{ "created": "7/26/2016 3:07:03 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 64185596, "size": null, "stargazer_count": null, "stars": 1054, "updates": "2020-01-19T21:20:53+00:00", "url": "https://github.com/ctripcorp/dal" ...
167594750_1
{ "fields": [], "file": "Geodisy/Geodisy/src/test/java/Dataverse/DataverseJSONFieldClasses/Fields/DataverseJSONGeoFieldClasses/GeographicFieldsTest.java", "identifier": "GeographicFieldsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void addBB() {\n }", "class_method_signature": "GeographicFieldsTest.addBB()", "constructor": false, "full_signature": "@Test void addBB()", "identifier": "addBB", "invocations": [], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void addBB()", "...
{ "fields": [ { "declarator": "geoCovers", "modifier": "", "original_string": "List<GeographicCoverage> geoCovers;", "type": "List<GeographicCoverage>", "var_name": "geoCovers" }, { "declarator": "geoBBoxes", "modifier": "", "original_string": "List<Geograph...
{ "body": "public void addBB(List<GeographicBoundingBox> bboxes, GeographicBoundingBox gBB) {\n double east = gBB.getEastLongDub();\n double west = gBB.getWestLongDub();\n double north = gBB.getNorthLatDub();\n double south = gBB.getSouthLatDub();\n\n if(east<west && east!=-181 && w...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 167594750, "size": 170226, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/ubc-library/geodisy" }
167594750_0
{ "fields": [], "file": "Geodisy/Geodisy/src/test/java/BaseFiles/SendMailTest.java", "identifier": "SendMailTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void send() {\n SendMail sm = new SendMail();\n boolean sent = sm.send(\"Paul.dante@ubc.ca\",\"This is where the doi would go.\");\n System.out.println(\"The email got sent? \" + sent);\n }", "class_method_signature": "SendMailTest.send()", "constructor": false, "fu...
{ "fields": [ { "declarator": "logger = new GeoLogger(this.getClass())", "modifier": "", "original_string": "GeoLogger logger = new GeoLogger(this.getClass());", "type": "GeoLogger", "var_name": "logger" } ], "file": "Geodisy/Geodisy/src/main/java/BaseFiles/SendMail.java", ...
{ "body": "public boolean send(String recipient, String doi){\n String sender = \"Geodisy.Info@ubc.ca\";\n String host = \"localhost\";\n String subject = \"Please update you dataset if you want map-based searching for it\";\n Properties props = System.getProperties();\n props.put(\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 167594750, "size": 170226, "stargazer_count": 7, "stars": null, "updates": null, "url": "https://github.com/ubc-library/geodisy" }
80376233_1
{ "fields": [], "file": "darksky-forecast-api/src/test/java/tk/plogitech/darksky/forecast/model/LongitudeTest.java", "identifier": "LongitudeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void longitude_string_url_values_are_correct() {\n\tLongitude l = new Longitude(-0.000066);\n\n\tassertEquals(\"-0.000066\", l.toString());\n }", "class_method_signature": "LongitudeTest.longitude_string_url_values_are_correct()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [ { "declarator": "value", "modifier": "private final", "original_string": "private final Double value;", "type": "Double", "var_name": "value" } ], "file": "darksky-forecast-api/src/main/java/tk/plogitech/darksky/forecast/model/Longitude.java", "identifier": "L...
{ "body": "@Override\n public String toString() {\n\treturn String.format(Locale.ENGLISH, \"%f\", value);\n }", "class_method_signature": "Longitude.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "format" ], ...
{ "created": null, "fork": null, "fork_count": 19, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80376233, "size": 646, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/200Puls/darksky-forecast-api" }
80376233_0
{ "fields": [], "file": "darksky-forecast-api/src/test/java/tk/plogitech/darksky/forecast/model/LatitudeTest.java", "identifier": "LatitudeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void latitude_string_url_values_are_correct() {\n\tLatitude l = new Latitude(-0.000066);\n\n\tassertEquals(\"-0.000066\", l.toString());\n }", "class_method_signature": "LatitudeTest.latitude_string_url_values_are_correct()", "constructor": false, "full_signature": "@Test public ...
{ "fields": [ { "declarator": "value", "modifier": "private final", "original_string": "private final Double value;", "type": "Double", "var_name": "value" } ], "file": "darksky-forecast-api/src/main/java/tk/plogitech/darksky/forecast/model/Latitude.java", "identifier": "La...
{ "body": "@Override\n public String toString() {\n\treturn String.format(Locale.ENGLISH, \"%f\", value);\n }", "class_method_signature": "Latitude.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "format" ], ...
{ "created": null, "fork": null, "fork_count": 19, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80376233, "size": 646, "stargazer_count": 32, "stars": null, "updates": null, "url": "https://github.com/200Puls/darksky-forecast-api" }
62553999_126
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullStringsEquals() throws Exception {\n boolean equals = TextUtils.equals(null, null);\n assertTrue(equals);\n }", "class_method_signature": "TextUtilsTest.testNullStringsEquals()", "constructor": false, "full_signature": "@Test public void testNullStrings...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_92
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/UserTagResponseTest.java", "identifier": "UserTagResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUserTagsNotNull() throws Exception {\n UserTagResponse userTagResponse = new UserTagResponse();\n assertNotNull(userTagResponse.getUserTags());\n }", "class_method_signature": "UserTagResponseTest.testUserTagsNotNull()", "constructor": false, "full_signatur...
{ "fields": [ { "declarator": "mUserTags", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<UserTag> mUserTags;", "type": "List<UserTag>", "var_name": "mUserTags" } ], "file": "StackExchangeClient/app/src/...
{ "body": "@NonNull\n public List<UserTag> getUserTags() {\n if (mUserTags == null) {\n mUserTags = new ArrayList<>();\n }\n return mUserTags;\n }", "class_method_signature": "UserTagResponse.getUserTags()", "constructor": false, "full_signature": "@NonNull public List<User...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_84
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/content/TagTest.java", "identifier": "TagTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTag() throws Exception {\n String tagSql = \"sql\";\n Tag tag = new Tag(tagSql, true);\n assertEquals(tagSql, tag.getName());\n }", "class_method_signature": "TagTest.testTag()", "constructor": false, "full_signature": "@Test public void testTag()", ...
{ "fields": [ { "declarator": "mName", "modifier": "@SerializedName(\"name\")\n private final", "original_string": "@SerializedName(\"name\")\n private final String mName;", "type": "String", "var_name": "mName" }, { "declarator": "mIsFavourite", "modifier":...
{ "body": "public Tag(@NonNull Parcel parcel) {\n mName = parcel.readString();\n boolean[] values = new boolean[1];\n parcel.readBooleanArray(values);\n mIsFavourite = values[0];\n }", "class_method_signature": "Tag.Tag(@NonNull Parcel parcel)", "constructor": true, "full_signatur...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_130
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSecondStringNull() throws Exception {\n String s = \"zyx\";\n boolean equals = TextUtils.equals(s, null);\n assertFalse(equals);\n }", "class_method_signature": "TextUtilsTest.testSecondStringNull()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_47
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorShownOnlyOnce() throws Exception {\n Bundle savedInstanceState = Mockito.mock(Bundle.class);\n Mockito.when(savedInstanceState.getBoolean(ERROR_SHOWN_KEY)).thenReturn(true);\n\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n mPre...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mContext", ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n\n int questionId = mQues...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_10
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testCheckAuthorizedTrue() throws Exception {\n Settings.putToken(mContext, TEST_TOKEN);\n\n mPresenter.checkIfAuthorized();\n verify(mView).openRepositoriesScreen();\n mPreferences.edit().clear().apply();\n }", "class_method_signature": "LogInPresente...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void checkIfAuthorized() {\n String token = Settings.getToken(mContext);\n if (!TextUtils.isEmpty(token)) {\n mView.openRepositoriesScreen();\n }\n }", "class_method_signature": "LogInPresenter.checkIfAuthorized()", "constructor": false, "full_signature": "pu...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_51
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private MainView mView;", "type": "MainView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private MainPresenter mPresenter;"...
{ "body": "@Test\n public void testMultipleTabs() throws Exception {\n List<String> tags = new ArrayList<>();\n tags.add(\"android\");\n tags.add(\"java\");\n RepositoryProvider.setLocalRepository(new TagsRepository(tags));\n\n mPresenter.init();\n Mockito.verify(mView).ad...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository().getCurrentUser()\n .subscribe(this::handleUser, new StubAction<>());\n\n RxLoader.create(mContext, mLm, R.id.user_info_loader_id,\n RepositoryProvider.provideRemoteRepository().getCurrentUser())\n...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_26
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/OkHttpTest.java", "identifier": "OkHttpTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNewClient() throws Exception {\n OkHttpClient client = OkHttp.newClient(\"aaa\");\n assertNotNull(client);\n }", "class_method_signature": "OkHttpTest.testNewClient()", "constructor": false, "full_signature": "@Test public void testNewClient()", "identifi...
{ "fields": [ { "declarator": "CONNECT_TIMEOUT = 15", "modifier": "private static final", "original_string": "private static final int CONNECT_TIMEOUT = 15;", "type": "int", "var_name": "CONNECT_TIMEOUT" }, { "declarator": "READ_TIMEOUT = 30", "modifier": "private...
{ "body": "@NonNull\n public static OkHttpClient newClient(@NonNull String token) {\n sClient = new OkHttpClient.Builder()\n .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)\n .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS)\n .writeTimeout(WRITE_TIMEOUT, TimeUnit....
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_71
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private QuestionsListView mView;", "type": "QuestionsListView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Question...
{ "body": "@Test\n public void testQuestionsShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ContentRemoteRepository());\n RepositoryProvider.setLocalRepository(new ContentLocalRepository());\n\n mPresenter.init();\n Mockito.verify(mView, times(2)).showQuestions(a...
{ "fields": [ { "declarator": "VISIBILITY_MARGIN = 10", "modifier": "private static final", "original_string": "private static final int VISIBILITY_MARGIN = 10;", "type": "int", "var_name": "VISIBILITY_MARGIN" }, { "declarator": "mContext", "modifier": "private fi...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository()\n .questions(mTag)\n .subscribe(this::handleQuestions, this::handleError);\n\n RxLoader.create(mContext, mLm, mTag.hashCode(),\n RepositoryProvider.provideRemoteRepository().questio...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_2
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testBenefitsCount() throws Exception {\n assertEquals(3, mPresenter.getBenefits().size());\n }", "class_method_signature": "WalkthroughPresenterTest.testBenefitsCount()", "constructor": false, "full_signature": "@Test public void testBenefitsCount()", "identifier": ...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "@NonNull\n public List<Benefit> getBenefits() {\n return new ArrayList<Benefit>() {\n {\n add(Benefit.WORK_TOGETHER);\n add(Benefit.CODE_HISTORY);\n add(Benefit.PUBLISH_SOURCE);\n }\n };\n }", "class_method_signature":...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_67
{ "fields": [ { "declarator": "mAuthView", "modifier": "private", "original_string": "private AuthView mAuthView;", "type": "AuthView", "var_name": "mAuthView" }, { "declarator": "mKeyValueStorage", "modifier": "private", "original_string": "private TestKeyV...
{ "body": "@Test\n public void testEmptyInit() throws Exception {\n AuthPresenter presenter = new AuthPresenter(mAuthView);\n presenter.init();\n Mockito.verifyNoMoreInteractions(mAuthView);\n }", "class_method_signature": "AuthPresenterTest.testEmptyInit()", "constructor": false, "fu...
{ "fields": [ { "declarator": "OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&\" +\n \"scope=%s&redirect_uri=%s\"", "modifier": "private static final", "original_string": "private static final String OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&...
{ "body": "public void init() {\n RepositoryProvider.provideKeyValueStorage().getAccessToken()\n .map(TextUtils::isEmpty)\n .map(value -> !value)\n .subscribe(this::onAuth);\n }", "class_method_signature": "AuthPresenter.init()", "constructor": false, "full...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_88
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/UserResponseTest.java", "identifier": "UserResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUsersNotNull() throws Exception {\n UserResponse userResponse = new UserResponse();\n assertNotNull(userResponse.getUsers());\n }", "class_method_signature": "UserResponseTest.testUsersNotNull()", "constructor": false, "full_signature": "@Test public void t...
{ "fields": [ { "declarator": "mUsers", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<User> mUsers;", "type": "List<User>", "var_name": "mUsers" } ], "file": "StackExchangeClient/app/src/main/java/ru/ar...
{ "body": "@NonNull\n public List<User> getUsers() {\n if (mUsers == null) {\n mUsers = new ArrayList<>();\n }\n return mUsers;\n }", "class_method_signature": "UserResponse.getUsers()", "constructor": false, "full_signature": "@NonNull public List<User> getUsers()", "ide...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_30
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/DefaultApiProviderTest.java", "identifier": "DefaultApiProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGithubService() throws Exception {\n ApiProvider provider = new DefaultApiProvider(\"cc\");\n assertNotNull(provider.provideGithubService());\n }", "class_method_signature": "DefaultApiProviderTest.testGithubService()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "mToken", "modifier": "private final", "original_string": "private final String mToken;", "type": "String", "var_name": "mToken" }, { "declarator": "mService", "modifier": "private final", "original_string": "private final Githu...
{ "body": "@NonNull\n @Override\n public GithubService provideGithubService() {\n return mService;\n }", "class_method_signature": "DefaultApiProvider.provideGithubService()", "constructor": false, "full_signature": "@NonNull @Override public GithubService provideGithubService()", "identifier"...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_110
{ "fields": [ { "declarator": "mRxLoader", "modifier": "private", "original_string": "private RxLoader<Integer> mRxLoader;", "type": "RxLoader<Integer>", "var_name": "mRxLoader" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/rxloade...
{ "body": "@Test\n public void testRestart() throws Exception {\n mRxLoader.restart(integer -> {\n assertEquals(1, integer.intValue());\n });\n }", "class_method_signature": "RxLoaderTest.testRestart()", "constructor": false, "full_signature": "@Test public void testRestart()", ...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLmRef", "modifier": "private final", "original_string": "private final...
{ "body": "public void restart() {\n restart(Observers.<T>empty());\n }", "class_method_signature": "RxLoader.restart()", "constructor": false, "full_signature": "public void restart()", "identifier": "restart", "invocations": [ "restart", "empty" ], "modifiers": "public", "parameter...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_106
{ "fields": [ { "declarator": "mObserver", "modifier": "private", "original_string": "private Observer<Integer> mObserver;", "type": "Observer<Integer>", "var_name": "mObserver" }, { "declarator": "mRxLc", "modifier": "private", "original_string": "private R...
{ "body": "@Test\n public void testOnCreateLoader() throws Exception {\n Loader<RxResult<Integer>> loader = mRxLc.onCreateLoader(0, mock(Bundle.class));\n Assert.assertNotNull(loader);\n }", "class_method_signature": "RxLcImplTest.testOnCreateLoader()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mObservable", "modifier": "private final", "original_string": "private ...
{ "body": "@Override\n public Loader<RxResult<T>> onCreateLoader(int id, Bundle args) {\n return new RxResultLoader<>(mContext, mObservable);\n }", "class_method_signature": "RxLcImpl.onCreateLoader(int id, Bundle args)", "constructor": false, "full_signature": "@Override public Loader<RxResult<T>>...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_107
{ "fields": [ { "declarator": "mObserver", "modifier": "private", "original_string": "private Observer<Integer> mObserver;", "type": "Observer<Integer>", "var_name": "mObserver" }, { "declarator": "mRxLc", "modifier": "private", "original_string": "private R...
{ "body": "@Test\n public void testOnLoaderReset() throws Exception {\n mRxLc.onLoaderReset(mRxLc.onCreateLoader(0, mock(Bundle.class)));\n verify(mObserver, times(0)).onError(any(Throwable.class));\n verify(mObserver, times(0)).onNext(anyInt());\n verify(mObserver, times(0)).onComplete...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mObservable", "modifier": "private final", "original_string": "private ...
{ "body": "@Override\n public void onLoaderReset(Loader<RxResult<T>> loader) {\n // Do nothing\n }", "class_method_signature": "RxLcImpl.onLoaderReset(Loader<RxResult<T>> loader)", "constructor": false, "full_signature": "@Override public void onLoaderReset(Loader<RxResult<T>> loader)", "identifi...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_111
{ "fields": [ { "declarator": "mRxLoader", "modifier": "private", "original_string": "private RxLoader<Integer> mRxLoader;", "type": "RxLoader<Integer>", "var_name": "mRxLoader" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/rxloade...
{ "body": "@Test\n public void testRestartOnComplete() throws Exception {\n Action0 onComplete = Mockito.mock(Action0.class);\n mRxLoader.restart(new StubAction<>(), new StubAction<>(), onComplete);\n Mockito.verify(onComplete).call();\n }", "class_method_signature": "RxLoaderTest.testRes...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLmRef", "modifier": "private final", "original_string": "private final...
{ "body": "public void restart() {\n restart(Observers.<T>empty());\n }", "class_method_signature": "RxLoader.restart()", "constructor": false, "full_signature": "public void restart()", "identifier": "restart", "invocations": [ "restart", "empty" ], "modifiers": "public", "parameter...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_31
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullString() throws Exception {\n assertTrue(TextUtils.isEmpty(null));\n }", "class_method_signature": "TextUtilsTest.testNullString()", "constructor": false, "full_signature": "@Test public void testNullString()", "identifier": "testNullString", "invocations"...
{ "fields": [], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUtils()", "iden...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_66
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorShownOnlyOnce() throws Exception {\n Bundle savedInstanceState = Mockito.mock(Bundle.class);\n Mockito.when(savedInstanceState.getBoolean(ERROR_SHOWN_KEY)).thenReturn(true);\n\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n mPre...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "QUESTION_LINK_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n mView.setEmptyText(R.string.no_answers);\n\n RxLoader.create(mContext, mLm, R.id.answers_loader_id, Re...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_89
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/UserResponseTest.java", "identifier": "UserResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetUsers() throws Exception {\n UserResponse userResponse = new UserResponse();\n List<User> users = new ArrayList<>();\n users.add(new User());\n userResponse.setUsers(users);\n assertTrue(users == userResponse.getUsers());\n }", "class_me...
{ "fields": [ { "declarator": "mUsers", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<User> mUsers;", "type": "List<User>", "var_name": "mUsers" } ], "file": "StackExchangeClient/app/src/main/java/ru/ar...
{ "body": "public void setUsers(@NonNull List<User> users) {\n mUsers = users;\n }", "class_method_signature": "UserResponse.setUsers(@NonNull List<User> users)", "constructor": false, "full_signature": "public void setUsers(@NonNull List<User> users)", "identifier": "setUsers", "invocations": [],...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_70
{ "fields": [ { "declarator": "mAuthView", "modifier": "private", "original_string": "private AuthView mAuthView;", "type": "AuthView", "var_name": "mAuthView" }, { "declarator": "mKeyValueStorage", "modifier": "private", "original_string": "private TestKeyV...
{ "body": "@Test\n public void testHandleSuccessUrl() throws Exception {\n AuthPresenter presenter = new AuthPresenter(mAuthView);\n String url = \"https://...#access_token=token\";\n presenter.onSuccessUrl(url);\n\n assertEquals(\"token\", RepositoryProvider.provideKeyValueStorage().ob...
{ "fields": [ { "declarator": "OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&\" +\n \"scope=%s&redirect_uri=%s\"", "modifier": "private static final", "original_string": "private static final String OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&...
{ "body": "public void onSuccessUrl(@NonNull String url) {\n String accessToken = url.split(\"#\")[1].split(\"=\")[1];\n RepositoryProvider.provideKeyValueStorage().saveAccessToken(accessToken).subscribe(this::onAuth);\n }", "class_method_signature": "AuthPresenter.onSuccessUrl(@NonNull String url)...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_3
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testBenefits() throws Exception {\n assertEquals(Benefit.WORK_TOGETHER, mPresenter.getBenefits().get(0));\n assertEquals(Benefit.CODE_HISTORY, mPresenter.getBenefits().get(1));\n assertEquals(Benefit.PUBLISH_SOURCE, mPresenter.getBenefits().get(2));\n }", "c...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "@NonNull\n public List<Benefit> getBenefits() {\n return new ArrayList<Benefit>() {\n {\n add(Benefit.WORK_TOGETHER);\n add(Benefit.CODE_HISTORY);\n add(Benefit.PUBLISH_SOURCE);\n }\n };\n }", "class_method_signature":...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_27
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/OkHttpTest.java", "identifier": "OkHttpTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testClientChanges() throws Exception {\n OkHttpClient client1 = OkHttp.newClient(\"token\");\n OkHttpClient client2 = OkHttp.newClient(\"token\");\n assertFalse(client1 == client2);\n }", "class_method_signature": "OkHttpTest.testClientChanges()", "constru...
{ "fields": [ { "declarator": "CONNECT_TIMEOUT = 15", "modifier": "private static final", "original_string": "private static final int CONNECT_TIMEOUT = 15;", "type": "int", "var_name": "CONNECT_TIMEOUT" }, { "declarator": "READ_TIMEOUT = 30", "modifier": "private...
{ "body": "@NonNull\n public static OkHttpClient newClient(@NonNull String token) {\n sClient = new OkHttpClient.Builder()\n .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)\n .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS)\n .writeTimeout(WRITE_TIMEOUT, TimeUnit....
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_50
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private MainView mView;", "type": "MainView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private MainPresenter mPresenter;"...
{ "body": "@Test\n public void testNoSavedTags() throws Exception {\n RepositoryProvider.setLocalRepository(new TagsRepository());\n\n mPresenter.init();\n Mockito.verify(mView).addTab(\"All\");\n Mockito.verify(mView).addTab(\"My\");\n Mockito.verify(mView).showTags(anyListOf(St...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository().getCurrentUser()\n .subscribe(this::handleUser, new StubAction<>());\n\n RxLoader.create(mContext, mLm, R.id.user_info_loader_id,\n RepositoryProvider.provideRemoteRepository().getCurrentUser())\n...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_11
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testCheckAuthorizedFalse() throws Exception {\n mPreferences.edit().clear().apply();\n\n mPresenter.checkIfAuthorized();\n verify(mView, times(0)).openRepositoriesScreen();\n }", "class_method_signature": "LogInPresenterTest.testCheckAuthorizedFalse()", "c...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void checkIfAuthorized() {\n String token = Settings.getToken(mContext);\n if (!TextUtils.isEmpty(token)) {\n mView.openRepositoriesScreen();\n }\n }", "class_method_signature": "LogInPresenter.checkIfAuthorized()", "constructor": false, "full_signature": "pu...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_46
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n mPresenter.init(null);\n\n Mockito.verify(mErrorView).showUnexpectedError();\n }", "class_method_signature": "QuestionPresenterTest.testErrorShown()", "c...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mContext", ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n\n int questionId = mQues...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_131
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDifferentLengths() throws Exception {\n String first = \"9pda\";\n String second = \"0ca\";\n boolean equals = TextUtils.equals(first, second);\n assertFalse(equals);\n }", "class_method_signature": "TextUtilsTest.testDifferentLengths()", "const...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_85
{ "fields": [ { "declarator": "mOwner", "modifier": "private", "original_string": "private User mOwner;", "type": "User", "var_name": "mOwner" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/content/AnswerTest.java", "identifier...
{ "body": "@Test\n public void testIsAccepted() throws Exception {\n Answer answer = new Answer();\n answer.setAccepted(true);\n assertTrue(answer.isAccepted());\n }", "class_method_signature": "AnswerTest.testIsAccepted()", "constructor": false, "full_signature": "@Test public void t...
{ "fields": [ { "declarator": "mOwner", "modifier": "@SerializedName(\"owner\")\n private", "original_string": "@SerializedName(\"owner\")\n private User mOwner;", "type": "User", "var_name": "mOwner" }, { "declarator": "mBody", "modifier": "@SerializedName(...
{ "body": "public boolean isAccepted() {\n return mIsAccepted;\n }", "class_method_signature": "Answer.isAccepted()", "constructor": false, "full_signature": "public boolean isAccepted()", "identifier": "isAccepted", "invocations": [], "modifiers": "public", "parameters": "()", "return": "bo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_93
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/UserTagResponseTest.java", "identifier": "UserTagResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetUserTags() throws Exception {\n UserTagResponse userTagResponse = new UserTagResponse();\n List<UserTag> userTags = new ArrayList<>();\n userTags.add(new UserTag());\n userTagResponse.setUserTags(userTags);\n assertTrue(userTags == userTagRes...
{ "fields": [ { "declarator": "mUserTags", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<UserTag> mUserTags;", "type": "List<UserTag>", "var_name": "mUserTags" } ], "file": "StackExchangeClient/app/src/...
{ "body": "public void setUserTags(@NonNull List<UserTag> userTags) {\n mUserTags = userTags;\n }", "class_method_signature": "UserTagResponse.setUserTags(@NonNull List<UserTag> userTags)", "constructor": false, "full_signature": "public void setUserTags(@NonNull List<UserTag> userTags)", "identifie...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_127
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSameStringEquals() throws Exception {\n String s = \"aaa\";\n boolean equals = TextUtils.equals(s, s);\n assertTrue(equals);\n }", "class_method_signature": "TextUtilsTest.testSameStringEquals()", "constructor": false, "full_signature": "@Test public...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_20
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/rx/RxResultTest.java", "identifier": "RxResultTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOnError() throws Exception {\n Throwable error = new Exception();\n RxResult<Integer> result = RxResult.onError(error);\n assertNull(result.getResult());\n assertTrue(error == result.getError());\n assertFalse(result.isOnComplete());\n }", ...
{ "fields": [ { "declarator": "mResult", "modifier": "private final", "original_string": "private final T mResult;", "type": "T", "var_name": "mResult" }, { "declarator": "mError", "modifier": "private final", "original_string": "private final Throwable mErr...
{ "body": "@NonNull\n public static <T> RxResult<T> onError(@Nullable Throwable error) {\n return new RxResult<>(null, error, false);\n }", "class_method_signature": "RxResult.onError(@Nullable Throwable error)", "constructor": false, "full_signature": "@NonNull public static RxResult<T> onError(@N...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_77
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testFullUserInfoShown() throws Exception {\n mPresenter.init(null);\n\n verifyUserInfoShown();\n }", "class_method_signature": "ProfilePresenterTest.testFullUserInfoShown()", "constructor": false, "full_signature": "@Test public void testFullUserInfoShown()", ...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_4
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testButtonClickNext() throws Exception {\n mPresenter.onButtonClick();\n verify(mView).showBenefit(1, false);\n }", "class_method_signature": "WalkthroughPresenterTest.testButtonClickNext()", "constructor": false, "full_signature": "@Test public void testButton...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "public void onButtonClick() {\n if (isLastBenefit()) {\n Settings.saveWalkthroughPassed(mContext);\n mView.finishWalkthrough();\n } else {\n mCurrentItem++;\n mView.showBenefit(mCurrentItem, isLastBenefit());\n }\n }", "class_method_sign...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_98
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/NotificationResponseTest.java", "identifier": "NotificationResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetNotifications() throws Exception {\n NotificationResponse notificationResponse = new NotificationResponse();\n List<Notification> notifications = new ArrayList<>();\n notifications.add(new Notification());\n notificationResponse.setNotifications(not...
{ "fields": [ { "declarator": "mNotifications", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Notification> mNotifications;", "type": "List<Notification>", "var_name": "mNotifications" } ], "file": "Sta...
{ "body": "public void setNotifications(@NonNull List<Notification> notifications) {\n mNotifications = notifications;\n }", "class_method_signature": "NotificationResponse.setNotifications(@NonNull List<Notification> notifications)", "constructor": false, "full_signature": "public void setNotificatio...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_61
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void testFoundTagsRestored() throws Exception {\n ArrayList tags = new ArrayList();\n tags.add(new Tag(\"android-actionbar\", false));\n tags.add(new Tag(\"java\", false));\n Bundle savedInstanceState = Mockito.mock(Bundle....
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n mView.setEmptyText(R.string.no_tags_found);\n\n if (savedInstanceState != null) {\n List<Tag> tags = savedInstanceState.getParcelableArrayList(FOUND_TAGS_KEY);\n tags = tags == null ? new ArrayList<>() : tags;\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_36
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/content/GsonHolderTest.java", "identifier": "GsonHolderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHolderInitialized() throws Exception {\n Gson gson = GsonHolder.getGson();\n assertNotNull(gson);\n }", "class_method_signature": "GsonHolderTest.testHolderInitialized()", "constructor": false, "full_signature": "@Test public void testHolderInitialized()", ...
{ "fields": [], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/content/GsonHolder.java", "identifier": "GsonHolder", "interfaces": "", "methods": [ { "class_method_signature": "GsonHolder.GsonHolder()", "constructor": true, "full_signature": "private GsonHolder()", ...
{ "body": "@NonNull\n public static Gson getGson() {\n return Holder.GSON;\n }", "class_method_signature": "GsonHolder.getGson()", "constructor": false, "full_signature": "@NonNull public static Gson getGson()", "identifier": "getGson", "invocations": [], "modifiers": "@NonNull public static"...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_116
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/api/RepositoryProviderTest.java", "identifier": "RepositoryProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRemoteNotInited() throws Exception {\n assertNull(RepositoryProvider.provideRemoteRepository());\n }", "class_method_signature": "RepositoryProviderTest.testRemoteNotInited()", "constructor": false, "full_signature": "@Test public void testRemoteNotInited()", "i...
{ "fields": [ { "declarator": "sRemoteRepository", "modifier": "private static", "original_string": "private static RemoteRepository sRemoteRepository;", "type": "RemoteRepository", "var_name": "sRemoteRepository" }, { "declarator": "sLocalRepository", "modifier":...
{ "body": "@NonNull\n public static RemoteRepository provideRemoteRepository() {\n return sRemoteRepository;\n }", "class_method_signature": "RepositoryProvider.provideRemoteRepository()", "constructor": false, "full_signature": "@NonNull public static RemoteRepository provideRemoteRepository()", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_100
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/BadgeResponseTest.java", "identifier": "BadgeResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetBadges() throws Exception {\n BadgeResponse badgeResponse = new BadgeResponse();\n List<Badge> badges = new ArrayList<>();\n badges.add(new Badge());\n badgeResponse.setBadges(badges);\n assertTrue(badges == badgeResponse.getBadges());\n }...
{ "fields": [ { "declarator": "mBadges", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Badge> mBadges;", "type": "List<Badge>", "var_name": "mBadges" } ], "file": "StackExchangeClient/app/src/main/java/...
{ "body": "public void setBadges(@NonNull List<Badge> badges) {\n mBadges = badges;\n }", "class_method_signature": "BadgeResponse.setBadges(@NonNull List<Badge> badges)", "constructor": false, "full_signature": "public void setBadges(@NonNull List<Badge> badges)", "identifier": "setBadges", "invo...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_120
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/api/ErrorsHandlerTest.java", "identifier": "ErrorsHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testErrorHandled() throws Exception {\n ApiError error = new ApiError();\n error.setErrorCode(404);\n error.setErrorMessage(\"Test error\");\n\n Observable.just(error)\n .compose(ErrorsHandler.handleErrors())\n .subscribe(apiE...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/api/ErrorsHandler.java", "identifier": "ErrorsHandler", "interfaces": "", "methods": [ { "class_method_signature": "ErrorsHandler.ErrorsHandler()", "constructor": true, "full_signature": "p...
{ "body": "@NonNull\n public static <T extends ApiError> Observable.Transformer<T, T> handleErrors() {\n return observable -> observable\n .flatMap(t -> {\n if (t.isError()) {\n return Observable.error(new ServerError(t));\n }\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_94
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/QuestionResponseTest.java", "identifier": "QuestionResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testQuestionsNotNull() throws Exception {\n QuestionResponse questionResponse = new QuestionResponse();\n assertNotNull(questionResponse.getQuestions());\n }", "class_method_signature": "QuestionResponseTest.testQuestionsNotNull()", "constructor": false, "full_...
{ "fields": [ { "declarator": "mQuestions", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Question> mQuestions;", "type": "List<Question>", "var_name": "mQuestions" } ], "file": "StackExchangeClient/app...
{ "body": "@NonNull\n public List<Question> getQuestions() {\n if (mQuestions == null) {\n mQuestions = new ArrayList<>();\n }\n return mQuestions;\n }", "class_method_signature": "QuestionResponse.getQuestions()", "constructor": false, "full_signature": "@NonNull public Li...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_8
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private RepositoriesView mView;", "type": "RepositoriesView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Repositori...
{ "body": "@Test\n public void testSuccessResponse() throws Exception {\n ApiFactory.setProvider(new TestProviderImpl(new SuccessGithubService(generateRepositories(12))));\n\n mPresenter.dispatchCreated();\n\n verify(mView).showLoading();\n verify(mView).hideLoading();\n verify(m...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void dispatchCreated() {\n RxLoader.create(mContext, mLm, R.id.local_repositories_loader,\n mRepository.cachedRepositories()\n .subscribeOn(Schedulers.io())\n .doOnTerminate(this::refresh)\n .observeOn(Android...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_82
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorShownOnlyOnce() throws Exception {\n Bundle savedInstanceState = Mockito.mock(Bundle.class);\n Mockito.when(savedInstanceState.getBoolean(ERROR_SHOWN_KEY)).thenReturn(true);\n\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n mPre...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_136
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStringBuilderEqualsStrings() throws Exception {\n StringBuilder first = new StringBuilder(\"Ab0ocam\");\n StringBuilder second = new StringBuilder(\"Ab0ocam\");\n boolean equals = TextUtils.equals(first, second);\n assertTrue(equals);\n }", "class...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_41
{ "fields": [ { "declarator": "mValues", "modifier": "private", "original_string": "private List<Integer> mValues;", "type": "List<Integer>", "var_name": "mValues" } ], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/widget/BaseAdapterTest.java", "identifier...
{ "body": "@Test\n public void testSetNewValues() throws Exception {\n BaseAdapter<TestHolder, Integer> adapter = spy(new TestAdapter(mValues));\n doNothing().when(adapter).refreshRecycler();\n\n List<Integer> values = new ArrayList<Integer>() {{\n add(10);\n add(17);\n ...
{ "fields": [ { "declarator": "mItems = new ArrayList<>()", "modifier": "private final", "original_string": "private final List<T> mItems = new ArrayList<>();", "type": "List<T>", "var_name": "mItems" }, { "declarator": "mOnItemClickListener", "modifier": "@Nullab...
{ "body": "public final void setNewValues(@NonNull List<T> values) {\n mItems.clear();\n mItems.addAll(values);\n refreshRecycler();\n }", "class_method_signature": "BaseAdapter.setNewValues(@NonNull List<T> values)", "constructor": false, "full_signature": "public final void setNewValue...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_16
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testSuccessAuthLoginSaved() throws Exception {\n mPreferences.edit().clear().apply();\n ApiFactory.setProvider(new TestProviderImpl(new GithubServiceSuccess()));\n\n final String login = \"login\";\n mPresenter.tryLogIn(login, \"password\");\n verif...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void tryLogIn(@NonNull String login, @NonNull String password) {\n if (TextUtils.isEmpty(login)) {\n mView.showLoginError();\n } else if (TextUtils.isEmpty(password)) {\n mView.showPasswordError();\n } else {\n String authorizationString = Author...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_57
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;", "type": "WalkthroughView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private WalkthroughP...
{ "body": "@Test\n public void testErrorRestored() throws Exception {\n Bundle savedInstanceState = Mockito.mock(Bundle.class);\n Mockito.when(savedInstanceState.getInt(\"current_item\")).thenReturn(2);\n Mockito.when(savedInstanceState.getBoolean(\"walkthrough_passed\")).thenReturn(true);\n ...
{ "fields": [ { "declarator": "PAGE_COUNT = 3", "modifier": "public static final", "original_string": "public static final int PAGE_COUNT = 3;", "type": "int", "var_name": "PAGE_COUNT" }, { "declarator": "CURRENT_ITEM_KEY = \"current_item\"", "modifier": "private ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState == null) {\n mCurrentItem = 0;\n showCurrentBenefit();\n } else {\n mCurrentItem = savedInstanceState.getInt(CURRENT_ITEM_KEY);\n mIsWalkthroughPassed = savedInstanceSt...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_56
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;", "type": "WalkthroughView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private WalkthroughP...
{ "body": "@Test\n public void testWalkthroughRestored() throws Exception {\n Bundle savedInstanceState = Mockito.mock(Bundle.class);\n Mockito.when(savedInstanceState.getInt(\"current_item\")).thenReturn(2);\n Mockito.when(savedInstanceState.getBoolean(anyString())).thenReturn(false);\n\n ...
{ "fields": [ { "declarator": "PAGE_COUNT = 3", "modifier": "public static final", "original_string": "public static final int PAGE_COUNT = 3;", "type": "int", "var_name": "PAGE_COUNT" }, { "declarator": "CURRENT_ITEM_KEY = \"current_item\"", "modifier": "private ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState == null) {\n mCurrentItem = 0;\n showCurrentBenefit();\n } else {\n mCurrentItem = savedInstanceState.getInt(CURRENT_ITEM_KEY);\n mIsWalkthroughPassed = savedInstanceSt...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_17
{ "fields": [ { "declarator": "mObserver", "modifier": "private", "original_string": "private Observer<Integer> mObserver;", "type": "Observer<Integer>", "var_name": "mObserver" }, { "declarator": "mRxLc", "modifier": "private", "original_string": "private R...
{ "body": "@Test\n public void testOnCreateLoader() throws Exception {\n Loader<RxResult<Integer>> loader = mRxLc.onCreateLoader(0, mock(Bundle.class));\n assertNotNull(loader);\n }", "class_method_signature": "RxLcImplTest.testOnCreateLoader()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mObservable", "modifier": "private final", "original_string": "private ...
{ "body": "@Override\n public Loader<RxResult<T>> onCreateLoader(int id, Bundle args) {\n return new RxResultLoader<>(mContext, mObservable);\n }", "class_method_signature": "RxLcImpl.onCreateLoader(int id, Bundle args)", "constructor": false, "full_signature": "@Override public Loader<RxResult<T>>...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_40
{ "fields": [ { "declarator": "mValues", "modifier": "private", "original_string": "private List<Integer> mValues;", "type": "List<Integer>", "var_name": "mValues" } ], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/widget/BaseAdapterTest.java", "identifier...
{ "body": "@Test\n public void testGet() throws Exception {\n BaseAdapter<TestHolder, Integer> adapter = new TestAdapter(mValues);\n assertEquals(15, adapter.getItem(2).intValue());\n }", "class_method_signature": "BaseAdapterTest.testGet()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [ { "declarator": "mItems = new ArrayList<>()", "modifier": "private final", "original_string": "private final List<T> mItems = new ArrayList<>();", "type": "List<T>", "var_name": "mItems" }, { "declarator": "mOnItemClickListener", "modifier": "@Nullab...
{ "body": "@NonNull\n public T getItem(int position) {\n return mItems.get(position);\n }", "class_method_signature": "BaseAdapter.getItem(int position)", "constructor": false, "full_signature": "@NonNull public T getItem(int position)", "identifier": "getItem", "invocations": [ "get" ], ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_137
{ "fields": [ { "declarator": "TEST_VIEW_ID = R.id.toolbar", "modifier": "private static final", "original_string": "private static final int TEST_VIEW_ID = R.id.toolbar;", "type": "int", "var_name": "TEST_VIEW_ID" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturv...
{ "body": "@Test\n public void testFindByIdInActivity() throws Exception {\n Activity activity = mock(Activity.class);\n View view = mock(View.class);\n when(activity.findViewById(TEST_VIEW_ID)).thenReturn(view);\n\n assertTrue(view == Views.findById(activity, TEST_VIEW_ID));\n v...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/Views.java", "identifier": "Views", "interfaces": "", "methods": [ { "class_method_signature": "Views.Views()", "constructor": true, "full_signature": "private Views()", "ident...
{ "body": "@NonNull\n public static <T extends View> T findById(@NonNull Activity activity, @IdRes int viewId) {\n //noinspection unchecked\n return (T) activity.findViewById(viewId);\n }", "class_method_signature": "Views.findById(@NonNull Activity activity, @IdRes int viewId)", "constructor"...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_83
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorAvailableInformationShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n\n mPresenter.init(null);\n verifyUserInfoShown();\n }", "class_method_signature": "ProfilePresenterTest.testErrorAvailableInformationSh...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }