id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
163387337_172
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/ColumnUtilsTest.java", "identifier": "ColumnUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_delEscape_byEscape() throws Exception {\n List<String> cols = new ArrayList<>();\n cols.add(\"`id`\");\n cols.add(\"name\");\n cols = ColumnUtils.delEscape(cols, ColumnUtils.Escape.MYSQL);\n Assertions.assertEquals(\"id\", cols.get(0));\n ...
{ "fields": [ { "declarator": "DOT = \".\"", "modifier": "private static final", "original_string": "private static final String DOT = \".\";", "type": "String", "var_name": "DOT" } ], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/ColumnUtils.java", "identifie...
{ "body": "public static List<String> delEscape(List<String> cols, String dbType) {\n // sql standard\n // https://db.apache.org/derby/docs/10.1/ref/crefsqlj1003454.html\n // https://docs.oracle.com/javadb/10.8.3.0/ref/crefsqlj1003454.html\n // https://www.informit.com/articles/article.asp...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_24
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalRollbackResponseConvertorTest.java", "identifier": "GlobalRollbackResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n GlobalRollbackResponse globalRollbackResponse = new GlobalRollbackResponse();\n globalRollbackResponse.setGlobalStatus(GlobalStatus.AsyncCommitting);\n globalRollbackResponse.setMsg(\"msg\");\n globalRollbackResponse.setResultCode(Res...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalRollbackResponseConvertor.java", "identifier": "GlobalRollbackResponseConvertor", "interfaces": "implements PbConvertor<GlobalRollbackResponse, GlobalRollbackResponseProto>", "methods": [ ...
{ "body": "@Override\n public GlobalRollbackResponseProto convert2Proto(GlobalRollbackResponse globalRollbackResponse) {\n final short typeCode = globalRollbackResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n Messa...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_164
{ "fields": [ { "declarator": "parameterParser = null", "modifier": "private static", "original_string": "private static ParameterParser parameterParser = null;", "type": "ParameterParser", "var_name": "parameterParser" } ], "file": "server/src/test/java/io/seata/server/Param...
{ "body": "@Test\n public void testGetStoreMode() {\n Assertions.assertEquals(\"file\", parameterParser.getStoreMode());\n }", "class_method_signature": "ParameterParserTest.testGetStoreMode()", "constructor": false, "full_signature": "@Test public void testGetStoreMode()", "identifier": "testGet...
{ "fields": [ { "declarator": "PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)\"", "modifier": "private static final", "original_string": "private static final String PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata...
{ "body": "public String getStoreMode() {\n return storeMode;\n }", "class_method_signature": "ParameterParser.getStoreMode()", "constructor": false, "full_signature": "public String getStoreMode()", "identifier": "getStoreMode", "invocations": [], "modifiers": "public", "parameters": "()", ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_73
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testGetFieldValue() throws\n NoSuchFieldException, IllegalAccessException {\n Assertions.assertEquals(\"d\",\n ReflectionUtil.getFieldValue(new DurationUtil(), \"DAY_UNIT\"));\n\n Assertions.assertThrows(NoSuchFieldException.class,\n ...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static Object getFieldValue(Object target, String fieldName)\n throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {\n Class<?> cl = target.getClass();\n int i = 0;\n while ((i++) < MAX_NEST_DEPTH && cl != null) {\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_133
{ "fields": [], "file": "common/src/test/java/io/seata/common/XIDTest.java", "identifier": "XIDTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetTransactionId() {\n assertThat(XID.getTransactionId(null)).isEqualTo(-1);\n assertThat(XID.getTransactionId(\"127.0.0.1:8080:8577662204289747564\")).isEqualTo(8577662204289747564L);\n }", "class_method_signature": "XIDTest.testGetTransactionId()", "constru...
{ "fields": [ { "declarator": "port", "modifier": "private static", "original_string": "private static int port;", "type": "int", "var_name": "port" }, { "declarator": "ipAddress", "modifier": "private static", "original_string": "private static String ipAdd...
{ "body": "public static long getTransactionId(String xid) {\n if (xid == null) {\n return -1;\n }\n\n int idx = xid.lastIndexOf(\":\");\n return Long.parseLong(xid.substring(idx + 1));\n }", "class_method_signature": "XID.getTransactionId(String xid)", "constructor": fal...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_211
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/oracle/OracleUndoUpdateExecutorTest.java", "identifier": "OracleUndoUpdateExecutorTest", "interfaces": "", "superclass": "extends BaseExecutorTest" }
{ "body": "@Test\n public void getUndoRows() {\n OracleUndoUpdateExecutor executor = upperCaseSQL();\n Assertions.assertEquals(executor.getUndoRows(), executor.getSqlUndoLog().getBeforeImage());\n }", "class_method_signature": "OracleUndoUpdateExecutorTest.getUndoRows()", "constructor": false,...
{ "fields": [ { "declarator": "UPDATE_SQL_TEMPLATE = \"UPDATE %s SET %s WHERE %s \"", "modifier": "private static final", "original_string": "private static final String UPDATE_SQL_TEMPLATE = \"UPDATE %s SET %s WHERE %s \";", "type": "String", "var_name": "UPDATE_SQL_TEMPLATE" } ...
{ "body": "@Override\n protected TableRecords getUndoRows() {\n return sqlUndoLog.getBeforeImage();\n }", "class_method_signature": "OracleUndoUpdateExecutor.getUndoRows()", "constructor": false, "full_signature": "@Override protected TableRecords getUndoRows()", "identifier": "getUndoRows", "i...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_78
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testGetInterfaces() {\n Assertions.assertArrayEquals(new Object[]{Serializable.class},\n ReflectionUtil.getInterfaces(Serializable.class).toArray());\n\n Assertions.assertArrayEquals(new Object[]{\n Serializable.class, Comparable.cl...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static Set<Class<?>> getInterfaces(Class<?> clazz) {\n if (clazz.isInterface()) {\n return Collections.singleton(clazz);\n }\n Set<Class<?>> interfaces = new LinkedHashSet<>();\n while (clazz != null) {\n Class<?>[] ifcs = clazz.getInterfaces();\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_97
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/CompressUtilTest.java", "identifier": "CompressUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsCompressData() {\n Assertions.assertFalse(CompressUtil.isCompressData(null));\n Assertions.assertFalse(CompressUtil.isCompressData(new byte[0]));\n Assertions.assertFalse(CompressUtil.isCompressData(new byte[]{31, 11}));\n Assertions.assertFalse(\n ...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/CompressUtil.java", "identifier": "CompressUtil", "interfaces": "", "methods": [ { "class_method_signature": "CompressUtil.compress(final byte[] src)", "constructor": false, "full_signature": "public static byte[] compres...
{ "body": "public static boolean isCompressData(byte[] bytes) {\n if (bytes != null && bytes.length > 2) {\n int header = ((bytes[0] & 0xff)) | (bytes[1] & 0xff) << 8;\n return GZIPInputStream.GZIP_MAGIC == header;\n }\n return false;\n }", "class_method_signature": "Co...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_138
{ "fields": [ { "declarator": "rpcContext", "modifier": "private static", "original_string": "private static RpcContext rpcContext;", "type": "RpcContext", "var_name": "rpcContext" }, { "declarator": "VERSION = \"a\"", "modifier": "private static final", "or...
{ "body": "@Test\n\tpublic void testToString() {\n\t\trpcContext.setApplicationId(null);\n\t\trpcContext.setTransactionServiceGroup(null);\n\t\trpcContext.setClientId(null);\n\t\trpcContext.setChannel(null);\n\t\trpcContext.setResourceSets(null);\n\t\tAssertions.assertEquals(\n\t\t\t\t\"RpcContext{\" + \"applicationI...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RpcContext.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RpcContext.class);", "type": "Logger", "var_name": "LOGGER" }, { "dec...
{ "body": "@Override\n public String toString() {\n return \"RpcContext{\" +\n \"applicationId='\" + applicationId + '\\'' +\n \", transactionServiceGroup='\" + transactionServiceGroup + '\\'' +\n \", clientId='\" + clientId + '\\'' +\n \", channel=\" + channel +\...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_180
{ "fields": [ { "declarator": "deleteExecutor", "modifier": "private static", "original_string": "private static DeleteExecutor deleteExecutor;", "type": "DeleteExecutor", "var_name": "deleteExecutor" }, { "declarator": "statementProxy", "modifier": "private stati...
{ "body": "@Test\n public void testBeforeImage() throws SQLException {\n Assertions.assertNotNull(deleteExecutor.beforeImage());\n\n String sql = \"delete from t\";\n List<SQLStatement> asts = SQLUtils.parseStatements(sql, JdbcConstants.MYSQL);\n MySQLDeleteRecognizer recognizer = new M...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/exec/DeleteExecutor.java", "identifier": "DeleteExecutor", "interfaces": "", "methods": [ { "class_method_signature": "DeleteExecutor.DeleteExecutor(StatementProxy<S> statementProxy, StatementCallback<T,S> statementCallback,...
{ "body": "@Override\n protected TableRecords beforeImage() throws SQLException {\n SQLDeleteRecognizer visitor = (SQLDeleteRecognizer) sqlRecognizer;\n TableMeta tmeta = getTableMeta(visitor.getTableName());\n ArrayList<List<Object>> paramAppenderList = new ArrayList<>();\n String sele...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_196
{ "fields": [ { "declarator": "columnMetas =\n new Object[][] {\n new Object[] {\"\", \"\", \"table_records_test\", \"id\", Types.INTEGER, \"INTEGER\", 64, 0, 10, 1, \"\", \"\", 0, 0, 64, 1, \"NO\", \"YES\"},\n new Object[] {\"\", \"\", \"table_records_test\", \"name\", Types.VA...
{ "body": "@Test\n public void testTableRecords() {\n\n Assertions.assertThrows(ShouldNeverHappenException.class, () -> {\n TableRecords tableRecords = new TableRecords(new TableMeta());\n tableRecords.setTableMeta(new TableMeta());\n });\n\n TableRecords tableRecords = n...
{ "fields": [ { "declarator": "tableMeta", "modifier": "private transient", "original_string": "private transient TableMeta tableMeta;", "type": "TableMeta", "var_name": "tableMeta" }, { "declarator": "tableName", "modifier": "private", "original_string": "p...
{ "body": "public TableRecords() {\n\n }", "class_method_signature": "TableRecords.TableRecords()", "constructor": true, "full_signature": "public TableRecords()", "identifier": "TableRecords", "invocations": [], "modifiers": "public", "parameters": "()", "return": "", "signature": " TableRecord...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_39
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/BranchReportResponseConvertorTest.java", "identifier": "BranchReportResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n BranchReportResponse branchReportResponse = new BranchReportResponse();\n branchReportResponse.setMsg(\"msg\");\n branchReportResponse.setResultCode(ResultCode.Failed);\n branchReportResponse.setTransactionExceptionCode(TransactionExc...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/BranchReportResponseConvertor.java", "identifier": "BranchReportResponseConvertor", "interfaces": "implements PbConvertor<BranchReportResponse, BranchReportResponseProto>", "methods": [ { ...
{ "body": "@Override\n public BranchReportResponseProto convert2Proto(BranchReportResponse branchReportResponse) {\n final short typeCode = branchReportResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypePr...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_179
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/DataSourceProxyTest.java", "identifier": "DataSourceProxyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getResourceIdTest() throws SQLException, NoSuchFieldException, IllegalAccessException {\n MockDriver mockDriver = new MockDriver();\n String username = \"username\";\n\n DruidDataSource dataSource = new DruidDataSource();\n dataSource.setUrl(\"jdbc:mock:xx...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DataSourceProxy.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceProxy.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "@Override\n public String getResourceId() {\n if (JdbcConstants.POSTGRESQL.equals(dbType)) {\n return getPGResourceId();\n } else if (JdbcConstants.ORACLE.equals(dbType) && userName != null) {\n return getDefaultResourceId() + \"/\" + userName;\n } else {\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_207
{ "fields": [ { "declarator": "parser = (JacksonUndoLogParser) EnhancedServiceLoader.load(UndoLogParser.class, JacksonUndoLogParser.NAME)", "modifier": "", "original_string": "JacksonUndoLogParser parser = (JacksonUndoLogParser) EnhancedServiceLoader.load(UndoLogParser.class, JacksonUndoLogParse...
{ "body": "@Test\n public void encode() throws NoSuchFieldException, IllegalAccessException, IOException, SQLException {\n //get the jackson mapper\n java.lang.reflect.Field reflectField = parser.getClass().getDeclaredField(\"mapper\");\n reflectField.setAccessible(true);\n ObjectMapper...
{ "fields": [ { "declarator": "NAME = \"jackson\"", "modifier": "public static final", "original_string": "public static final String NAME = \"jackson\";", "type": "String", "var_name": "NAME" }, { "declarator": "LOGGER = LoggerFactory.getLogger(JacksonUndoLogParser.cla...
{ "body": "@Override\n public byte[] encode(BranchUndoLog branchUndoLog) {\n try {\n return mapper.writeValueAsBytes(branchUndoLog);\n } catch (JsonProcessingException e) {\n LOGGER.error(\"json encode exception, {}\", e.getMessage(), e);\n throw new RuntimeException(...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_81
{ "fields": [ { "declarator": "ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902)", "modifier": "private", "original_string": "private InetSocketAddress ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902);", "type": "InetSocketAddress", ...
{ "body": "@Test\n public void testToStringAddress1() {\n assertThat(NetUtil.toStringAddress((SocketAddress)ipv4))\n .isEqualTo(ipv4.getAddress().getHostAddress() + \":\" + ipv4.getPort());\n assertThat(NetUtil.toStringAddress((SocketAddress)ipv6)).isEqualTo(\n ipv6.getAddress()...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(NetUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NetUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarato...
{ "body": "public static String toStringAddress(SocketAddress address) {\n if (address == null) {\n return StringUtils.EMPTY;\n }\n return toStringAddress((InetSocketAddress) address);\n }", "class_method_signature": "NetUtil.toStringAddress(SocketAddress address)", "constructor...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_155
{ "fields": [ { "declarator": "DEFAULT_XID = \"default_xid\"", "modifier": "private final", "original_string": "private final String DEFAULT_XID = \"default_xid\";", "type": "String", "var_name": "DEFAULT_XID" }, { "declarator": "DEFAULT_BRANCH_TYPE = BranchType.AT", ...
{ "body": "@Test\n public void testInGlobalTransaction() {\n assertThat(RootContext.inGlobalTransaction()).isFalse();\n RootContext.bind(DEFAULT_XID);\n assertThat(RootContext.inGlobalTransaction()).isTrue();\n RootContext.unbind();\n assertThat(RootContext.inGlobalTransaction())...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RootContext.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RootContext.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "public static boolean inGlobalTransaction() {\n return CONTEXT_HOLDER.get(KEY_XID) != null;\n }", "class_method_signature": "RootContext.inGlobalTransaction()", "constructor": false, "full_signature": "public static boolean inGlobalTransaction()", "identifier": "inGlobalTransaction", "i...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_15
{ "fields": [], "file": "compressor/seata-compressor-zip/src/test/java/io/seata/compressor/zip/ZipUtilTest.java", "identifier": "ZipUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_compress() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n ZipUtil.compress(null);\n });\n }", "class_method_signature": "ZipUtilTest.test_compress()", "constructor": false, "full_signature": "@Test public void test_compress()"...
{ "fields": [ { "declarator": "BUFFER_SIZE = 8192", "modifier": "private static final", "original_string": "private static final int BUFFER_SIZE = 8192;", "type": "int", "var_name": "BUFFER_SIZE" } ], "file": "compressor/seata-compressor-zip/src/main/java/io/seata/compressor/...
{ "body": "public static byte[] compress(byte[] bytes) {\n if (bytes == null) {\n throw new NullPointerException(\"bytes is null\");\n }\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n try (ZipOutputStream zip = new ZipOutputStream(out)) {\n ZipEntry entr...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_102
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/NumberUtilsTest.java", "identifier": "NumberUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToInReturnDefaultValueWithFormatIsInvalid() {\n Assertions.assertEquals(10, NumberUtils.toInt(\"nine\", 10));\n }", "class_method_signature": "NumberUtilsTest.testToInReturnDefaultValueWithFormatIsInvalid()", "constructor": false, "full_signature": "@Test public v...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/NumberUtils.java", "identifier": "NumberUtils", "interfaces": "", "methods": [ { "class_method_signature": "NumberUtils.toInt(final String str, final int defaultValue)", "constructor": false, "full_signature": "public sta...
{ "body": "public static int toInt(final String str, final int defaultValue) {\n if (str == null) {\n return defaultValue;\n }\n try {\n return Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return defaultValue;\n }\n }", "clas...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_42
{ "fields": [ { "declarator": "DEFAULT_XID = \"1234567890\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_XID = \"1234567890\";", "type": "String", "var_name": "DEFAULT_XID" } ], "file": "tm/src/test/java/io/seata/tm/api/Default...
{ "body": "@Test\n public void commitRetryExceptionTest() throws TransactionException {\n RootContext.unbind();\n GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();\n tx.begin();\n Assertions.assertThrows(TransactionException.class, tx::commit);\n }", "class_meth...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultGlobalTransaction.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultGlobalTransaction.class);", "type": "Logger", "var_name": "LOG...
{ "body": "@Override\n public void begin() throws TransactionException {\n begin(DEFAULT_GLOBAL_TX_TIMEOUT);\n }", "class_method_signature": "DefaultGlobalTransaction.begin()", "constructor": false, "full_signature": "@Override public void begin()", "identifier": "begin", "invocations": [ "...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_114
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadException() {\n Assertions.assertThrows(EnhancedServiceNotFoundException.class, () -> {\n EnhancedServiceLoaderTest load = EnhancedServiceLoader.load(EnhancedServiceLoaderTest.class);\n });\n }", "class_method_signature": "EnhancedServiceLoaderTe...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "public static <S> S load(Class<S> service, ClassLoader loader) throws EnhancedServiceNotFoundException {\n return InnerEnhancedServiceLoader.getServiceLoader(service).load(loader);\n }", "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_54
{ "fields": [], "file": "tm/src/test/java/io/seata/tm/api/transaction/RollbackRuleTest.java", "identifier": "RollbackRuleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void ancestry() {\n RollbackRule rr = new RollbackRule(java.lang.Exception.class.getName());\n // Exception -> Runtime -> MyRuntimeException\n assertThat(rr.getDepth(new MyRuntimeException(\"\"))).isEqualTo(2);\n }", "class_method_signature": "RollbackRuleTest.an...
{ "fields": [ { "declarator": "exceptionName", "modifier": "private final", "original_string": "private final String exceptionName;", "type": "String", "var_name": "exceptionName" } ], "file": "tm/src/main/java/io/seata/tm/api/transaction/RollbackRule.java", "identifier": "...
{ "body": "public int getDepth(Throwable ex) {\n return getDepth(ex.getClass(), 0);\n }", "class_method_signature": "RollbackRule.getDepth(Throwable ex)", "constructor": false, "full_signature": "public int getDepth(Throwable ex)", "identifier": "getDepth", "invocations": [ "getDepth", "ge...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_143
{ "fields": [ { "declarator": "nettyPoolKey", "modifier": "private", "original_string": "private NettyPoolKey nettyPoolKey;", "type": "NettyPoolKey", "var_name": "nettyPoolKey" }, { "declarator": "RM_ROLE = NettyPoolKey.TransactionRole.RMROLE", "modifier": "privat...
{ "body": "@Test\n public void getMessage() {\n Assertions.assertEquals(nettyPoolKey.getMessage(), MSG1);\n }", "class_method_signature": "NettyPoolKeyTest.getMessage()", "constructor": false, "full_signature": "@Test public void getMessage()", "identifier": "getMessage", "invocations": [ "...
{ "fields": [ { "declarator": "transactionRole", "modifier": "private", "original_string": "private TransactionRole transactionRole;", "type": "TransactionRole", "var_name": "transactionRole" }, { "declarator": "address", "modifier": "private", "original_str...
{ "body": "public AbstractMessage getMessage() {\n return message;\n }", "class_method_signature": "NettyPoolKey.getMessage()", "constructor": false, "full_signature": "public AbstractMessage getMessage()", "identifier": "getMessage", "invocations": [], "modifiers": "public", "parameters": "()...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_74
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testInvokeMethod() throws NoSuchMethodException,\n IllegalAccessException, InvocationTargetException {\n Assertions.assertEquals(0, ReflectionUtil.invokeMethod(\"\", \"length\"));\n Assertions.assertEquals(3,\n ReflectionUtil.invokeMethod(\"foo...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static Object invokeMethod(Object target, String methodName)\n throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException,\n InvocationTargetException {\n Class<?> cl = target.getClass();\n int i = 0;\n while ((i++) < MAX_NEST...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_134
{ "fields": [ { "declarator": "actionInterceptorHandler = new ActionInterceptorHandler()", "modifier": "protected", "original_string": "protected ActionInterceptorHandler actionInterceptorHandler = new ActionInterceptorHandler();", "type": "ActionInterceptorHandler", "var_name": "ac...
{ "body": "@Test\n public void testBusinessActionContext() throws NoSuchMethodException {\n Method prepareMethod = TccAction.class.getDeclaredMethod(\"prepare\",\n BusinessActionContext.class, int.class, List.class, TccParam.class);\n List<Object> list = new ArrayList<>();\n lis...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ActionInterceptorHandler.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ActionInterceptorHandler.class);", "type": "Logger", "var_name": "LOG...
{ "body": "protected Map<String, Object> fetchActionRequestContext(Method method, Object[] arguments) {\n Map<String, Object> context = new HashMap<>(8);\n\n Annotation[][] parameterAnnotations = method.getParameterAnnotations();\n for (int i = 0; i < parameterAnnotations.length; i++) {\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_23
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalCommitResponseConvertorTest.java", "identifier": "GlobalCommitResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n GlobalCommitResponse globalCommitResponse = new GlobalCommitResponse();\n globalCommitResponse.setGlobalStatus(GlobalStatus.AsyncCommitting);\n globalCommitResponse.setMsg(\"msg\");\n globalCommitResponse.setResultCode(ResultCode.Fail...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalCommitResponseConvertor.java", "identifier": "GlobalCommitResponseConvertor", "interfaces": "implements PbConvertor<GlobalCommitResponse, GlobalCommitResponseProto>", "methods": [ { ...
{ "body": "@Override\n public GlobalCommitResponseProto convert2Proto(GlobalCommitResponse globalCommitResponse) {\n final short typeCode = globalCommitResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypePr...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_163
{ "fields": [ { "declarator": "parameterParser = null", "modifier": "private static", "original_string": "private static ParameterParser parameterParser = null;", "type": "ParameterParser", "var_name": "parameterParser" } ], "file": "server/src/test/java/io/seata/server/Param...
{ "body": "@Test\n public void testGetPort() {\n Assertions.assertEquals(8088, parameterParser.getPort());\n }", "class_method_signature": "ParameterParserTest.testGetPort()", "constructor": false, "full_signature": "@Test public void testGetPort()", "identifier": "testGetPort", "invocations": ...
{ "fields": [ { "declarator": "PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)\"", "modifier": "private static final", "original_string": "private static final String PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata...
{ "body": "public int getPort() {\n return port;\n }", "class_method_signature": "ParameterParser.getPort()", "constructor": false, "full_signature": "public int getPort()", "identifier": "getPort", "invocations": [], "modifiers": "public", "parameters": "()", "return": "int", "signature":...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_35
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/BranchCommitResponseConvertorTest.java", "identifier": "BranchCommitResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n BranchCommitResponse branchCommitResponse = new BranchCommitResponse();\n branchCommitResponse.setTransactionExceptionCode(TransactionExceptionCode.BranchTransactionNotExist);\n branchCommitResponse.setResultCode(ResultCode.Success);\n ...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/BranchCommitResponseConvertor.java", "identifier": "BranchCommitResponseConvertor", "interfaces": "implements PbConvertor<BranchCommitResponse, BranchCommitResponseProto>", "methods": [ { ...
{ "body": "@Override\n public BranchCommitResponseProto convert2Proto(BranchCommitResponse branchCommitResponse) {\n final short typeCode = branchCommitResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypePr...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_175
{ "fields": [ { "declarator": "returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\")", "modifier": "private static", "original_string": "private static List<String> returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\");", "type": "List<String>", "var_name": "returnV...
{ "body": "@Test\n public void testStatementProxy() {\n Assertions.assertNotNull(statementProxy);\n }", "class_method_signature": "StatementProxyTest.testStatementProxy()", "constructor": false, "full_signature": "@Test public void testStatementProxy()", "identifier": "testStatementProxy", "inv...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/StatementProxy.java", "identifier": "StatementProxy", "interfaces": "", "methods": [ { "class_method_signature": "StatementProxy.StatementProxy(AbstractConnectionProxy connectionWrapper, T targetStatement, String targetSQL)"...
{ "body": "public StatementProxy(AbstractConnectionProxy connectionWrapper, T targetStatement, String targetSQL)\n throws SQLException {\n super(connectionWrapper, targetStatement, targetSQL);\n }", "class_method_signature": "StatementProxy.StatementProxy(AbstractConnectionProxy connectionWrapper, ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_62
{ "fields": [ { "declarator": "DEFAULT_XID = \"1234567890\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_XID = \"1234567890\";", "type": "String", "var_name": "DEFAULT_XID" } ], "file": "integration/dubbo-alibaba/src/test/java/...
{ "body": "@Test\n public void testInvoke_And_RootContext() {\n AlibabaDubboTransactionPropagationFilter filter = new AlibabaDubboTransactionPropagationFilter();\n\n // SAGA\n RpcContext.getContext().setAttachment(RootContext.KEY_XID, DEFAULT_XID);\n RpcContext.getContext().setAttachmen...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AlibabaDubboTransactionPropagationFilter.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AlibabaDubboTransactionPropagationFilter.class);", "type": ...
{ "body": "@Override\n public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {\n if (!DubboConstants.ALIBABADUBBO) {\n return invoker.invoke(invocation);\n }\n String xid = RootContext.getXID();\n BranchType branchType = RootContext.getBranchType...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_122
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getAllInstances(){\n List<Hello> hellows1 = EnhancedServiceLoader.loadAll(Hello.class);\n List<Hello> hellows2 = EnhancedServiceLoader.loadAll(Hello.class);\n for (Hello hello : hellows1){\n if(hello.say()!=\"Olá.\"){\n assertThat(hellow...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "public static <S> List<S> loadAll(Class<S> service) {\n return InnerEnhancedServiceLoader.getServiceLoader(service).loadAll(findClassLoader());\n }", "class_method_signature": "EnhancedServiceLoader.loadAll(Class<S> service)", "constructor": false, "full_signature": "public static List<S> l...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_159
{ "fields": [ { "declarator": "pathname", "modifier": "private", "original_string": "private String pathname;", "type": "String", "var_name": "pathname" } ], "file": "server/src/test/java/io/seata/server/session/SessionHolderTest.java", "identifier": "SessionHolderTest", ...
{ "body": "@Test\n public void testInit() throws IOException {\n File rootSessionFile = new File(pathname);\n if (rootSessionFile.exists()) {\n rootSessionFile.delete();\n }\n final String mode = StoreMode.FILE.getName();\n SessionHolder.init(mode);\n try {\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(SessionHolder.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SessionHolder.class);", "type": "Logger", "var_name": "LOGGER" }, { ...
{ "body": "public static void init(String mode) throws IOException {\n if (StringUtils.isBlank(mode)) {\n mode = CONFIG.getConfig(ConfigurationKeys.STORE_MODE);\n }\n StoreMode storeMode = StoreMode.get(mode);\n if (StoreMode.DB.equals(storeMode)) {\n ROOT_SESSION_MAN...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_19
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/RegisterRMResponseConvertorTest.java", "identifier": "RegisterRMResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n RegisterRMResponse registerRMResponse = new RegisterRMResponse();\n registerRMResponse.setResultCode(ResultCode.Failed);\n registerRMResponse.setMsg(\"msg\");\n registerRMResponse.setIdentified(true);\n registerRMResponse.setVe...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/RegisterRMResponseConvertor.java", "identifier": "RegisterRMResponseConvertor", "interfaces": "implements PbConvertor<RegisterRMResponse, RegisterRMResponseProto>", "methods": [ { "clas...
{ "body": "@Override\n public RegisterRMResponseProto convert2Proto(RegisterRMResponse registerRMResponse) {\n final short typeCode = registerRMResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto.forN...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_3
{ "fields": [], "file": "discovery/seata-discovery-consul/src/test/java/io/seata/discovery/registry/consul/ConsulRegistryServiceImplTest.java", "identifier": "ConsulRegistryServiceImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLookup() throws Exception {\n RegistryService registryService = mock(ConsulRegistryServiceImpl.class);\n registryService.lookup(\"test-key\");\n verify(registryService).lookup(\"test-key\");\n }", "class_method_signature": "ConsulRegistryServiceImplTest....
{ "fields": [ { "declarator": "instance", "modifier": "private static volatile", "original_string": "private static volatile ConsulRegistryServiceImpl instance;", "type": "ConsulRegistryServiceImpl", "var_name": "instance" }, { "declarator": "client", "modifier": ...
{ "body": "@Override\n public List<InetSocketAddress> lookup(String key) throws Exception {\n final String cluster = getServiceGroup(key);\n if (cluster == null) {\n return null;\n }\n if (!listenerMap.containsKey(cluster)) {\n //1.refresh cluster\n refr...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_227
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/DataCompareUtilsTest.java", "identifier": "DataCompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRowListToMapWithSinglePk(){\n List<String> primaryKeyList = new ArrayList<>();\n primaryKeyList.add(\"id\");\n\n List<Row> rows = new ArrayList<>();\n Field field = new Field(\"id\", 1, \"1\");\n Row row = new Row();\n row.add(field);\n ...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/DataCompareUtils.java", "identifier": "DataCompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "DataCompareUtils.DataCompareUtils()", "constructor": true, "full_signature": "private DataCom...
{ "body": "public static Map<String, Map<String, Field>> rowListToMap(List<Row> rowList, List<String> primaryKeyList) {\n // {value of primaryKey, value of all columns}\n Map<String, Map<String, Field>> rowMap = new HashMap<>();\n for (Row row : rowList) {\n //ensure the order of colum...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_118
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getAllExtensionClass() {\n List<Class> allExtensionClass = EnhancedServiceLoader.getAllExtensionClass(Hello.class);\n assertThat(allExtensionClass.get(3).getSimpleName()).isEqualTo((LatinHello.class.getSimpleName()));\n assertThat(allExtensionClass.get(2).getSimp...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "@SuppressWarnings(\"rawtypes\")\n static <S> List<Class> getAllExtensionClass(Class<S> service) {\n return InnerEnhancedServiceLoader.getServiceLoader(service).getAllExtensionClass(findClassLoader());\n }", "class_method_signature": "EnhancedServiceLoader.getAllExtensionClass(Class<S> servic...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_58
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImplTest.class);", "type": "Logger", "var_n...
{ "body": "@Test\n void onBeginFailure() {\n RootContext.bind(DEFAULT_XID);\n GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();\n FailureHandler failureHandler = new DefaultFailureHandlerImpl();\n failureHandler.onBeginFailure(tx, new MyRuntimeException(\"\").getCaus...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImpl.class);", "type": "Logger", "var_name": "L...
{ "body": "@Override\n public void onBeginFailure(GlobalTransaction tx, Throwable cause) {\n LOGGER.warn(\"Failed to begin transaction. \", cause);\n }", "class_method_signature": "DefaultFailureHandlerImpl.onBeginFailure(GlobalTransaction tx, Throwable cause)", "constructor": false, "full_signatur...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_231
{ "fields": [ { "declarator": "GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(\n \"global-trans-scanner-test\")", "modifier": "private static final", "original_string": "private static final GlobalTransactionScanner GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(\n ...
{ "body": "@Test\n public void testSetTransactionAnnotation()\n throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n MethodDesc methodDesc = getMethodDesc();\n assertThat(methodDesc.getTransactionAnnotation()).isNotNull();\n methodDesc.setTransactionAnnota...
{ "fields": [ { "declarator": "transactionAnnotation", "modifier": "private", "original_string": "private GlobalTransactional transactionAnnotation;", "type": "GlobalTransactional", "var_name": "transactionAnnotation" }, { "declarator": "method", "modifier": "priv...
{ "body": "public void setTransactionAnnotation(GlobalTransactional transactionAnnotation) {\n this.transactionAnnotation = transactionAnnotation;\n }", "class_method_signature": "MethodDesc.setTransactionAnnotation(GlobalTransactional transactionAnnotation)", "constructor": false, "full_signature": "...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_230
{ "fields": [ { "declarator": "GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(\n \"global-trans-scanner-test\")", "modifier": "private static final", "original_string": "private static final GlobalTransactionScanner GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(\n ...
{ "body": "@Test\n public void testGetMethod() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n MethodDesc methodDesc = getMethodDesc();\n assertThat(methodDesc.getMethod()).isEqualTo(method);\n }", "class_method_signature": "MethodDescTest.testGetMethod()", ...
{ "fields": [ { "declarator": "transactionAnnotation", "modifier": "private", "original_string": "private GlobalTransactional transactionAnnotation;", "type": "GlobalTransactional", "var_name": "transactionAnnotation" }, { "declarator": "method", "modifier": "priv...
{ "body": "public Method getMethod() {\n return method;\n }", "class_method_signature": "MethodDesc.getMethod()", "constructor": false, "full_signature": "public Method getMethod()", "identifier": "getMethod", "invocations": [], "modifiers": "public", "parameters": "()", "return": "Method", ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_119
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getAllExtensionClass1() {\n List<Class> allExtensionClass = EnhancedServiceLoader\n .getAllExtensionClass(Hello.class, ClassLoader.getSystemClassLoader());\n assertThat(allExtensionClass).isNotEmpty();\n }", "class_method_signature": "EnhancedService...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "@SuppressWarnings(\"rawtypes\")\n static <S> List<Class> getAllExtensionClass(Class<S> service) {\n return InnerEnhancedServiceLoader.getServiceLoader(service).getAllExtensionClass(findClassLoader());\n }", "class_method_signature": "EnhancedServiceLoader.getAllExtensionClass(Class<S> servic...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_59
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImplTest.class);", "type": "Logger", "var_n...
{ "body": "@Test\n void onCommitFailure() throws Exception{\n\n RootContext.bind(DEFAULT_XID);\n GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();\n FailureHandler failureHandler = new DefaultFailureHandlerImpl();\n failureHandler.onCommitFailure(tx, new MyRuntimeExc...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImpl.class);", "type": "Logger", "var_name": "L...
{ "body": "@Override\n public void onCommitFailure(GlobalTransaction tx, Throwable cause) {\n LOGGER.warn(\"Failed to commit transaction[\" + tx.getXid() + \"]\", cause);\n timer.newTimeout(new CheckTimerTask(tx, GlobalStatus.Committed), SCHEDULE_INTERVAL_SECONDS, TimeUnit.SECONDS);\n }", "class...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_2
{ "fields": [], "file": "discovery/seata-discovery-consul/src/test/java/io/seata/discovery/registry/consul/ConsulRegistryServiceImplTest.java", "identifier": "ConsulRegistryServiceImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSubscribe() throws Exception {\n RegistryService registryService = mock(ConsulRegistryServiceImpl.class);\n ConsulListener consulListener = mock(ConsulListener.class);\n registryService.subscribe(\"test\", consulListener);\n verify(registryService).sub...
{ "fields": [ { "declarator": "instance", "modifier": "private static volatile", "original_string": "private static volatile ConsulRegistryServiceImpl instance;", "type": "ConsulRegistryServiceImpl", "var_name": "instance" }, { "declarator": "client", "modifier": ...
{ "body": "@Override\n public void subscribe(String cluster, ConsulListener listener) throws Exception {\n //1.add listener to subscribe list\n listenerMap.putIfAbsent(cluster, new HashSet<>());\n listenerMap.get(cluster).add(listener);\n //2.get healthy services\n Response<List<...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_226
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/DataCompareUtilsTest.java", "identifier": "DataCompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isRowsEquals() {\n TableMeta tableMeta = Mockito.mock(TableMeta.class);\n Mockito.when(tableMeta.getPrimaryKeyOnlyName()).thenReturn(Arrays.asList(new String[]{\"pk\"}));\n Mockito.when(tableMeta.getTableName()).thenReturn(\"table_name\");\n\n List<Row> ro...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/DataCompareUtils.java", "identifier": "DataCompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "DataCompareUtils.DataCompareUtils()", "constructor": true, "full_signature": "private DataCom...
{ "body": "public static Result<Boolean> isRowsEquals(TableMeta tableMetaData, List<Row> oldRows, List<Row> newRows) {\n if (!CollectionUtils.isSizeEquals(oldRows, newRows)) {\n return Result.build(false, null);\n }\n return compareRows(tableMetaData, oldRows, newRows);\n }", "cla...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_158
{ "fields": [ { "declarator": "DEFAULT_XID = \"default_xid\"", "modifier": "private final", "original_string": "private final String DEFAULT_XID = \"default_xid\";", "type": "String", "var_name": "DEFAULT_XID" }, { "declarator": "DEFAULT_BRANCH_TYPE = BranchType.AT", ...
{ "body": "@Test\n public void testAssertNotInGlobalTransaction() {\n RootContext.assertNotInGlobalTransaction();\n assertThat(RootContext.getXID()).isNull();\n }", "class_method_signature": "RootContextTest.testAssertNotInGlobalTransaction()", "constructor": false, "full_signature": "@Test ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RootContext.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RootContext.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "public static void assertNotInGlobalTransaction() {\n if (inGlobalTransaction()) {\n throw new ShouldNeverHappenException();\n }\n }", "class_method_signature": "RootContext.assertNotInGlobalTransaction()", "constructor": false, "full_signature": "public static void assert...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_18
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/BranchRollbackRequestConvertorTest.java", "identifier": "BranchRollbackRequestConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n BranchRollbackRequest branchRegisterRequest = new BranchRollbackRequest();\n branchRegisterRequest.setApplicationData(\"data\");\n branchRegisterRequest.setBranchType(BranchType.AT);\n branchRegisterRequest.setResourceId(\"resourceId\...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/BranchRollbackRequestConvertor.java", "identifier": "BranchRollbackRequestConvertor", "interfaces": "implements PbConvertor<BranchRollbackRequest, BranchRollbackRequestProto>", "methods": [ {...
{ "body": "@Override\n public BranchRollbackRequestProto convert2Proto(BranchRollbackRequest branchRollbackRequest) {\n final short typeCode = branchRollbackRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTy...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_63
{ "fields": [ { "declarator": "DEFAULT_XID = \"1234567890\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_XID = \"1234567890\";", "type": "String", "var_name": "DEFAULT_XID" } ], "file": "integration/dubbo/src/test/java/io/seata...
{ "body": "@Test\n public void testInvoke_And_RootContext() {\n ApacheDubboTransactionPropagationFilter filter = new ApacheDubboTransactionPropagationFilter();\n\n // SAGA\n RpcContext.getContext().setAttachment(RootContext.KEY_XID, DEFAULT_XID);\n RpcContext.getContext().setAttachment(...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(ApacheDubboTransactionPropagationFilter.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ApacheDubboTransactionPropagationFilter.class);", "type": "L...
{ "body": "@Override\n public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {\n String xid = RootContext.getXID();\n BranchType branchType = RootContext.getBranchType();\n\n String rpcXid = getRpcXid();\n String rpcBranchType = RpcContext.getContext().getA...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_123
{ "fields": [ { "declarator": "DEFAULT_CORE_POOL_SIZE = 1", "modifier": "private final", "original_string": "private final int DEFAULT_CORE_POOL_SIZE = 1;", "type": "int", "var_name": "DEFAULT_CORE_POOL_SIZE" }, { "declarator": "DEFAULT_KEEP_ALIVE_TIME = 10", "mod...
{ "body": "@Test\n public void testRunsOldestTaskPolicy() throws Exception {\n AtomicInteger atomicInteger = new AtomicInteger();\n ThreadPoolExecutor poolExecutor =\n new ThreadPoolExecutor(DEFAULT_CORE_POOL_SIZE, DEFAULT_CORE_POOL_SIZE, DEFAULT_KEEP_ALIVE_TIME,\n TimeUnit....
{ "fields": [], "file": "common/src/main/java/io/seata/common/thread/RejectedPolicies.java", "identifier": "RejectedPolicies", "interfaces": "", "methods": [ { "class_method_signature": "RejectedPolicies.runsOldestTaskPolicy()", "constructor": false, "full_signature": "public static Reje...
{ "body": "public static RejectedExecutionHandler runsOldestTaskPolicy() {\n return (r, executor) -> {\n if (executor.isShutdown()) {\n return;\n }\n BlockingQueue<Runnable> workQueue = executor.getQueue();\n Runnable firstWork = workQueue.poll();\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_34
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/RegisterTMRequestConvertorTest.java", "identifier": "RegisterTMRequestConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n RegisterTMRequest registerRMRequest = new RegisterTMRequest();\n registerRMRequest.setVersion(\"123\");\n registerRMRequest.setTransactionServiceGroup(\"group\");\n registerRMRequest.setExtraData(\"extraData\");\n registerRMReq...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/RegisterTMRequestConvertor.java", "identifier": "RegisterTMRequestConvertor", "interfaces": "implements PbConvertor<RegisterTMRequest, RegisterTMRequestProto>", "methods": [ { "class_me...
{ "body": "@Override\n public RegisterTMRequestProto convert2Proto(RegisterTMRequest registerTMRequest) {\n final short typeCode = registerTMRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto.forNumbe...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_174
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/ColumnUtilsTest.java", "identifier": "ColumnUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_addEscape_byDbType() throws Exception {\n List<String> cols = new ArrayList<>();\n cols.add(\"id\");\n cols = ColumnUtils.addEscape(cols, JdbcConstants.MYSQL);\n Assertions.assertEquals(\"id\", cols.get(0));\n\n cols = new ArrayList<>();\n ...
{ "fields": [ { "declarator": "DOT = \".\"", "modifier": "private static final", "original_string": "private static final String DOT = \".\";", "type": "String", "var_name": "DOT" } ], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/ColumnUtils.java", "identifie...
{ "body": "public static List<String> addEscape(List<String> cols, String dbType) {\n if (CollectionUtils.isEmpty(cols)) {\n return cols;\n }\n List<String> newCols = new ArrayList<>(cols.size());\n for (int i = 0, len = cols.size(); i < len; i++) {\n String col = col...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_22
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/BranchCommitRequestConvertorTest.java", "identifier": "BranchCommitRequestConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n BranchCommitRequest branchCommitRequest = new BranchCommitRequest();\n branchCommitRequest.setBranchType(BranchType.AT);\n branchCommitRequest.setXid(\"xid\");\n branchCommitRequest.setResourceId(\"resourceId\");\n branchCommit...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/BranchCommitRequestConvertor.java", "identifier": "BranchCommitRequestConvertor", "interfaces": "implements PbConvertor<BranchCommitRequest, BranchCommitRequestProto>", "methods": [ { "...
{ "body": "@Override\n public BranchCommitRequestProto convert2Proto(BranchCommitRequest branchCommitRequest) {\n final short typeCode = branchCommitRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto....
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_162
{ "fields": [ { "declarator": "parameterParser = null", "modifier": "private static", "original_string": "private static ParameterParser parameterParser = null;", "type": "ParameterParser", "var_name": "parameterParser" } ], "file": "server/src/test/java/io/seata/server/Param...
{ "body": "@Test\n public void testGetHost() {\n Assertions.assertEquals(\"127.0.0.1\", parameterParser.getHost());\n }", "class_method_signature": "ParameterParserTest.testGetHost()", "constructor": false, "full_signature": "@Test public void testGetHost()", "identifier": "testGetHost", "invoc...
{ "fields": [ { "declarator": "PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)\"", "modifier": "private static final", "original_string": "private static final String PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata...
{ "body": "public String getHost() {\n return host;\n }", "class_method_signature": "ParameterParser.getHost()", "constructor": false, "full_signature": "public String getHost()", "identifier": "getHost", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "si...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_75
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testInvokeMethod2() throws NoSuchMethodException,\n IllegalAccessException, InvocationTargetException {\n Assertions.assertEquals(0, ReflectionUtil\n .invokeMethod(\"\", \"length\", null, null));\n Assertions.assertEquals(3, ReflectionUtil\n ...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static Object invokeMethod(Object target, String methodName)\n throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException,\n InvocationTargetException {\n Class<?> cl = target.getClass();\n int i = 0;\n while ((i++) < MAX_NEST...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_135
{ "fields": [ { "declarator": "localTCCRemotingParser = new LocalTCCRemotingParser()", "modifier": "", "original_string": "LocalTCCRemotingParser localTCCRemotingParser = new LocalTCCRemotingParser();", "type": "LocalTCCRemotingParser", "var_name": "localTCCRemotingParser" } ],...
{ "body": "@Test\n public void testServiceParser(){\n TccActionImpl tccAction = new TccActionImpl();\n\n boolean result = localTCCRemotingParser.isService(tccAction, \"a\");\n Assertions.assertTrue(result);\n }", "class_method_signature": "LocalTCCRemotingParserTest.testServiceParser()", ...
{ "fields": [], "file": "tcc/src/main/java/io/seata/rm/tcc/remoting/parser/LocalTCCRemotingParser.java", "identifier": "LocalTCCRemotingParser", "interfaces": "", "methods": [ { "class_method_signature": "LocalTCCRemotingParser.isReference(Object bean, String beanName)", "constructor": false, ...
{ "body": "@Override\n public boolean isService(Object bean, String beanName) {\n Class<?> classType = bean.getClass();\n Set<Class<?>> interfaceClasses = ReflectionUtil.getInterfaces(classType);\n for (Class<?> interClass : interfaceClasses) {\n if (interClass.isAnnotationPresent(L...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_142
{ "fields": [ { "declarator": "nettyPoolKey", "modifier": "private", "original_string": "private NettyPoolKey nettyPoolKey;", "type": "NettyPoolKey", "var_name": "nettyPoolKey" }, { "declarator": "RM_ROLE = NettyPoolKey.TransactionRole.RMROLE", "modifier": "privat...
{ "body": "@Test\n public void setAddress() {\n nettyPoolKey.setAddress(ADDRESS2);\n Assertions.assertEquals(nettyPoolKey.getAddress(), ADDRESS2);\n }", "class_method_signature": "NettyPoolKeyTest.setAddress()", "constructor": false, "full_signature": "@Test public void setAddress()", "ide...
{ "fields": [ { "declarator": "transactionRole", "modifier": "private", "original_string": "private TransactionRole transactionRole;", "type": "TransactionRole", "var_name": "transactionRole" }, { "declarator": "address", "modifier": "private", "original_str...
{ "body": "public NettyPoolKey setAddress(String address) {\n this.address = address;\n return this;\n }", "class_method_signature": "NettyPoolKey.setAddress(String address)", "constructor": false, "full_signature": "public NettyPoolKey setAddress(String address)", "identifier": "setAddress",...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_115
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadByClass() {\n Hello load = EnhancedServiceLoader.load(Hello.class);\n assertThat(load.say()).isEqualTo(\"Olá.\");\n }", "class_method_signature": "EnhancedServiceLoaderTest.testLoadByClass()", "constructor": false, "full_signature": "@Test public void t...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "public static <S> S load(Class<S> service, ClassLoader loader) throws EnhancedServiceNotFoundException {\n return InnerEnhancedServiceLoader.getServiceLoader(service).load(loader);\n }", "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_55
{ "fields": [], "file": "tm/src/test/java/io/seata/tm/api/transaction/RollbackRuleTest.java", "identifier": "RollbackRuleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void alwaysTrueForThrowable() {\n RollbackRule rr = new RollbackRule(java.lang.Throwable.class.getName());\n assertThat(rr.getDepth(new MyRuntimeException(\"\")) > 0).isTrue();\n assertThat(rr.getDepth(new IOException()) > 0).isTrue();\n assertThat(rr.getDepth(...
{ "fields": [ { "declarator": "exceptionName", "modifier": "private final", "original_string": "private final String exceptionName;", "type": "String", "var_name": "exceptionName" } ], "file": "tm/src/main/java/io/seata/tm/api/transaction/RollbackRule.java", "identifier": "...
{ "body": "public int getDepth(Throwable ex) {\n return getDepth(ex.getClass(), 0);\n }", "class_method_signature": "RollbackRule.getDepth(Throwable ex)", "constructor": false, "full_signature": "public int getDepth(Throwable ex)", "identifier": "getDepth", "invocations": [ "getDepth", "ge...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_103
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/NumberUtilsTest.java", "identifier": "NumberUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToInReturnParsedValue() {\n Assertions.assertEquals(10, NumberUtils.toInt(\"10\", 9));\n }", "class_method_signature": "NumberUtilsTest.testToInReturnParsedValue()", "constructor": false, "full_signature": "@Test public void testToInReturnParsedValue()", "identi...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/NumberUtils.java", "identifier": "NumberUtils", "interfaces": "", "methods": [ { "class_method_signature": "NumberUtils.toInt(final String str, final int defaultValue)", "constructor": false, "full_signature": "public sta...
{ "body": "public static int toInt(final String str, final int defaultValue) {\n if (str == null) {\n return defaultValue;\n }\n try {\n return Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return defaultValue;\n }\n }", "clas...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_43
{ "fields": [ { "declarator": "DEFAULT_XID = \"1234567890\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_XID = \"1234567890\";", "type": "String", "var_name": "DEFAULT_XID" } ], "file": "tm/src/test/java/io/seata/tm/api/Default...
{ "body": "@Test\n public void rollBackRetryExceptionTest() throws TransactionException {\n RootContext.unbind();\n GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();\n tx.begin();\n Assertions.assertThrows(TransactionException.class, tx::rollback);\n }", "class_...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultGlobalTransaction.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultGlobalTransaction.class);", "type": "Logger", "var_name": "LOG...
{ "body": "@Override\n public void begin() throws TransactionException {\n begin(DEFAULT_GLOBAL_TX_TIMEOUT);\n }", "class_method_signature": "DefaultGlobalTransaction.begin()", "constructor": false, "full_signature": "@Override public void begin()", "identifier": "begin", "invocations": [ "...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_154
{ "fields": [ { "declarator": "DEFAULT_XID = \"default_xid\"", "modifier": "private final", "original_string": "private final String DEFAULT_XID = \"default_xid\";", "type": "String", "var_name": "DEFAULT_XID" }, { "declarator": "DEFAULT_BRANCH_TYPE = BranchType.AT", ...
{ "body": "@Test\n public void testGetBranchType() {\n RootContext.bindBranchType(DEFAULT_BRANCH_TYPE);\n\n //before bind xid, branchType is null\n assertThat(RootContext.getBranchType()).isNull();\n //after bind xid, branchType is not null\n RootContext.bind(DEFAULT_XID);\n ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RootContext.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RootContext.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "public static BranchType getBranchType() {\n if (inGlobalTransaction()) {\n BranchType branchType = (BranchType) CONTEXT_HOLDER.get(KEY_BRANCH_TYPE);\n if (branchType != null) {\n return branchType;\n }\n //Returns the default branch type.\n...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_14
{ "fields": [], "file": "compressor/seata-compressor-7z/src/test/java/io/seata/compressor/sevenz/SevenZUtilTest.java", "identifier": "SevenZUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test_decompress() {\n Assertions.assertThrows(NullPointerException.class, () -> {\n SevenZUtil.decompress(null);\n });\n }", "class_method_signature": "SevenZUtilTest.test_decompress()", "constructor": false, "full_signature": "@Test public void test...
{ "fields": [ { "declarator": "BUFFER_SIZE = 8192", "modifier": "private static final", "original_string": "private static final int BUFFER_SIZE = 8192;", "type": "int", "var_name": "BUFFER_SIZE" } ], "file": "compressor/seata-compressor-7z/src/main/java/io/seata/compressor/s...
{ "body": "public static byte[] decompress(byte[] bytes) {\n if (bytes == null) {\n throw new NullPointerException(\"bytes is null\");\n }\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n SeekableInMemoryByteChannel channel = new SeekableInMemoryByteChannel(bytes);\n...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_80
{ "fields": [ { "declarator": "ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902)", "modifier": "private", "original_string": "private InetSocketAddress ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902);", "type": "InetSocketAddress", ...
{ "body": "@Test\n public void testToStringAddress() {\n try {\n String stringAddress = NetUtil.toStringAddress(InetSocketAddress.createUnresolved(\"127.0.0.1\", 9828));\n } catch (Exception e) {\n assertThat(e).isInstanceOf(NullPointerException.class);\n }\n }", "cl...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(NetUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NetUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarato...
{ "body": "public static String toStringAddress(SocketAddress address) {\n if (address == null) {\n return StringUtils.EMPTY;\n }\n return toStringAddress((InetSocketAddress) address);\n }", "class_method_signature": "NetUtil.toStringAddress(SocketAddress address)", "constructor...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_206
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/UndoLogParserFactoryTest.java", "identifier": "UndoLogParserFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void getInstance() {\n Assertions.assertTrue(UndoLogParserFactory.getInstance() instanceof JacksonUndoLogParser);\n }", "class_method_signature": "UndoLogParserFactoryTest.getInstance()", "constructor": false, "full_signature": "@Test void getInstance()", "identifier": "getInst...
{ "fields": [ { "declarator": "INSTANCES = new ConcurrentHashMap<>()", "modifier": "private static final", "original_string": "private static final ConcurrentMap<String, UndoLogParser> INSTANCES = new ConcurrentHashMap<>();", "type": "ConcurrentMap<String, UndoLogParser>", "var_name"...
{ "body": "public static UndoLogParser getInstance() {\n return SingletonHolder.INSTANCE;\n }", "class_method_signature": "UndoLogParserFactory.getInstance()", "constructor": false, "full_signature": "public static UndoLogParser getInstance()", "identifier": "getInstance", "invocations": [], "mo...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_197
{ "fields": [ { "declarator": "columnMetas =\n new Object[][] {\n new Object[] {\"\", \"\", \"table_records_test\", \"id\", Types.INTEGER, \"INTEGER\", 64, 0, 10, 1, \"\", \"\", 0, 0, 64, 1, \"NO\", \"YES\"},\n new Object[] {\"\", \"\", \"table_records_test\", \"name\", Types.VA...
{ "body": "@Test\n public void testBuildRecords() throws SQLException {\n MockDriver mockDriver = new MockDriver(returnValueColumnLabels, returnValue, columnMetas, indexMetas);\n DruidDataSource dataSource = new DruidDataSource();\n dataSource.setUrl(\"jdbc:mock:xxx\");\n dataSource.set...
{ "fields": [ { "declarator": "tableMeta", "modifier": "private transient", "original_string": "private transient TableMeta tableMeta;", "type": "TableMeta", "var_name": "tableMeta" }, { "declarator": "tableName", "modifier": "private", "original_string": "p...
{ "body": "public static TableRecords buildRecords(TableMeta tmeta, ResultSet resultSet) throws SQLException {\n TableRecords records = new TableRecords(tmeta);\n ResultSetMetaData resultSetMetaData = resultSet.getMetaData();\n int columnCount = resultSetMetaData.getColumnCount();\n\n whil...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_38
{ "fields": [ { "declarator": "RESOURCE_ID = \"resourceId\"", "modifier": "private static final", "original_string": "private static final String RESOURCE_ID = \"resourceId\";", "type": "String", "var_name": "RESOURCE_ID" }, { "declarator": "SAVE_DAYS = 3", "modif...
{ "body": "@Test\n public void convert2Proto() {\n\n UndoLogDeleteRequest undoLogDeleteRequest = new UndoLogDeleteRequest();\n undoLogDeleteRequest.setBranchType(BranchType.AT);\n undoLogDeleteRequest.setResourceId(RESOURCE_ID);\n undoLogDeleteRequest.setSaveDays(SAVE_DAYS);\n\n ...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/UndoLogDeleteRequestConvertor.java", "identifier": "UndoLogDeleteRequestConvertor", "interfaces": "implements PbConvertor<UndoLogDeleteRequest, UndoLogDeleteRequestProto>", "methods": [ { ...
{ "body": "@Override\n public UndoLogDeleteRequestProto convert2Proto(UndoLogDeleteRequest undoLogDeleteRequest) {\n final short typeCode = undoLogDeleteRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypePr...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_178
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/SqlGenerateUtilsTest.java", "identifier": "SqlGenerateUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testBuildWhereConditionByPKs() throws SQLException {\n List<String> pkNameList=new ArrayList<>();\n pkNameList.add(\"id\");\n pkNameList.add(\"name\");\n String result = SqlGenerateUtils.buildWhereConditionByPKs(pkNameList,4,\"mysql\",2);\n Assertions.asse...
{ "fields": [ { "declarator": "MAX_IN_SIZE = 1000", "modifier": "private static final", "original_string": "private static final int MAX_IN_SIZE = 1000;", "type": "int", "var_name": "MAX_IN_SIZE" } ], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/SqlGenerateUtil...
{ "body": "public static String buildWhereConditionByPKs(List<String> pkNameList, int rowSize, String dbType)\n throws SQLException {\n return buildWhereConditionByPKs(pkNameList, rowSize, dbType, MAX_IN_SIZE);\n\n }", "class_method_signature": "SqlGenerateUtils.buildWhereConditionByPKs(List<String...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_181
{ "fields": [ { "declarator": "deleteExecutor", "modifier": "private static", "original_string": "private static DeleteExecutor deleteExecutor;", "type": "DeleteExecutor", "var_name": "deleteExecutor" }, { "declarator": "statementProxy", "modifier": "private stati...
{ "body": "@Test\n public void testAfterImage() throws SQLException {\n TableRecords tableRecords = deleteExecutor.beforeImage();\n Assertions.assertEquals(0, deleteExecutor.afterImage(tableRecords).size());\n }", "class_method_signature": "DeleteExecutorTest.testAfterImage()", "constructor": ...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/exec/DeleteExecutor.java", "identifier": "DeleteExecutor", "interfaces": "", "methods": [ { "class_method_signature": "DeleteExecutor.DeleteExecutor(StatementProxy<S> statementProxy, StatementCallback<T,S> statementCallback,...
{ "body": "@Override\n protected TableRecords afterImage(TableRecords beforeImage) throws SQLException {\n return TableRecords.empty(getTableMeta());\n }", "class_method_signature": "DeleteExecutor.afterImage(TableRecords beforeImage)", "constructor": false, "full_signature": "@Override protected T...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_79
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testModifyStaticFinalField() throws NoSuchFieldException, IllegalAccessException {\n Assertions.assertEquals(\"hello\", testValue);\n ReflectionUtil.modifyStaticFinalField(ReflectionUtilTest.class, \"testValue\", \"hello world\");\n Assertions.assertEquals(\"hell...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static void modifyStaticFinalField(Class cla, String modifyFieldName, Object newValue)\n throws NoSuchFieldException, IllegalAccessException {\n Field field = cla.getDeclaredField(modifyFieldName);\n field.setAccessible(true);\n Field modifiers = field.getClass().getDecla...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_96
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/CompressUtilTest.java", "identifier": "CompressUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUncompress() throws IOException {\n byte[] bytes = new byte[]{31, -117, 8, 0, 0, 0, 0, 0, 0, 0,\n 99, 100, 98, 6, 0, 29, -128, -68, 85, 3, 0, 0, 0};\n\n Assertions.assertArrayEquals(new byte[]{1, 2, 3},\n CompressUtil.uncompress(bytes))...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/CompressUtil.java", "identifier": "CompressUtil", "interfaces": "", "methods": [ { "class_method_signature": "CompressUtil.compress(final byte[] src)", "constructor": false, "full_signature": "public static byte[] compres...
{ "body": "public static byte[] uncompress(final byte[] src) throws IOException {\n byte[] result;\n byte[] uncompressData = new byte[src.length];\n ByteArrayInputStream bis = new ByteArrayInputStream(src);\n GZIPInputStream iis = new GZIPInputStream(bis);\n ByteArrayOutputStream bo...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_139
{ "fields": [ { "declarator": "nettyPoolKey", "modifier": "private", "original_string": "private NettyPoolKey nettyPoolKey;", "type": "NettyPoolKey", "var_name": "nettyPoolKey" }, { "declarator": "RM_ROLE = NettyPoolKey.TransactionRole.RMROLE", "modifier": "privat...
{ "body": "@Test\n public void getTransactionRole() {\n Assertions.assertEquals(nettyPoolKey.getTransactionRole(), RM_ROLE);\n }", "class_method_signature": "NettyPoolKeyTest.getTransactionRole()", "constructor": false, "full_signature": "@Test public void getTransactionRole()", "identifier": "ge...
{ "fields": [ { "declarator": "transactionRole", "modifier": "private", "original_string": "private TransactionRole transactionRole;", "type": "TransactionRole", "var_name": "transactionRole" }, { "declarator": "address", "modifier": "private", "original_str...
{ "body": "public TransactionRole getTransactionRole() {\n return transactionRole;\n }", "class_method_signature": "NettyPoolKey.getTransactionRole()", "constructor": false, "full_signature": "public TransactionRole getTransactionRole()", "identifier": "getTransactionRole", "invocations": [], "m...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_210
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/oracle/OracleUndoUpdateExecutorTest.java", "identifier": "OracleUndoUpdateExecutorTest", "interfaces": "", "superclass": "extends BaseExecutorTest" }
{ "body": "@Test\n public void buildUndoSQLByUpperCase() {\n OracleUndoUpdateExecutor executor = upperCaseSQL();\n\n String sql = executor.buildUndoSQL();\n Assertions.assertNotNull(sql);\n Assertions.assertTrue(sql.contains(\"UPDATE\"));\n Assertions.assertTrue(sql.contains(\"ID...
{ "fields": [ { "declarator": "UPDATE_SQL_TEMPLATE = \"UPDATE %s SET %s WHERE %s \"", "modifier": "private static final", "original_string": "private static final String UPDATE_SQL_TEMPLATE = \"UPDATE %s SET %s WHERE %s \";", "type": "String", "var_name": "UPDATE_SQL_TEMPLATE" } ...
{ "body": "@Override\n protected String buildUndoSQL() {\n TableRecords beforeImage = sqlUndoLog.getBeforeImage();\n List<Row> beforeImageRows = beforeImage.getRows();\n if (CollectionUtils.isEmpty(beforeImageRows)) {\n throw new ShouldNeverHappenException(\"Invalid UNDO LOG\"); // ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_141
{ "fields": [ { "declarator": "nettyPoolKey", "modifier": "private", "original_string": "private NettyPoolKey nettyPoolKey;", "type": "NettyPoolKey", "var_name": "nettyPoolKey" }, { "declarator": "RM_ROLE = NettyPoolKey.TransactionRole.RMROLE", "modifier": "privat...
{ "body": "@Test\n public void getAddress() {\n Assertions.assertEquals(nettyPoolKey.getAddress(), ADDRESS1);\n }", "class_method_signature": "NettyPoolKeyTest.getAddress()", "constructor": false, "full_signature": "@Test public void getAddress()", "identifier": "getAddress", "invocations": [ ...
{ "fields": [ { "declarator": "transactionRole", "modifier": "private", "original_string": "private TransactionRole transactionRole;", "type": "TransactionRole", "var_name": "transactionRole" }, { "declarator": "address", "modifier": "private", "original_str...
{ "body": "public String getAddress() {\n return address;\n }", "class_method_signature": "NettyPoolKey.getAddress()", "constructor": false, "full_signature": "public String getAddress()", "identifier": "getAddress", "invocations": [], "modifiers": "public", "parameters": "()", "return": "St...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_56
{ "fields": [], "file": "tm/src/test/java/io/seata/tm/api/transaction/RollbackRuleTest.java", "identifier": "RollbackRuleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void toStringTest(){\n RollbackRule otherRollbackRuleByName = new RollbackRule(Exception.class.getName());\n Assertions.assertEquals(otherRollbackRuleByName.toString(), String.format(\"RollbackRule with pattern [%s]\", Exception.class.getName()));\n }", "class_method_si...
{ "fields": [ { "declarator": "exceptionName", "modifier": "private final", "original_string": "private final String exceptionName;", "type": "String", "var_name": "exceptionName" } ], "file": "tm/src/main/java/io/seata/tm/api/transaction/RollbackRule.java", "identifier": "...
{ "body": "@Override\n public String toString() {\n return \"RollbackRule with pattern [\" + this.exceptionName + \"]\";\n }", "class_method_signature": "RollbackRule.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocation...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_116
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadByClassAndActivateName() {\n Hello englishHello = EnhancedServiceLoader.load(Hello.class, \"EnglishHello\");\n assertThat(englishHello.say()).isEqualTo(\"hello!\");\n }", "class_method_signature": "EnhancedServiceLoaderTest.testLoadByClassAndActivateName()"...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "public static <S> S load(Class<S> service, ClassLoader loader) throws EnhancedServiceNotFoundException {\n return InnerEnhancedServiceLoader.getServiceLoader(service).load(loader);\n }", "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_40
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalBeginResponseConvertorTest.java", "identifier": "GlobalBeginResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n GlobalBeginResponse globalBeginResponse = new GlobalBeginResponse();\n\n globalBeginResponse.setResultCode(ResultCode.Failed);\n globalBeginResponse.setMsg(\"msg\");\n globalBeginResponse.setExtraData(\"extraData\");\n globalBe...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalBeginResponseConvertor.java", "identifier": "GlobalBeginResponseConvertor", "interfaces": "implements PbConvertor<GlobalBeginResponse, GlobalBeginResponseProto>", "methods": [ { "...
{ "body": "@Override\n public GlobalBeginResponseProto convert2Proto(GlobalBeginResponse globalBeginResponse) {\n final short typeCode = globalBeginResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto....
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_100
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/IOUtilTest.java", "identifier": "IOUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIgnoreExceptionOnClose() {\n FakeResource resource = new FakeResource() {\n @Override\n public void close() throws Exception {\n super.close();\n throw new Exception(\"Ops!\");\n }\n };\n\n IOUtil...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/IOUtil.java", "identifier": "IOUtil", "interfaces": "", "methods": [ { "class_method_signature": "IOUtil.close(AutoCloseable... closeables)", "constructor": false, "full_signature": "public static void close(AutoCloseable...
{ "body": "public static void close(AutoCloseable... closeables) {\n if (CollectionUtils.isNotEmpty(closeables)) {\n for (AutoCloseable closeable : closeables) {\n close(closeable);\n }\n }\n }", "class_method_signature": "IOUtil.close(AutoCloseable... closeable...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_229
{ "fields": [ { "declarator": "GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(\n \"global-trans-scanner-test\")", "modifier": "private static final", "original_string": "private static final GlobalTransactionScanner GLOBAL_TRANSACTION_SCANNER = new GlobalTransactionScanner(\n ...
{ "body": "@Test\n public void testGetTransactionAnnotation()\n throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n MethodDesc methodDesc = getMethodDesc();\n assertThat(methodDesc.getTransactionAnnotation()).isEqualTo(transactional);\n\n }", "class_method_...
{ "fields": [ { "declarator": "transactionAnnotation", "modifier": "private", "original_string": "private GlobalTransactional transactionAnnotation;", "type": "GlobalTransactional", "var_name": "transactionAnnotation" }, { "declarator": "method", "modifier": "priv...
{ "body": "public GlobalTransactional getTransactionAnnotation() {\n return transactionAnnotation;\n }", "class_method_signature": "MethodDesc.getTransactionAnnotation()", "constructor": false, "full_signature": "public GlobalTransactional getTransactionAnnotation()", "identifier": "getTransactionAn...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_17
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalLockQueryResponseConvertorTest.java", "identifier": "GlobalLockQueryResponseConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n GlobalLockQueryResponse globalLockQueryResponse = new GlobalLockQueryResponse();\n globalLockQueryResponse.setLockable(true);\n globalLockQueryResponse.setMsg(\"msg\");\n globalLockQueryResponse.setResultCode(ResultCode.Failed);\n ...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalLockQueryResponseConvertor.java", "identifier": "GlobalLockQueryResponseConvertor", "interfaces": "implements PbConvertor<GlobalLockQueryResponse, GlobalLockQueryResponseProto>", "methods":...
{ "body": "@Override\n public GlobalLockQueryResponseProto convert2Proto(GlobalLockQueryResponse globalLockQueryResponse) {\n final short typeCode = globalLockQueryResponse.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n M...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_157
{ "fields": [ { "declarator": "DEFAULT_XID = \"default_xid\"", "modifier": "private final", "original_string": "private final String DEFAULT_XID = \"default_xid\";", "type": "String", "var_name": "DEFAULT_XID" }, { "declarator": "DEFAULT_BRANCH_TYPE = BranchType.AT", ...
{ "body": "@Test\n public void testInSagaBranch() {\n RootContext.bind(DEFAULT_XID);\n assertThat(RootContext.inSagaBranch()).isFalse();\n RootContext.bindBranchType(BranchType.SAGA);\n assertThat(RootContext.inSagaBranch()).isTrue();\n RootContext.unbindBranchType();\n as...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(RootContext.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(RootContext.class);", "type": "Logger", "var_name": "LOGGER" }, { "d...
{ "body": "public static boolean inSagaBranch() {\n return BranchType.SAGA == getBranchType();\n }", "class_method_signature": "RootContext.inSagaBranch()", "constructor": false, "full_signature": "public static boolean inSagaBranch()", "identifier": "inSagaBranch", "invocations": [ "getBranch...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_83
{ "fields": [ { "declarator": "ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902)", "modifier": "private", "original_string": "private InetSocketAddress ipv4 = new InetSocketAddress(Inet4Address.getLocalHost().getHostName(), 3902);", "type": "InetSocketAddress", ...
{ "body": "@Test\n public void testToIpAddress() throws UnknownHostException {\n assertThat(NetUtil.toIpAddress(ipv4)).isEqualTo(ipv4.getAddress().getHostAddress());\n assertThat(NetUtil.toIpAddress(ipv6)).isEqualTo(ipv6.getAddress().getHostAddress());\n }", "class_method_signature": "NetUtilTes...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(NetUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(NetUtil.class);", "type": "Logger", "var_name": "LOGGER" }, { "declarato...
{ "body": "public static String toIpAddress(SocketAddress address) {\n InetSocketAddress inetSocketAddress = (InetSocketAddress) address;\n return inetSocketAddress.getAddress().getHostAddress();\n }", "class_method_signature": "NetUtil.toIpAddress(SocketAddress address)", "constructor": false, ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_205
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/AbstractUndoExecutorTest.java", "identifier": "AbstractUndoExecutorTest", "interfaces": "", "superclass": "extends BaseH2Test" }
{ "body": "@Test\n public void testParsePK() {\n TableMeta tableMeta = Mockito.mock(TableMeta.class);\n Mockito.when(tableMeta.getPrimaryKeyOnlyName()).thenReturn(Arrays.asList(new String[]{\"id\"}));\n Mockito.when(tableMeta.getTableName()).thenReturn(\"table_name\");\n\n TableRecords ...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(AbstractUndoExecutor.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(AbstractUndoExecutor.class);", "type": "Logger", "var_name": "LOGGER" ...
{ "body": "protected Map<String, List<Field>> parsePkValues(TableRecords records) {\n return parsePkValues(records.getRows(), records.getTableMeta().getPrimaryKeyOnlyName());\n }", "class_method_signature": "AbstractUndoExecutor.parsePkValues(TableRecords records)", "constructor": false, "full_signatu...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_194
{ "fields": [ { "declarator": "COLUMN_ID=\"id\"", "modifier": "private final", "original_string": "private final String COLUMN_ID=\"id\";", "type": "String", "var_name": "COLUMN_ID" }, { "declarator": "COLUMN_USERCODE=\"userCode\"", "modifier": "private final", ...
{ "body": "@Test\n public void testGetPrimaryKeyOnlyName() {\n TableMeta tableMeta = new TableMeta();\n ColumnMeta columnIdMeta=new ColumnMeta();\n columnIdMeta.setColumnName(COLUMN_ID);\n IndexMeta primary = new IndexMeta();\n primary.setIndextype(IndexType.PRIMARY);\n pr...
{ "fields": [ { "declarator": "tableName", "modifier": "private", "original_string": "private String tableName;", "type": "String", "var_name": "tableName" }, { "declarator": "allColumns = new LinkedHashMap<String, ColumnMeta>()", "modifier": "private", "ori...
{ "body": "@SuppressWarnings(\"serial\")\n public List<String> getPrimaryKeyOnlyName() {\n List<String> list = new ArrayList<>();\n for (Entry<String, ColumnMeta> entry : getPrimaryKeyMap().entrySet()) {\n list.add(entry.getKey());\n }\n return list;\n }", "class_method_...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_182
{ "fields": [ { "declarator": "selectForUpdateExecutor", "modifier": "private static", "original_string": "private static SelectForUpdateExecutor selectForUpdateExecutor;", "type": "SelectForUpdateExecutor", "var_name": "selectForUpdateExecutor" }, { "declarator": "conn...
{ "body": "@Test\n public void testDoExecute() throws Throwable {\n Assertions.assertThrows(RuntimeException.class, () -> selectForUpdateExecutor.doExecute((Object) null));\n RootContext.bind(\"xid\");\n Assertions.assertDoesNotThrow(() -> {\n selectForUpdateExecutor.doExecute((Obje...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(SelectForUpdateExecutor.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SelectForUpdateExecutor.class);", "type": "Logger", "var_name": "LOGGE...
{ "body": "@Override\n public T doExecute(Object... args) throws Throwable {\n Connection conn = statementProxy.getConnection();\n DatabaseMetaData dbmd = conn.getMetaData();\n T rs;\n Savepoint sp = null;\n LockRetryController lockRetryController = new LockRetryController();\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_95
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/CompressUtilTest.java", "identifier": "CompressUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCompress() throws IOException {\n byte[] bytes = new byte[]{31, -117, 8, 0, 0, 0, 0, 0, 0, 0,\n 99, 100, 98, 6, 0, 29, -128, -68, 85, 3, 0, 0, 0};\n\n Assertions.assertArrayEquals(bytes,\n CompressUtil.compress(new byte[]{1, 2, 3}));\n ...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/CompressUtil.java", "identifier": "CompressUtil", "interfaces": "", "methods": [ { "class_method_signature": "CompressUtil.compress(final byte[] src)", "constructor": false, "full_signature": "public static byte[] compres...
{ "body": "public static byte[] compress(final byte[] src) throws IOException {\n byte[] result;\n ByteArrayOutputStream bos = new ByteArrayOutputStream(src.length);\n GZIPOutputStream gos = new GZIPOutputStream(bos);\n try {\n gos.write(src);\n gos.finish();\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_213
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/oracle/OracleUndoInsertExecutorTest.java", "identifier": "OracleUndoInsertExecutorTest", "interfaces": "", "superclass": "extends BaseExecutorTest" }
{ "body": "@Test\n public void getUndoRows() {\n OracleUndoInsertExecutor executor = upperCase();\n Assertions.assertEquals(executor.getUndoRows(), executor.getSqlUndoLog().getAfterImage());\n }", "class_method_signature": "OracleUndoInsertExecutorTest.getUndoRows()", "constructor": false, "...
{ "fields": [ { "declarator": "DELETE_SQL_TEMPLATE = \"DELETE FROM %s WHERE %s \"", "modifier": "private static final", "original_string": "private static final String DELETE_SQL_TEMPLATE = \"DELETE FROM %s WHERE %s \";", "type": "String", "var_name": "DELETE_SQL_TEMPLATE" } ],...
{ "body": "@Override\n protected TableRecords getUndoRows() {\n return sqlUndoLog.getAfterImage();\n }", "class_method_signature": "OracleUndoInsertExecutor.getUndoRows()", "constructor": false, "full_signature": "@Override protected TableRecords getUndoRows()", "identifier": "getUndoRows", "in...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_233
{ "fields": [ { "declarator": "globalTransactionScanner = new GlobalTransactionScanner(\"global-trans-scanner-test\")", "modifier": "protected", "original_string": "protected GlobalTransactionScanner globalTransactionScanner = new GlobalTransactionScanner(\"global-trans-scanner-test\");", ...
{ "body": "@Test\n public void testAfterPropertiesSet() {\n globalTransactionScanner.afterPropertiesSet();\n }", "class_method_signature": "GlobalTransactionScannerTest.testAfterPropertiesSet()", "constructor": false, "full_signature": "@Test public void testAfterPropertiesSet()", "identifier": "...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "LOGGER = LoggerFactory.getLogger(GlobalTr...
{ "body": "@Override\n public void afterPropertiesSet() {\n if (disableGlobalTransaction) {\n if (LOGGER.isInfoEnabled()) {\n LOGGER.info(\"Global transaction is disabled.\");\n }\n return;\n }\n initClient();\n }", "class_method_signature":...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_1
{ "fields": [], "file": "discovery/seata-discovery-consul/src/test/java/io/seata/discovery/registry/consul/ConsulRegistryServiceImplTest.java", "identifier": "ConsulRegistryServiceImplTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUnregister() throws Exception {\n RegistryService registryService = mock(ConsulRegistryServiceImpl.class);\n InetSocketAddress inetSocketAddress = new InetSocketAddress(\"127.0.0.1\", 8091);\n registryService.unregister(inetSocketAddress);\n verify(reg...
{ "fields": [ { "declarator": "instance", "modifier": "private static volatile", "original_string": "private static volatile ConsulRegistryServiceImpl instance;", "type": "ConsulRegistryServiceImpl", "var_name": "instance" }, { "declarator": "client", "modifier": ...
{ "body": "@Override\n public void unregister(InetSocketAddress address) throws Exception {\n NetUtil.validAddress(address);\n getConsulClient().agentServiceDeregister(createServiceId(address));\n }", "class_method_signature": "ConsulRegistryServiceImpl.unregister(InetSocketAddress address)", ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_225
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/DataCompareUtilsTest.java", "identifier": "DataCompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isRecordsEquals() {\n TableMeta tableMeta = Mockito.mock(TableMeta.class);\n Mockito.when(tableMeta.getPrimaryKeyOnlyName()).thenReturn(Arrays.asList(new String[]{\"pk\"}));\n Mockito.when(tableMeta.getTableName()).thenReturn(\"table_name\");\n\n TableReco...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/DataCompareUtils.java", "identifier": "DataCompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "DataCompareUtils.DataCompareUtils()", "constructor": true, "full_signature": "private DataCom...
{ "body": "public static Result<Boolean> isRecordsEquals(TableRecords beforeImage, TableRecords afterImage) {\n if (beforeImage == null) {\n return Result.build(afterImage == null, null);\n } else {\n if (afterImage == null) {\n return Result.build(false, null);\n ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_209
{ "fields": [], "file": "rm-datasource/src/test/java/io/seata/rm/datasource/undo/oracle/OracleUndoDeleteExecutorTest.java", "identifier": "OracleUndoDeleteExecutorTest", "interfaces": "", "superclass": "extends BaseExecutorTest" }
{ "body": "@Test\n public void getUndoRows() {\n OracleUndoDeleteExecutor executor = upperCase();\n Assertions.assertEquals(executor.getUndoRows(), executor.getSqlUndoLog().getBeforeImage());\n }", "class_method_signature": "OracleUndoDeleteExecutorTest.getUndoRows()", "constructor": false, ...
{ "fields": [ { "declarator": "INSERT_SQL_TEMPLATE = \"INSERT INTO %s (%s) VALUES (%s)\"", "modifier": "private static final", "original_string": "private static final String INSERT_SQL_TEMPLATE = \"INSERT INTO %s (%s) VALUES (%s)\";", "type": "String", "var_name": "INSERT_SQL_TEMPLA...
{ "body": "@Override\n protected TableRecords getUndoRows() {\n return sqlUndoLog.getBeforeImage();\n }", "class_method_signature": "OracleUndoDeleteExecutor.getUndoRows()", "constructor": false, "full_signature": "@Override protected TableRecords getUndoRows()", "identifier": "getUndoRows", "i...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_120
{ "fields": [], "file": "common/src/test/java/io/seata/common/loader/EnhancedServiceLoaderTest.java", "identifier": "EnhancedServiceLoaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getSingletonExtensionInstance(){\n Hello hello1 = EnhancedServiceLoader.load(Hello.class, \"ChineseHello\");\n Hello hello2 = EnhancedServiceLoader.load(Hello.class, \"ChineseHello\");\n assertThat(hello1 == hello2).isTrue();\n }", "class_method_signature": ...
{ "fields": [], "file": "common/src/main/java/io/seata/common/loader/EnhancedServiceLoader.java", "identifier": "EnhancedServiceLoader", "interfaces": "", "methods": [ { "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor": false, "f...
{ "body": "public static <S> S load(Class<S> service, ClassLoader loader) throws EnhancedServiceNotFoundException {\n return InnerEnhancedServiceLoader.getServiceLoader(service).load(loader);\n }", "class_method_signature": "EnhancedServiceLoader.load(Class<S> service, ClassLoader loader)", "constructor...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_60
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImplTest.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImplTest.class);", "type": "Logger", "var_n...
{ "body": "@Test\n void onRollbackFailure() throws Exception {\n\n\n RootContext.bind(DEFAULT_XID);\n GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();\n FailureHandler failureHandler = new DefaultFailureHandlerImpl();\n failureHandler.onRollbackFailure(tx, new MyRun...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImpl.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFailureHandlerImpl.class);", "type": "Logger", "var_name": "L...
{ "body": "@Override\n public void onRollbackFailure(GlobalTransaction tx, Throwable originalException) {\n LOGGER.warn(\"Failed to rollback transaction[\" + tx.getXid() + \"]\", originalException);\n timer.newTimeout(new CheckTimerTask(tx, GlobalStatus.Rollbacked), SCHEDULE_INTERVAL_SECONDS, TimeUni...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_177
{ "fields": [ { "declarator": "returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\")", "modifier": "private static", "original_string": "private static List<String> returnValueColumnLabels = Lists.newArrayList(\"id\", \"name\");", "type": "List<String>", "var_name": "returnV...
{ "body": "@Test\n public void testExecute() throws SQLException {\n String sql = \"select * from table_statment_proxy\";\n Assertions.assertNotNull(statementProxy.executeQuery(sql));\n Assertions.assertDoesNotThrow(() -> statementProxy.executeUpdate(sql));\n Assertions.assertDoesNotThr...
{ "fields": [], "file": "rm-datasource/src/main/java/io/seata/rm/datasource/StatementProxy.java", "identifier": "StatementProxy", "interfaces": "", "methods": [ { "class_method_signature": "StatementProxy.StatementProxy(AbstractConnectionProxy connectionWrapper, T targetStatement, String targetSQL)"...
{ "body": "@Override\n public boolean execute(String sql) throws SQLException {\n this.targetSQL = sql;\n return ExecuteTemplate.execute(this, (statement, args) -> statement.execute((String) args[0]), sql);\n }", "class_method_signature": "StatementProxy.execute(String sql)", "constructor": fa...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_37
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalRollbackRequestConvertorTest.java", "identifier": "GlobalRollbackRequestConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n GlobalRollbackRequest globalRollbackRequest = new GlobalRollbackRequest();\n globalRollbackRequest.setExtraData(\"extraData\");\n globalRollbackRequest.setXid(\"xid\");\n\n GlobalRollbackRequestConvertor convertor = new GlobalRollback...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalRollbackRequestConvertor.java", "identifier": "GlobalRollbackRequestConvertor", "interfaces": "implements PbConvertor<GlobalRollbackRequest, GlobalRollbackRequestProto>", "methods": [ {...
{ "body": "@Override\n public GlobalRollbackRequestProto convert2Proto(GlobalRollbackRequest globalRollbackRequest) {\n final short typeCode = globalRollbackRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTy...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_198
{ "fields": [ { "declarator": "columnMetas =\n new Object[][] {\n new Object[] {\"\", \"\", \"table_records_test\", \"id\", Types.INTEGER, \"INTEGER\", 64, 0, 10, 1, \"\", \"\", 0, 0, 64, 1, \"NO\", \"YES\"},\n new Object[] {\"\", \"\", \"table_records_test\", \"name\", Types.VA...
{ "body": "@Test\n public void testEmpty() {\n TableRecords.EmptyTableRecords emptyTableRecords = new TableRecords.EmptyTableRecords();\n Assertions.assertEquals(0, emptyTableRecords.size());\n\n TableRecords empty = TableRecords.empty(new TableMeta());\n\n Assertions.assertEquals(0, em...
{ "fields": [ { "declarator": "tableMeta", "modifier": "private transient", "original_string": "private transient TableMeta tableMeta;", "type": "TableMeta", "var_name": "tableMeta" }, { "declarator": "tableName", "modifier": "private", "original_string": "p...
{ "body": "public static TableRecords empty(TableMeta tableMeta) {\n return new EmptyTableRecords(tableMeta);\n }", "class_method_signature": "TableRecords.empty(TableMeta tableMeta)", "constructor": false, "full_signature": "public static TableRecords empty(TableMeta tableMeta)", "identifier": "emp...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_161
{ "fields": [ { "declarator": "parameterParser = null", "modifier": "private static", "original_string": "private static ParameterParser parameterParser = null;", "type": "ParameterParser", "var_name": "parameterParser" } ], "file": "server/src/test/java/io/seata/server/Param...
{ "body": "@Test\n public void testEmptyMode() {\n String[] args = new String[] {\"-h\", \"127.0.0.1\", \"-p\", \"8088\"};\n parameterParser = new ParameterParser(args);\n //always set store.mode=file in test/resource/file.conf, if not will cause SessionStoreTest's case fail.\n Assertio...
{ "fields": [ { "declarator": "PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows)\"", "modifier": "private static final", "original_string": "private static final String PROGRAM_NAME\n = \"sh seata-server.sh(for linux and mac) or cmd seata...
{ "body": "public String getStoreMode() {\n return storeMode;\n }", "class_method_signature": "ParameterParser.getStoreMode()", "constructor": false, "full_signature": "public String getStoreMode()", "identifier": "getStoreMode", "invocations": [], "modifiers": "public", "parameters": "()", ...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_21
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/test/java/io/seata/serializer/protobuf/convertor/GlobalStatusRequestConvertorTest.java", "identifier": "GlobalStatusRequestConvertorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void convert2Proto() {\n\n GlobalStatusRequest globalStatusRequest = new GlobalStatusRequest();\n globalStatusRequest.setExtraData(\"extraData\");\n globalStatusRequest.setXid(\"xid\");\n GlobalStatusRequestConvertor convertor = new GlobalStatusRequestConvertor...
{ "fields": [], "file": "serializer/seata-serializer-protobuf/src/main/java/io/seata/serializer/protobuf/convertor/GlobalStatusRequestConvertor.java", "identifier": "GlobalStatusRequestConvertor", "interfaces": "implements PbConvertor<GlobalStatusRequest, GlobalStatusRequestProto>", "methods": [ { "...
{ "body": "@Override\n public GlobalStatusRequestProto convert2Proto(GlobalStatusRequest globalStatusRequest) {\n final short typeCode = globalStatusRequest.getTypeCode();\n\n final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(\n MessageTypeProto....
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_136
{ "fields": [ { "declarator": "localTCCRemotingParser = new LocalTCCRemotingParser()", "modifier": "", "original_string": "LocalTCCRemotingParser localTCCRemotingParser = new LocalTCCRemotingParser();", "type": "LocalTCCRemotingParser", "var_name": "localTCCRemotingParser" } ],...
{ "body": "@Test\n public void testReferenceParser(){\n TccActionImpl tccAction = new TccActionImpl();\n\n boolean result = localTCCRemotingParser.isReference(tccAction, \"b\");\n Assertions.assertTrue(result);\n }", "class_method_signature": "LocalTCCRemotingParserTest.testReferenceParse...
{ "fields": [], "file": "tcc/src/main/java/io/seata/rm/tcc/remoting/parser/LocalTCCRemotingParser.java", "identifier": "LocalTCCRemotingParser", "interfaces": "", "methods": [ { "class_method_signature": "LocalTCCRemotingParser.isReference(Object bean, String beanName)", "constructor": false, ...
{ "body": "@Override\n public boolean isReference(Object bean, String beanName) {\n Class<?> classType = bean.getClass();\n Set<Class<?>> interfaceClasses = ReflectionUtil.getInterfaces(classType);\n for (Class<?> interClass : interfaceClasses) {\n if (interClass.isAnnotationPresent...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_99
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/IOUtilTest.java", "identifier": "IOUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCloseWithArrayParameter() {\n FakeResource resource1 = new FakeResource();\n FakeResource resource2 = new FakeResource();\n\n IOUtil.close(resource1, resource2);\n\n Assertions.assertTrue(resource1.isClose());\n Assertions.assertTrue(resource2.i...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/IOUtil.java", "identifier": "IOUtil", "interfaces": "", "methods": [ { "class_method_signature": "IOUtil.close(AutoCloseable... closeables)", "constructor": false, "full_signature": "public static void close(AutoCloseable...
{ "body": "public static void close(AutoCloseable... closeables) {\n if (CollectionUtils.isNotEmpty(closeables)) {\n for (AutoCloseable closeable : closeables) {\n close(closeable);\n }\n }\n }", "class_method_signature": "IOUtil.close(AutoCloseable... closeable...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_76
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testInvokeMethod3() throws NoSuchMethodException,\n IllegalAccessException, InvocationTargetException {\n Assertions.assertEquals(\"0\", ReflectionUtil.invokeStaticMethod(\n String.class, \"valueOf\",\n new Class<?>[]{int.class}, new Ob...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static Object invokeStaticMethod(Class<?> targetClass, String methodName, Class<?>[] parameterTypes,\n Object[] parameterValues)\n throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException,\n InvocationT...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_137
{ "fields": [ { "declarator": "localTCCRemotingParser = new LocalTCCRemotingParser()", "modifier": "", "original_string": "LocalTCCRemotingParser localTCCRemotingParser = new LocalTCCRemotingParser();", "type": "LocalTCCRemotingParser", "var_name": "localTCCRemotingParser" } ],...
{ "body": "@Test\n public void testServiceDesc(){\n TccActionImpl tccAction = new TccActionImpl();\n\n RemotingDesc remotingDesc = localTCCRemotingParser.getServiceDesc(tccAction, \"c\");\n Assertions.assertNotNull(remotingDesc);\n\n Assertions.assertEquals(remotingDesc.getInterfaceClas...
{ "fields": [], "file": "tcc/src/main/java/io/seata/rm/tcc/remoting/parser/LocalTCCRemotingParser.java", "identifier": "LocalTCCRemotingParser", "interfaces": "", "methods": [ { "class_method_signature": "LocalTCCRemotingParser.isReference(Object bean, String beanName)", "constructor": false, ...
{ "body": "@Override\n public RemotingDesc getServiceDesc(Object bean, String beanName) throws FrameworkException {\n if (!this.isRemoting(bean, beanName)) {\n return null;\n }\n RemotingDesc remotingDesc = new RemotingDesc();\n remotingDesc.setReference(true);\n remot...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_98
{ "fields": [], "file": "common/src/test/java/io/seata/common/util/IOUtilTest.java", "identifier": "IOUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCloseWithSingleParameter() {\n FakeResource resource = new FakeResource();\n\n IOUtil.close(resource);\n\n Assertions.assertTrue(resource.isClose());\n }", "class_method_signature": "IOUtilTest.testCloseWithSingleParameter()", "constructor": false, "...
{ "fields": [], "file": "common/src/main/java/io/seata/common/util/IOUtil.java", "identifier": "IOUtil", "interfaces": "", "methods": [ { "class_method_signature": "IOUtil.close(AutoCloseable... closeables)", "constructor": false, "full_signature": "public static void close(AutoCloseable...
{ "body": "public static void close(AutoCloseable... closeables) {\n if (CollectionUtils.isNotEmpty(closeables)) {\n for (AutoCloseable closeable : closeables) {\n close(closeable);\n }\n }\n }", "class_method_signature": "IOUtil.close(AutoCloseable... closeable...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...
163387337_77
{ "fields": [ { "declarator": "testValue = (null != null ? \"hello\" : \"hello\")", "modifier": "public static final", "original_string": "public static final String testValue = (null != null ? \"hello\" : \"hello\");", "type": "String", "var_name": "testValue" } ], "file": "...
{ "body": "@Test\n public void testGetMethod() throws NoSuchMethodException {\n Assertions.assertEquals(\"public int java.lang.String.length()\",\n ReflectionUtil.getMethod(String.class, \"length\", null)\n .toString());\n Assertions.assertEquals(\"public char ja...
{ "fields": [ { "declarator": "MAX_NEST_DEPTH = 20", "modifier": "public static final", "original_string": "public static final int MAX_NEST_DEPTH = 20;", "type": "int", "var_name": "MAX_NEST_DEPTH" } ], "file": "common/src/main/java/io/seata/common/util/ReflectionUtil.java",...
{ "body": "public static Method getMethod(Class<?> classType, String methodName, Class<?>[] parameterTypes)\n throws NoSuchMethodException, SecurityException {\n return classType.getMethod(methodName, parameterTypes);\n }", "class_method_signature": "ReflectionUtil.getMethod(Class<?> classType, Str...
{ "created": "12/28/2018 8:37:22 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 163387337, "size": null, "stargazer_count": null, "stars": 14069, "updates": "2020-01-27T16:13:33+00:00", "url": "https://github.com/seata/seata"...