id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
198220069_34
{ "fields": [ { "declarator": "message = new BrokerMessage()", "modifier": "private", "original_string": "private BrokerMessage message = new BrokerMessage();", "type": "BrokerMessage", "var_name": "message" } ], "file": "joyqueue-server/joyqueue-broker-core/src/test/java/org...
{ "body": "@Test\n public void readPartition() throws Exception {\n message.setPartition((short) 1);\n message.setClientIp(IpUtil.toByte(new InetSocketAddress(50088)));\n message.setText(\"text\");\n message.setAttribute(\"Test\",\"TestTest\");\n message.setExtension(\"Test\".get...
{ "fields": [ { "declarator": "BYTE_SIZE = 1", "modifier": "private static final", "original_string": "private static final byte BYTE_SIZE = 1;", "type": "byte", "var_name": "BYTE_SIZE" }, { "declarator": "SHORT_SIZE = 2", "modifier": "private static final", ...
{ "body": "public static short readPartition(ByteBuffer byteBuffer) {\n ByteBuffer slice = byteBuffer.slice();\n slice.position(4);\n short partition = slice.getShort();\n\n return partition;\n }", "class_method_signature": "Serializer.readPartition(ByteBuffer byteBuffer)", "constru...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_14
{ "fields": [], "file": "joyqueue-server/joyqueue-broker-core/src/test/java/org/joyqueue/broker/archive/ArchiveSerializerTest.java", "identifier": "ArchiveSerializerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void read() {\n ConsumeLog consumeLog = new ConsumeLog();\n consumeLog.setApp(\"app_test\");\n consumeLog.setBrokerId(1);\n consumeLog.setClientIp(new byte[16]);\n consumeLog.setBytesMessageId(new byte[16]);\n consumeLog.setConsumeTime(SystemClock...
{ "fields": [ { "declarator": "byteBufferPool = new ByteBufferPool()", "modifier": "private static", "original_string": "private static ByteBufferPool byteBufferPool = new ByteBufferPool();", "type": "ByteBufferPool", "var_name": "byteBufferPool" } ], "file": "joyqueue-server...
{ "body": "public static ConsumeLog read(ByteBuffer buffer) {\n ConsumeLog log = new ConsumeLog();\n\n byte[] byteMessageId = new byte[16];\n buffer.get(byteMessageId);\n log.setBytesMessageId(byteMessageId);\n\n log.setBrokerId(buffer.getInt());\n\n byte[] clientIp = new byt...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_3
{ "fields": [], "file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/security/EncryptTest.java", "identifier": "EncryptTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMd5() throws GeneralSecurityException {\n String source = \"123456789\";\n String encode = Encrypt.encrypt(source, null, Md5.INSTANCE);\n Assert.assertEquals(encode, \"25F9E794323B453885F5181F1B624D0B\");\n }", "class_method_signature": "EncryptTest.test...
{ "fields": [ { "declarator": "DEFAULT_KEY = \"www.jd.com\"", "modifier": "public static final", "original_string": "public static final String DEFAULT_KEY = \"www.jd.com\";", "type": "String", "var_name": "DEFAULT_KEY" } ], "file": "joyqueue-common/joyqueue-toolkit/src/main/...
{ "body": "public static String encrypt(final String source, final String key, final Encryptor encryptor) throws\n GeneralSecurityException {\n return encrypt(source, key, encryptor, Charsets.UTF_8);\n }", "class_method_signature": "Encrypt.encrypt(final String source, final String key, final E...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_43
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PartitionGroupStoreManagerTest.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PartitionGroupStoreManagerTest.class);", "type": "Logger", "var...
{ "body": "@Test\n public void getIndexTest() throws InterruptedException, IOException {\n long timeout = 500000L;\n List<ByteBuffer> msgs = MessageUtils.build(20, 255);\n long startTime = SystemClock.now();\n short partition = partitions[0];\n final EventFuture<WriteResult> futu...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PartitionGroupStoreManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PartitionGroupStoreManager.class);", "type": "Logger", "var_name": ...
{ "body": "public long getIndex(short partition, long timestamp) {\n\n try {\n if (partitionMap.containsKey(partition)) {\n PositioningStore<IndexItem> indexStore = partitionMap.get(partition).store;\n long searchedIndex = binarySearchByTimestamp(timestamp, store, index...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_38
{ "fields": [ { "declarator": "nameServiceStub", "modifier": "private", "original_string": "private NameServiceStub nameServiceStub;", "type": "NameServiceStub", "var_name": "nameServiceStub" }, { "declarator": "brokerEventBusStub", "modifier": "private", "o...
{ "body": "@Test\n public void getTopicConfigCacheTest() {\n long total = clusterNameServiceStub.getTotal();\n this.propertySupplierMap.put(ClusterConfigKey.GET_TOPIC_DYNAMIC_METADATA_CACHE_ENABLE.getName(), true);\n\n TopicConfig topicConfig = clusterNameServiceStub.getTopicConfig(TopicName.p...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ClusterNameService.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = LoggerFactory.getLogger(ClusterNameService.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public TopicConfig getTopicConfig(TopicName topicName) {\n TopicConfig topicConfig = nameService.getTopicConfig(topicName);\n if (topicConfig == null) {\n return null;\n }\n return doGetTopicConfig(topicConfig);\n }", "class_method_signature": "ClusterNameService...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_39
{ "fields": [ { "declarator": "nameServiceStub", "modifier": "private", "original_string": "private NameServiceStub nameServiceStub;", "type": "NameServiceStub", "var_name": "nameServiceStub" }, { "declarator": "brokerEventBusStub", "modifier": "private", "o...
{ "body": "@Test\n public void getTopicConfigsTest() {\n this.propertySupplierMap.put(ClusterConfigKey.GET_TOPIC_DYNAMIC_METADATA_CACHE_ENABLE.getName(), true);\n clusterNameServiceStub.setSleep(1000 * 1);\n\n List<String> topics = Lists.newLinkedList();\n for (int i = 2; i < 10; i++) {...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ClusterNameService.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = LoggerFactory.getLogger(ClusterNameService.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public Map<String, TopicConfig> getTopicConfigs(List<String> topics) {\n Map<String, TopicConfig> topicConfigMap = Maps.newHashMap();\n for (String topic : topics) {\n TopicConfig topicConfig = nameService.getTopicConfig(TopicName.parse(topic));\n if (topicConfig != null...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_2
{ "fields": [], "file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/reflect/ReflectTest.java", "identifier": "ReflectTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUpdate() throws NoSuchFieldException, ReflectException {\n Employee employee = new Employee();\n employee.setSalary(1);\n employee.setAge(25);\n employee.weight = 65;\n\n Field field1 = Person.class.getDeclaredField(\"age\");\n Field fiel...
{ "fields": [ { "declarator": "accessors = new ConcurrentHashMap<Field, FieldAccessor>()", "modifier": "private static", "original_string": "private static ConcurrentMap<Field, FieldAccessor> accessors = new ConcurrentHashMap<Field, FieldAccessor>();", "type": "ConcurrentMap<Field, FieldAc...
{ "body": "public static void set(final Field field, final Object target, final Object value) throws ReflectException {\n if (field == null || target == null) {\n return;\n }\n FieldAccessor accessor = getAccessor(field);\n if (accessor != null) {\n accessor.set(targe...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_42
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PartitionGroupStoreManagerTest.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PartitionGroupStoreManagerTest.class);", "type": "Logger", "var...
{ "body": "@Test\n public void rePartitionTest() throws Exception {\n int count = 1024;\n long timeout = 500000L;\n List<ByteBuffer> messages = MessageUtils.build(count, 1024);\n\n\n long length = messages.stream().mapToInt(Buffer::remaining).sum();\n WriteRequest [] writeRequest...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PartitionGroupStoreManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PartitionGroupStoreManager.class);", "type": "Logger", "var_name": ...
{ "body": "synchronized void rePartition(Short[] partitions) throws IOException {\n\n\n for (short partition : partitions) {\n if (!partitionMap.containsKey(partition)) {\n addPartition(partition);\n }\n }\n\n List<Short> partitionList = Arrays.asList(partitio...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_15
{ "fields": [ { "declarator": "conf = new Configuration()", "modifier": "private", "original_string": "private Configuration conf = new Configuration();", "type": "Configuration", "var_name": "conf" }, { "declarator": "electionConfig = new ElectionConfig(conf)", "...
{ "body": "@Test\n public void testElectionConfig() {\n long transferLeaderMinLag = electionConfig.getTransferLeaderMinLag();\n Assert.assertEquals(transferLeaderMinLag, ElectionConfigKey.TRANSFER_LEADER_MIN_LAG.getValue());\n\n int commandQueueSize = electionConfig.getCommandQueueSize();\n ...
{ "fields": [ { "declarator": "ELECTION_META_PATH =\"/election\"", "modifier": "public static final", "original_string": "public static final String ELECTION_META_PATH =\"/election\";", "type": "String", "var_name": "ELECTION_META_PATH" }, { "declarator": "electionMetaP...
{ "body": "public ElectionConfig(PropertySupplier propertySupplier) {\n this.propertySupplier = propertySupplier;\n }", "class_method_signature": "ElectionConfig.ElectionConfig(PropertySupplier propertySupplier)", "constructor": true, "full_signature": "public ElectionConfig(PropertySupplier property...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_35
{ "fields": [ { "declarator": "message = new BrokerMessage()", "modifier": "private", "original_string": "private BrokerMessage message = new BrokerMessage();", "type": "BrokerMessage", "var_name": "message" } ], "file": "joyqueue-server/joyqueue-broker-core/src/test/java/org...
{ "body": "@Test\n public void readIndex() throws Exception {\n message.setMsgIndexNo((short) 1000);\n message.setClientIp(IpUtil.toByte(new InetSocketAddress(50088)));\n message.setText(\"text\");\n message.setAttribute(\"Test\",\"TestTest\");\n message.setExtension(\"Test\".get...
{ "fields": [ { "declarator": "BYTE_SIZE = 1", "modifier": "private static final", "original_string": "private static final byte BYTE_SIZE = 1;", "type": "byte", "var_name": "BYTE_SIZE" }, { "declarator": "SHORT_SIZE = 2", "modifier": "private static final", ...
{ "body": "public static long readIndex(ByteBuffer byteBuffer) {\n ByteBuffer slice = byteBuffer.slice();\n slice.position(6);\n long index = slice.getLong();\n\n return index;\n }", "class_method_signature": "Serializer.readIndex(ByteBuffer byteBuffer)", "constructor": false, "fu...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_23
{ "fields": [ { "declarator": "localFileStore = new LocalFileStore()", "modifier": "private", "original_string": "private LocalFileStore localFileStore = new LocalFileStore();", "type": "LocalFileStore", "var_name": "localFileStore" }, { "declarator": "base", "mod...
{ "body": "@Test\n public void putIfAbsent() {\n put();\n\n localFileStore.putIfAbsent(consumePartition, new Position(1,1,1,1));\n\n Position positionVal = localFileStore.get(consumePartition);\n Assert.assertEquals(position, positionVal);\n }", "class_method_signature": "LocalFile...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)", "modifier": "private", "original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "fileUpd...
{ "body": "@Override\n public Position putIfAbsent(ConsumePartition key, Position value) {\n return consumePositionCache.putIfAbsent(key, value);\n }", "class_method_signature": "LocalFileStore.putIfAbsent(ConsumePartition key, Position value)", "constructor": false, "full_signature": "@Override pu...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_19
{ "fields": [ { "declarator": "localFileStore = new LocalFileStore()", "modifier": "private", "original_string": "private LocalFileStore localFileStore = new LocalFileStore();", "type": "LocalFileStore", "var_name": "localFileStore" }, { "declarator": "base", "mod...
{ "body": "@Test\n public void isStart() {\n boolean started = localFileStore.isStarted();\n Assert.assertEquals(true, started);\n }", "class_method_signature": "LocalFileStoreTest.isStart()", "constructor": false, "full_signature": "@Test public void isStart()", "identifier": "isStart", ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)", "modifier": "private", "original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "fileUpd...
{ "body": "@Override\n public boolean isStarted() {\n return isStarted.get();\n }", "class_method_signature": "LocalFileStore.isStarted()", "constructor": false, "full_signature": "@Override public boolean isStarted()", "identifier": "isStarted", "invocations": [ "get" ], "modifiers": "...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_36
{ "fields": [ { "declarator": "message = new BrokerMessage()", "modifier": "private", "original_string": "private BrokerMessage message = new BrokerMessage();", "type": "BrokerMessage", "var_name": "message" } ], "file": "joyqueue-server/joyqueue-broker-core/src/test/java/org...
{ "body": "@Test\n public void readSendTime() throws Exception {\n message.setStartTime(100l);\n message.setClientIp(IpUtil.toByte(new InetSocketAddress(50088)));\n message.setText(\"text\");\n message.setAttribute(\"Test\",\"TestTest\");\n message.setExtension(\"Test\".getBytes(...
{ "fields": [ { "declarator": "BYTE_SIZE = 1", "modifier": "private static final", "original_string": "private static final byte BYTE_SIZE = 1;", "type": "byte", "var_name": "BYTE_SIZE" }, { "declarator": "SHORT_SIZE = 2", "modifier": "private static final", ...
{ "body": "public static long readSendTime(ByteBuffer byteBuffer) {\n ByteBuffer slice = byteBuffer.slice();\n slice.position(39);\n long sendTime = slice.getLong();\n\n return sendTime;\n }", "class_method_signature": "Serializer.readSendTime(ByteBuffer byteBuffer)", "constructor":...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_20
{ "fields": [ { "declarator": "localFileStore = new LocalFileStore()", "modifier": "private", "original_string": "private LocalFileStore localFileStore = new LocalFileStore();", "type": "LocalFileStore", "var_name": "localFileStore" }, { "declarator": "base", "mod...
{ "body": "@Test\n public void get() {\n localFileStore.put(consumePartition, position);\n\n Position position1 = localFileStore.get(consumePartition);\n\n Assert.assertEquals(position, position1);\n }", "class_method_signature": "LocalFileStoreTest.get()", "constructor": false, "full...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)", "modifier": "private", "original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "fileUpd...
{ "body": "@Override\n public Position get(ConsumePartition key) {\n return consumePositionCache.get(key);\n }", "class_method_signature": "LocalFileStore.get(ConsumePartition key)", "constructor": false, "full_signature": "@Override public Position get(ConsumePartition key)", "identifier": "get"...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_41
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PartitionGroupStoreManagerTest.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PartitionGroupStoreManagerTest.class);", "type": "Logger", "var...
{ "body": "@Test\n @Ignore\n public void readPerformanceTest() throws Exception {\n short[] partitions = new short[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n Short [] p = new Short[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n store.rePartition(p);\n writePerformanceTest(5L * 1024 * 1024 * 1024, 1024,...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PartitionGroupStoreManager.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PartitionGroupStoreManager.class);", "type": "Logger", "var_name": ...
{ "body": "synchronized void rePartition(Short[] partitions) throws IOException {\n\n\n for (short partition : partitions) {\n if (!partitionMap.containsKey(partition)) {\n addPartition(partition);\n }\n }\n\n List<Short> partitionList = Arrays.asList(partitio...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_1
{ "fields": [], "file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/network/IpUtilTest.java", "identifier": "IpUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void showDefaultLocalIp() {\n System.out.println(IpUtil.getLocalIp());\n }", "class_method_signature": "IpUtilTest.showDefaultLocalIp()", "constructor": false, "full_signature": "@Test public void showDefaultLocalIp()", "identifier": "showDefaultLocalIp", "invocations"...
{ "fields": [ { "declarator": "IPV4_PORT_SEPARATOR = \":\"", "modifier": "public static", "original_string": "public static String IPV4_PORT_SEPARATOR = \":\";", "type": "String", "var_name": "IPV4_PORT_SEPARATOR" }, { "declarator": "IPV6_PORT_SEPARATOR = \"_\"", ...
{ "body": "public static String getLocalIp(final String nic, final String manageIp) {\n List<String> ips = getLocalIps(nic, manageIp);\n if (ips != null && !ips.isEmpty()) {\n if (ips.size() == 1) {\n return ips.get(0);\n }\n if (!PREFER_IPV6) {\n ...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_16
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(RaftLeaderElectionTest.class)", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(RaftLeaderElectionTest.class);", "type": "Logger", "var_name": "logger" }, ...
{ "body": "@Test\n public void testChangeNode() throws Exception {\n List<Broker> allNodes = new LinkedList<>();\n for (int i = 0; i < NODE_NUM; i++) {\n allNodes.add(brokers[i]);\n }\n\n for (int i = 0; i < RAFT_ELECTION_NUM; i++) {\n storeServices[i].createPartit...
{ "fields": [ { "declarator": "INVALID_VOTE_FOR = -1", "modifier": "private final", "original_string": "private final int INVALID_VOTE_FOR = -1;", "type": "int", "var_name": "INVALID_VOTE_FOR" }, { "declarator": "logger = LoggerFactory.getLogger(RaftLeaderElection.class...
{ "body": "@Override\n public Collection<DefaultElectionNode> getAllNodes() {\n return allNodes.values();\n }", "class_method_signature": "RaftLeaderElection.getAllNodes()", "constructor": false, "full_signature": "@Override public Collection<DefaultElectionNode> getAllNodes()", "identifier": "ge...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_17
{ "fields": [ { "declarator": "partitionLockInstance = new PartitionLockInstance()", "modifier": "final", "original_string": "final PartitionLockInstance partitionLockInstance = new PartitionLockInstance();", "type": "PartitionLockInstance", "var_name": "partitionLockInstance" },...
{ "body": "@Test\n public void getLockInstance() {\n ConsumePartition lockInstance = partitionLockInstance.getLockInstance(topic, app, partition);\n ConsumePartition lockInstance2 = partitionLockInstance.getLockInstance(topic, app, partition);\n\n Assert.assertEquals(lockInstance, lockInstance...
{ "fields": [ { "declarator": "partitionLockCache = new ConcurrentHashMap<>()", "modifier": "private", "original_string": "private ConcurrentMap<ConsumePartition, ConsumePartition> partitionLockCache = new ConcurrentHashMap<>();", "type": "ConcurrentMap<ConsumePartition, ConsumePartition>"...
{ "body": "public ConsumePartition getLockInstance(String topic, String app, short partition) {\n ConsumePartition consumePartition = new ConsumePartition(topic, app, partition);\n return getLockInstance(consumePartition);\n }", "class_method_signature": "PartitionLockInstance.getLockInstance(Strin...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_40
{ "fields": [ { "declarator": "nameServiceStub", "modifier": "private", "original_string": "private NameServiceStub nameServiceStub;", "type": "NameServiceStub", "var_name": "nameServiceStub" }, { "declarator": "brokerEventBusStub", "modifier": "private", "o...
{ "body": "@Test\n public void getTopicConfigTest() {\n clusterNameServiceStub.setRemoteResult(false);\n TopicConfig topicConfig = clusterNameServiceStub.getTopicConfig(TopicName.parse(\"test2\"));\n Assert.assertEquals(1, (int) topicConfig.getPartitionGroups().get(0).getLeader());\n As...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ClusterNameService.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = LoggerFactory.getLogger(ClusterNameService.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public TopicConfig getTopicConfig(TopicName topicName) {\n TopicConfig topicConfig = nameService.getTopicConfig(topicName);\n if (topicConfig == null) {\n return null;\n }\n return doGetTopicConfig(topicConfig);\n }", "class_method_signature": "ClusterNameService...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_0
{ "fields": [], "file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/os/SystemsTest.java", "identifier": "SystemsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetCores() throws IOException {\n System.out.println(Systems.getCores());\n Systems.JDOS1CoresDetector.ETC_CONFIG_INFO = \"\";\n File file = File.createTempFile(\"config_info\", \"\");\n Files.write(file,\n \"{\\\"Config\\\": {\\\"Cpuset...
{ "fields": [ { "declarator": "USER_HOME = \"user.home\"", "modifier": "public static final", "original_string": "public static final String USER_HOME = \"user.home\";", "type": "String", "var_name": "USER_HOME" }, { "declarator": "OS_NAME = \"os.name\"", "modifie...
{ "body": "public static int getCores() {\n int cores;\n for (CoresDetector detector : coresDetectors) {\n cores = detector.getCores();\n if (cores != CoresDetector.UNKNOWN)\n return cores;\n }\n return CoresDetector.UNKNOWN;\n }", "class_method_si...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_21
{ "fields": [ { "declarator": "localFileStore = new LocalFileStore()", "modifier": "private", "original_string": "private LocalFileStore localFileStore = new LocalFileStore();", "type": "LocalFileStore", "var_name": "localFileStore" }, { "declarator": "base", "mod...
{ "body": "@Test\n public void put() {\n get();\n }", "class_method_signature": "LocalFileStoreTest.put()", "constructor": false, "full_signature": "@Test public void put()", "identifier": "put", "invocations": [ "get" ], "modifiers": "@Test public", "parameters": "()", "return": "v...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(LocalFileStore.class)", "modifier": "private", "original_string": "private Logger logger = LoggerFactory.getLogger(LocalFileStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "fileUpd...
{ "body": "@Override\n public void put(ConsumePartition key, Position value) {\n consumePositionCache.put(key, value);\n }", "class_method_signature": "LocalFileStore.put(ConsumePartition key, Position value)", "constructor": false, "full_signature": "@Override public void put(ConsumePartition key,...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_37
{ "fields": [ { "declarator": "nameServiceStub", "modifier": "private", "original_string": "private NameServiceStub nameServiceStub;", "type": "NameServiceStub", "var_name": "nameServiceStub" }, { "declarator": "brokerEventBusStub", "modifier": "private", "o...
{ "body": "@Test\n public void clusterNodeChangeTest() {\n Assert.assertEquals(null, clusterNameServiceStub.getTopicConfig(TopicName.parse(\"test0\")));\n Assert.assertEquals(-1, (int) clusterNameServiceStub.getTopicConfig(TopicName.parse(\"test1\")).getPartitionGroups().get(0).getLeader());\n\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(ClusterNameService.class)", "modifier": "protected static final", "original_string": "protected static final Logger logger = LoggerFactory.getLogger(ClusterNameService.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "public TopicConfig getTopicConfig(TopicName topicName) {\n TopicConfig topicConfig = nameService.getTopicConfig(topicName);\n if (topicConfig == null) {\n return null;\n }\n return doGetTopicConfig(topicConfig);\n }", "class_method_signature": "ClusterNameService...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_47
{ "fields": [], "file": "joyqueue-server/joyqueue-retry/joyqueue-retry-api/src/test/java/org/joyqueue/server/retry/util/RetrySerializerUtilTest.java", "identifier": "RetrySerializerUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void deserialize() {\n serialize();\n }", "class_method_signature": "RetrySerializerUtilTest.deserialize()", "constructor": false, "full_signature": "@Test public void deserialize()", "identifier": "deserialize", "invocations": [ "serialize" ], "modifiers": "@T...
{ "fields": [], "file": "joyqueue-server/joyqueue-retry/joyqueue-retry-api/src/main/java/org/joyqueue/server/retry/util/RetrySerializerUtil.java", "identifier": "RetrySerializerUtil", "interfaces": "", "methods": [ { "class_method_signature": "RetrySerializerUtil.deserialize(ByteBuf buffer)", ...
{ "body": "public static RetryMessageModel deserialize(ByteBuf buffer) {\n RetryMessageModel retryMessageModel = new RetryMessageModel();\n\n short buzIdLen = buffer.readShort();\n if (buzIdLen > 0) {\n byte[] buzId = new byte[buzIdLen];\n buffer.readBytes(buzId);\n ...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_7
{ "fields": [ { "declarator": "executor = Executors.newFixedThreadPool(100)", "modifier": "", "original_string": "ExecutorService executor = Executors.newFixedThreadPool(100);", "type": "ExecutorService", "var_name": "executor" } ], "file": "joyqueue-common/joyqueue-toolkit/s...
{ "body": "@Test\n public void testTime()throws Exception {\n List<Future> futureList = new ArrayList();\n CountDownLatch latch = new CountDownLatch(100);\n for (int i = 0; i < 100; i++) {\n futureList.add(executor.submit(() -> {\n try{\n long time ...
{ "fields": [ { "declarator": "instance = new SystemClock()", "modifier": "private static final", "original_string": "private static final SystemClock instance = new SystemClock();", "type": "SystemClock", "var_name": "instance" }, { "declarator": "precision", "mo...
{ "body": "public static long now() {\n return instance.getTime();\n }", "class_method_signature": "SystemClock.now()", "constructor": false, "full_signature": "public static long now()", "identifier": "now", "invocations": [ "getTime" ], "modifiers": "public static", "parameters": "()",...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_10
{ "fields": [ { "declarator": "host=\"127.0.0.1:50091\"", "modifier": "private static final", "original_string": "private static final String host=\"127.0.0.1:50091\";", "type": "String", "var_name": "host" }, { "declarator": "topic=\"test_topic_11\"", "modifier":...
{ "body": "@Test\n public void publish() throws Exception{\n TopicAdmin.PublishArg pubSubArg=new TopicAdmin.PublishArg();\n pubSubArg.subscribe.topic=topic;\n pubSubArg.subscribe.app=app;\n pubSubArg.subscribe.type=(int) Subscription.Type.PRODUCTION.getValue();\n String result=cl...
{ "fields": [ { "declarator": "logger= LoggerFactory.getLogger(AdminClient.class)", "modifier": "private", "original_string": "private Logger logger= LoggerFactory.getLogger(AdminClient.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "DELAY_MS=100", ...
{ "body": "@Override\n public String publish(TopicAdmin.PublishArg pubSubArg) throws Exception{\n pubSubArg.host=host;\n try {\n String result= topicAdmin.publish(pubSubArg, null);\n hostProvider.onConnected();\n return result;\n }catch (Exception e){\n ...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_30
{ "fields": [ { "declarator": "delayHandler = new DelayHandler()", "modifier": "private", "original_string": "private DelayHandler delayHandler = new DelayHandler();", "type": "DelayHandler", "var_name": "delayHandler" } ], "file": "joyqueue-server/joyqueue-broker-core/src/te...
{ "body": "@Test\n public void handle() {\n // Consumer.ConsumerPolicy consumerPolicy, List<ByteBuffer> byteBufferList\n Consumer.ConsumerPolicy consumerPolicy = new Consumer.ConsumerPolicy();\n consumerPolicy.setDelay(1);\n\n List<ByteBuffer> byteBufferList = new LinkedList<>();\n\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(DelayHandler.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(DelayHandler.class);", "type": "Logger", "var_name": "logger" } ], "file": "joyqueue-se...
{ "body": "public List<ByteBuffer> handle(Consumer.ConsumerPolicy consumerPolicy, List<ByteBuffer> byteBufferList) {\n if (needDelay(consumerPolicy)) {\n return filterLayerMsg(consumerPolicy, byteBufferList);\n }\n return byteBufferList;\n }", "class_method_signature": "DelayHandl...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_26
{ "fields": [ { "declarator": "PATH = \"position_store\"", "modifier": "private final static", "original_string": "private final static String PATH = \"position_store\";", "type": "String", "var_name": "PATH" }, { "declarator": "base", "modifier": "private", ...
{ "body": "@Test\n public void getPositionFile() {\n File positionFile = config.getPositionFile();\n String absolutePath = positionFile.getPath();\n Assert.assertEquals(new File(base, \"index\").getAbsolutePath(), absolutePath);\n }", "class_method_signature": "PositionConfigTest.getPosit...
{ "fields": [ { "declarator": "BACK_SUFFIX = \".1\"", "modifier": "public static", "original_string": "public static String BACK_SUFFIX = \".1\";", "type": "String", "var_name": "BACK_SUFFIX" }, { "declarator": "positionFile", "modifier": "private", "origina...
{ "body": "public File getPositionFile() {\n return positionFile;\n }", "class_method_signature": "PositionConfig.getPositionFile()", "constructor": false, "full_signature": "public File getPositionFile()", "identifier": "getPositionFile", "invocations": [], "modifiers": "public", "parameters"...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_27
{ "fields": [ { "declarator": "consumer = Mockito.mock(Consumer.class)", "modifier": "final", "original_string": "final Consumer consumer = Mockito.mock(Consumer.class);", "type": "Consumer", "var_name": "consumer" }, { "declarator": "clusterManager = Mockito.mock(Clust...
{ "body": "@Test\n public void filter() throws JoyQueueException {\n // Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback\n List<ByteBuffer> byteBufferList = new LinkedList<>();\n for (int i = 0; i < 10; i++) {\n ByteBuffer allocate = ByteBuffer.allocate...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(FilterMessageSupport.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(FilterMessageSupport.class);", "type": "Logger", "var_name": "logger" }, { ...
{ "body": "public List<ByteBuffer> filter(Consumer consumer, List<ByteBuffer> byteBuffers, FilterCallback filterCallback) throws JoyQueueException {\n FilterPipeline<MessageFilter> filterPipeline = filterRuleCache.get(consumer.getId());\n if (filterPipeline == null) {\n filterPipeline = creat...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_31
{ "fields": [], "file": "joyqueue-server/joyqueue-broker-core/src/test/java/org/joyqueue/broker/consumer/AcknowledgeSupportTest.java", "identifier": "AcknowledgeSupportTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void sortMsgLocation() {\n String topic = \"topic\";\n short app = 1;\n List<MessageLocation> list = new ArrayList<>();\n for (int i = 0; i < 7; i++) {\n MessageLocation messageLocation = new MessageLocation(topic, app, (long) i);\n list.a...
{ "fields": [], "file": "joyqueue-server/joyqueue-broker-core/src/main/java/org/joyqueue/broker/consumer/AcknowledgeSupport.java", "identifier": "AcknowledgeSupport", "interfaces": "", "methods": [ { "class_method_signature": "AcknowledgeSupport.sortMsgLocation(MessageLocation[] locationArr)", ...
{ "body": "public static long[] sortMsgLocation(MessageLocation[] locationArr) {\n // 原始长度\n int originalSize = locationArr.length;\n // 主题\n String topic = locationArr[0].getTopic();\n // 分区\n int partition = locationArr[0].getPartition();\n // 最小序号(用数组第一个元素的初始化,后续比较替...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_11
{ "fields": [ { "declarator": "host=\"127.0.0.1:50091\"", "modifier": "private static final", "original_string": "private static final String host=\"127.0.0.1:50091\";", "type": "String", "var_name": "host" }, { "declarator": "topic=\"test_topic_11\"", "modifier":...
{ "body": "@Test\n public void subscribe() throws Exception{\n TopicAdmin.SubscribeArg pubSubArg=new TopicAdmin.SubscribeArg();\n pubSubArg.subscribe.topic=topic;\n pubSubArg.subscribe.app=app;\n pubSubArg.subscribe.type=(int)Subscription.Type.CONSUMPTION.getValue();\n String res...
{ "fields": [ { "declarator": "logger= LoggerFactory.getLogger(AdminClient.class)", "modifier": "private", "original_string": "private Logger logger= LoggerFactory.getLogger(AdminClient.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "DELAY_MS=100", ...
{ "body": "@Override\n public String subscribe(TopicAdmin.SubscribeArg pubSubArg) throws Exception{\n pubSubArg.host=host;\n\n try {\n String result= topicAdmin.subscribe(pubSubArg,null);\n hostProvider.onConnected();\n return result;\n }catch (Exception e){\n...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_46
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PositioningStoreTest.class)", "modifier": "private static final", "original_string": "private static final Logger logger = LoggerFactory.getLogger(PositioningStoreTest.class);", "type": "Logger", "var_name": "logger" ...
{ "body": "@Test\n public void positionTest() throws Exception {\n PositioningStore.Config config = new PositioningStore.Config();\n VirtualThreadExecutor virtualThreadPool = new VirtualThreadExecutor(500, 100, 10, 1000, 4);\n PreloadBufferPool bufferPool = PreloadBufferPool.getInstance();\n ...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(PositioningStore.class)", "modifier": "private final", "original_string": "private final Logger logger = LoggerFactory.getLogger(PositioningStore.class);", "type": "Logger", "var_name": "logger" }, { "decla...
{ "body": "public long position(long position, int offsetCount) {\n\n long t0 = SystemClock.now();\n int offset = 0;\n long pos = position;\n if (pos < left()) {\n pos = left();\n } else if (pos > right()) {\n pos = right();\n } else if (left() < pos && ...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
198220069_6
{ "fields": [], "file": "joyqueue-common/joyqueue-toolkit/src/test/java/org/joyqueue/toolkit/concurrent/EventBusTest.java", "identifier": "EventBusTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEventBus() throws Exception {\n final AtomicInteger counter = new AtomicInteger(0);\n EventBus<Integer> eventBus = new EventBus<Integer>(null, new EventListener<Integer>() {\n @Override\n public void onEvent(Integer event) {\n co...
{ "fields": [ { "declarator": "listeners = new CopyOnWriteArrayList<EventListener<E>>()", "modifier": "protected", "original_string": "protected CopyOnWriteArrayList<EventListener<E>> listeners = new CopyOnWriteArrayList<EventListener<E>>();", "type": "CopyOnWriteArrayList<EventListener<E>...
{ "body": "public EventBus() {\n this(null, 0);\n }", "class_method_signature": "EventBus.EventBus()", "constructor": true, "full_signature": "public EventBus()", "identifier": "EventBus", "invocations": [], "modifiers": "public", "parameters": "()", "return": "", "signature": " EventBus(...
{ "created": "7/22/2019 12:34:59 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 198220069, "size": null, "stargazer_count": null, "stars": 93, "updates": "2020-01-20T03:17:51+00:00", "url": "https://github.com/chubaostream/jo...
49850704_24
{ "fields": [], "file": "hsweb-thirdparty/hsweb-thirdparty-ueditor/src/test/java/com/baidu/ueditor/define/MultiStateTest.java", "identifier": "MultiStateTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void toJSONString(){\n MultiState state=new MultiState(true);\n\n state.addState(new BaseState());\n state.putInfo(\"test\",1);\n state.putInfo(\"test\",\"1\");\n\n System.out.println(state.toJSONString());\n\n }", "class_method_signature": "MultiSt...
{ "fields": [ { "declarator": "state = false", "modifier": "private", "original_string": "private boolean state = false;", "type": "boolean", "var_name": "state" }, { "declarator": "info = null", "modifier": "private", "original_string": "private String info...
{ "body": "public String toJSONString() {\n\n String stateVal = this.isSuccess() ? AppInfo.getStateInfo(AppInfo.SUCCESS) : this.info;\n\n StringBuilder builder = new StringBuilder();\n\n builder.append(\"{\\\"state\\\": \\\"\").append(stateVal).append(\"\\\"\");\n\n //int\n this.int...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_12
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/FastBeanCopierTest.java", "identifier": "FastBeanCopierTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() throws InvocationTargetException, IllegalAccessException {\n Source source = new Source();\n source.setAge(100);\n source.setName(\"测试\");\n source.setIds(new String[]{\"1\", \"2\", \"3\"});\n source.setAge2(2);\n source.setBoy2(true);...
{ "fields": [ { "declarator": "CACHE = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<CacheKey, Copier> CACHE = new HashMap<>();", "type": "Map<CacheKey, Copier>", "var_name": "CACHE" }, { "declarator": "propertyUtils ...
{ "body": "public static <T, S> T copy(S source, T target, String... ignore) {\n return copy(source, target, DEFAULT_CONVERT, ignore);\n }", "class_method_signature": "FastBeanCopier.copy(S source, T target, String... ignore)", "constructor": false, "full_signature": "public static T copy(S source, T ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_6
{ "fields": [], "file": "hsweb-commons/hsweb-commons-entity/src/test/java/org/hswebframework/web/commons/entity/param/TermExpressionParserTest.java", "identifier": "TermExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDateSpace() {\n String expression = \"(name=测试 or age=10) and (birth btw \\\"2019-07-26 12:00:00, 2019-08-04 12:00:00\\\" or startTime <= '2019-08-04 12:00:00') and finishTime >= '2019-08-01 00:00:00'\";\n List<Term> terms = TermExpressionParser.parse(expression);\n...
{ "fields": [], "file": "hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/param/TermExpressionParser.java", "identifier": "TermExpressionParser", "interfaces": "", "methods": [ { "class_method_signature": "TermExpressionParser.parse(String expression)", "c...
{ "body": "public static List<Term> parse(String expression) {\n Query<?, QueryParamEntity> conditional = QueryParamEntity.newQuery();\n\n NestConditional<?> nest = null;\n\n // 字符容器\n char[] buf = new char[128];\n // 记录词项的长度, Arrays.copyOf使用\n byte len = 0;\n // 空格数量?...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_7
{ "fields": [], "file": "hsweb-commons/hsweb-commons-utils/src/test/java/org/hswebframework/web/ModuleUtilsTest.java", "identifier": "ModuleUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() {\n ModuleUtils.ModuleInfo moduleInfo = ModuleUtils.getModuleByClass(ModuleUtilsTest.class);\n Assert.assertNotNull(moduleInfo);\n Assert.assertFalse(moduleInfo.isNone());\n Assert.assertEquals(moduleInfo.getArtifactId(),\"hsweb-commons-utils\");\n ...
{ "fields": [ { "declarator": "classModuleInfoRepository", "modifier": "private final static", "original_string": "private final static Map<Class, ModuleInfo> classModuleInfoRepository;", "type": "Map<Class, ModuleInfo>", "var_name": "classModuleInfoRepository" }, { "de...
{ "body": "public static ModuleInfo getModuleByClass(Class type) {\n return classModuleInfoRepository.computeIfAbsent(type, ModuleUtils::parse);\n }", "class_method_signature": "ModuleUtils.getModuleByClass(Class type)", "constructor": false, "full_signature": "public static ModuleInfo getModuleByClas...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_13
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/FastBeanCopierTest.java", "identifier": "FastBeanCopierTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testMapArray() {\n Map<String, Object> data = new HashMap<>();\n data.put(\"colors\", Arrays.asList(\"RED\"));\n\n\n Target target = new Target();\n FastBeanCopier.copy(data, target);\n\n\n System.out.println(target);\n Assert.assertNotNull(t...
{ "fields": [ { "declarator": "CACHE = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<CacheKey, Copier> CACHE = new HashMap<>();", "type": "Map<CacheKey, Copier>", "var_name": "CACHE" }, { "declarator": "propertyUtils ...
{ "body": "public static <T, S> T copy(S source, T target, String... ignore) {\n return copy(source, target, DEFAULT_CONVERT, ignore);\n }", "class_method_signature": "FastBeanCopier.copy(S source, T target, String... ignore)", "constructor": false, "full_signature": "public static T copy(S source, T ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_14
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/FastBeanCopierTest.java", "identifier": "FastBeanCopierTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testProxy() {\n AtomicReference<Object> reference=new AtomicReference<>();\n\n ProxyTest test = (ProxyTest) Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(),\n new Class[]{ProxyTest.class}, (proxy, method, args) -> {\n if (meth...
{ "fields": [ { "declarator": "CACHE = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<CacheKey, Copier> CACHE = new HashMap<>();", "type": "Map<CacheKey, Copier>", "var_name": "CACHE" }, { "declarator": "propertyUtils ...
{ "body": "public static <T, S> T copy(S source, T target, String... ignore) {\n return copy(source, target, DEFAULT_CONVERT, ignore);\n }", "class_method_signature": "FastBeanCopier.copy(S source, T target, String... ignore)", "constructor": false, "full_signature": "public static T copy(S source, T ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_0
{ "fields": [], "file": "hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/test/java/org/hswebframework/web/dao/mybatis/builder/SqlParamParserTest.java", "identifier": "SqlParamParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseQueryParam() {\n Map<String, Object> queryParam = new LinkedHashMap<>();\n queryParam.put(\"name\", \"张三\");\n queryParam.put(\"name$like$or\", \"王五\");\n queryParam.put(\"and\", TestQueryEntity\n .builder()\n .name$l...
{ "fields": [], "file": "hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/builder/SqlParamParser.java", "identifier": "SqlParamParser", "interfaces": "", "methods": [ { "class_method_signature": "SqlParamParser.parseQueryParam(Object param)",...
{ "body": "public static QueryParamEntity parseQueryParam(Object param) {\n return new QueryParamParser().parse(param).get();\n }", "class_method_signature": "SqlParamParser.parseQueryParam(Object param)", "constructor": false, "full_signature": "public static QueryParamEntity parseQueryParam(Object p...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_18
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void stringTest() {\n\n Assert.assertTrue(CompareUtils.compare(\"20180101\", DateFormatter.fromString(\"20180101\")));\n\n Assert.assertTrue(CompareUtils.compare(1,\"1\"));\n\n Assert.assertTrue(CompareUtils.compare(\"1\", 1));\n\n Assert.assertTrue(CompareUtil...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_22
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void beanTest() {\n Date date = new Date();\n\n Assert.assertTrue(CompareUtils.compare(new TestBean(date), new TestBean(DateFormatter.toString(date, \"yyyy-MM-dd\"))));\n\n Assert.assertTrue(CompareUtils.compare(new TestBean(1), new TestBean(\"1\")));\n\n Asser...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_23
{ "fields": [ { "declarator": "tokenManager = new HashMapTwoFactorTokenManager()", "modifier": "", "original_string": "HashMapTwoFactorTokenManager tokenManager = new HashMapTwoFactorTokenManager();", "type": "HashMapTwoFactorTokenManager", "var_name": "tokenManager" } ], "fi...
{ "body": "@Test\n @SneakyThrows\n public void test() {\n TwoFactorToken twoFactorToken = tokenManager.getToken(\"test\", \"test\");\n\n Assert.assertTrue(twoFactorToken.expired());\n twoFactorToken.generate(1000L);\n Assert.assertFalse(twoFactorToken.expired());\n Thread.slee...
{ "fields": [ { "declarator": "tokens = new ConcurrentHashMap<>()", "modifier": "private", "original_string": "private Map<String, WeakReference<TwoFactorTokenInfo>> tokens = new ConcurrentHashMap<>();", "type": "Map<String, WeakReference<TwoFactorTokenInfo>>", "var_name": "tokens" ...
{ "body": "@Override\n public TwoFactorToken getToken(String userId, String operation) {\n\n return new TwoFactorToken() {\n private static final long serialVersionUID = -5148037320548431456L;\n\n @Override\n public void generate(long timeout) {\n TwoFactorTok...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_19
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void dateTest() {\n\n Date date = new Date();\n\n Assert.assertTrue(CompareUtils.compare(date, new Date(date.getTime())));\n Assert.assertTrue(CompareUtils.compare(date, DateFormatter.toString(date, \"yyyy-MM-dd\")));\n Assert.assertTrue(CompareUtils.compare(da...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_1
{ "fields": [], "file": "hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/test/java/org/hswebframework/web/dao/mybatis/builder/jpa/JpaAnnotationParserTest.java", "identifier": "JpaAnnotationParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParse() {\n RDBTableMetaData metaData = JpaAnnotationParser.parseMetaDataFromEntity(TestEntity.class);\n\n Assert.assertNotNull(metaData);\n Assert.assertEquals(metaData.getColumns().size(), 5);\n }", "class_method_signature": "JpaAnnotationParserTest.te...
{ "fields": [ { "declarator": "jdbcTypeMapping = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<Class, JDBCType> jdbcTypeMapping = new HashMap<>();", "type": "Map<Class, JDBCType>", "var_name": "jdbcTypeMapping" }, { "...
{ "body": "public static RDBTableMetaData parseMetaDataFromEntity(Class entityClass) {\n Table table = AnnotationUtils.findAnnotation(entityClass, Table.class);\n if (table == null) {\n return null;\n }\n RDBTableMetaData tableMetaData = new RDBTableMetaData();\n tableMet...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_15
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void nullTest() {\n\n Assert.assertFalse(CompareUtils.compare(1, null));\n\n Assert.assertFalse(CompareUtils.compare((Object) null, 1));\n Assert.assertTrue(CompareUtils.compare((Object) null, null));\n Assert.assertFalse(CompareUtils.compare((Number) null, 1))...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_2
{ "fields": [ { "declarator": "entityService = new TestEntityService()", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private TestEntityService entityService = new TestEntityService();", "type": "TestEntityService", "var_name": "entityService" },...
{ "body": "@Test\n public void testQuery() {\n PagerResult<TestEntity> result = entityService.selectPager(queryParamEntity);\n Assert.assertEquals(result.getTotal(), 1);\n Assert.assertEquals(result.getData().size(), 1);\n\n TestEntity entity = entityService.selectByPk(result.getData()....
{ "fields": [ { "declarator": "eventPublisher", "modifier": "protected", "original_string": "protected ApplicationEventPublisher eventPublisher;", "type": "ApplicationEventPublisher", "var_name": "eventPublisher" } ], "file": "hsweb-commons/hsweb-commons-service/hsweb-commons...
{ "body": "@Override\n @Transactional(readOnly = true)\n public E selectByPk(PK pk) {\n if (StringUtils.isEmpty(pk)) {\n return null;\n }\n return createQuery().where(GenericEntity.id, pk).single();\n }", "class_method_signature": "GenericEntityService.selectByPk(PK pk)", ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_16
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void numberTest() {\n Assert.assertTrue(CompareUtils.compare(1, 1));\n Assert.assertTrue(CompareUtils.compare(1, 1D));\n Assert.assertTrue(CompareUtils.compare(1, 1.0D));\n Assert.assertTrue(CompareUtils.compare(1e3,\"1e3\"));\n Assert.assertTrue(Compare...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_20
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void connectionTest() {\n Date date = new Date();\n\n Assert.assertTrue(CompareUtils.compare(100, new BigDecimal(\"100\")));\n\n Assert.assertTrue(CompareUtils.compare(new BigDecimal(\"100\"), 100.0D));\n\n Assert.assertTrue(CompareUtils.compare(Arrays.asList(1...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_21
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void mapTest() {\n Date date = new Date();\n\n Assert.assertTrue(CompareUtils.compare(Collections.singletonMap(\"test\", \"123\"), Collections.singletonMap(\"test\", 123)));\n\n\n Assert.assertFalse(CompareUtils.compare(Collections.singletonMap(\"test\", \"123\"), Col...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_17
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/CompareUtilsTest.java", "identifier": "CompareUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void enumTest() {\n\n Assert.assertTrue(CompareUtils.compare(TestEnum.BLUE, \"blue\"));\n\n Assert.assertFalse(CompareUtils.compare(TestEnum.RED, \"blue\"));\n\n\n Assert.assertTrue(CompareUtils.compare(TestEnumDic.BLUE, \"blue\"));\n\n Assert.assertFalse(Compa...
{ "fields": [], "file": "hsweb-core/src/main/java/org/hswebframework/web/bean/CompareUtils.java", "identifier": "CompareUtils", "interfaces": "", "methods": [ { "class_method_signature": "CompareUtils.compare(Object source, Object target)", "constructor": false, "full_signature": "public...
{ "body": "public static boolean compare(Object source, Object target) {\n if (source == target) {\n return true;\n }\n\n if (source == null || target == null) {\n return false;\n }\n\n if (source.equals(target)) {\n return true;\n }\n\n ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_3
{ "fields": [ { "declarator": "entityService = new TestEntityService()", "modifier": "@InjectMocks\n private", "original_string": "@InjectMocks\n private TestEntityService entityService = new TestEntityService();", "type": "TestEntityService", "var_name": "entityService" },...
{ "body": "@Test\n public void testInsert() {\n TestEntity testEntity = TestEntity.builder()\n .age((byte) 1)\n .enabled(true)\n// .name(\"测试\")\n .build();\n try {\n entityService.insert(testEntity);\n Assert.assertFal...
{ "fields": [ { "declarator": "eventPublisher", "modifier": "protected", "original_string": "protected ApplicationEventPublisher eventPublisher;", "type": "ApplicationEventPublisher", "var_name": "eventPublisher" } ], "file": "hsweb-commons/hsweb-commons-service/hsweb-commons...
{ "body": "@Override\n public PK insert(E entity) {\n if (!StringUtils.isEmpty(entity.getId())) {\n if ((entity.getId() instanceof String) && !StringUtils.isEmpty(entity.getId())) {\n tryValidateProperty(entity.getId().toString().matches(\"[a-zA-Z0-9_\\\\-]+\"), \"id\", \"只能由数字,字母,...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_8
{ "fields": [], "file": "hsweb-commons/hsweb-commons-utils/src/test/java/org/hswebframework/web/WebUtilTest.java", "identifier": "WebUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void queryStringToMap() throws UnsupportedEncodingException {\n String parameter = \"key1=value1&key2=value2&key3=&key4=key5=1\";\n Map<String, String> map = WebUtil.queryStringToMap(parameter, \"utf-8\");\n System.out.println(map);\n Assert.assertEquals(map.ge...
{ "fields": [ { "declarator": "ipHeaders = {\n \"X-Forwarded-For\",\n \"X-Real-IP\",\n \"Proxy-Client-IP\",\n \"WL-Proxy-Client-IP\"\n }", "modifier": "static final", "original_string": "static final String[] ipHeaders = {\n \"X-Forwarded...
{ "body": "public static Map<String,String> queryStringToMap(String queryString,String charset){\n try {\n Map<String,String> map = new HashMap<>();\n\n String[] decode = URLDecoder.decode(queryString,charset).split(\"&\");\n for (String keyValue : decode) {\n St...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_4
{ "fields": [], "file": "hsweb-commons/hsweb-commons-entity/src/test/java/org/hswebframework/web/commons/entity/param/TermExpressionParserTest.java", "identifier": "TermExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSimple() {\n String expression = \"name=测试 or age=10\";\n List<Term> terms = TermExpressionParser.parse(expression);\n\n Assert.assertNotNull(terms);\n Assert.assertEquals(terms.size(), 2);\n Assert.assertEquals(terms.get(0).getColumn(), \"name\...
{ "fields": [], "file": "hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/param/TermExpressionParser.java", "identifier": "TermExpressionParser", "interfaces": "", "methods": [ { "class_method_signature": "TermExpressionParser.parse(String expression)", "c...
{ "body": "public static List<Term> parse(String expression) {\n Query<?, QueryParamEntity> conditional = QueryParamEntity.newQuery();\n\n NestConditional<?> nest = null;\n\n // 字符容器\n char[] buf = new char[128];\n // 记录词项的长度, Arrays.copyOf使用\n byte len = 0;\n // 空格数量?...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_10
{ "fields": [ { "declarator": "permissionService", "modifier": "@Mock\n private", "original_string": "@Mock\n private PermissionService permissionService;", "type": "PermissionService", "var_name": "permissionService" }, { "declarator": "autoSyncPermission = new A...
{ "body": "@Test\n public void test() throws NoSuchMethodException {\n AopMethodAuthorizeDefinitionParser parser = new DefaultAopMethodAuthorizeDefinitionParser();\n List<AuthorizeDefinition> definition = Arrays.stream(TestController.class.getMethods())\n .map(method -> parser.parse(Te...
{ "fields": [ { "declarator": "permissionService", "modifier": "private", "original_string": "private PermissionService permissionService;", "type": "PermissionService", "var_name": "permissionService" }, { "declarator": "entityFactory", "modifier": "private", ...
{ "body": "@Override\n public void onApplicationEvent(AuthorizeDefinitionInitializedEvent event) {\n List<AuthorizeDefinition> definitions = event.getAllDefinition();\n\n Map<String, List<AuthorizeDefinition>> grouping = new HashMap<>();\n\n //以permissionId分组\n for (AuthorizeDefinition ...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_11
{ "fields": [], "file": "hsweb-core/src/test/java/org/hswebframework/web/bean/DiffTest.java", "identifier": "DiffTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void mapTest() {\n Map<String, Object> before = new HashMap<>();\n before.put(\"name\", \"name\");\n before.put(\"age\",21);\n before.put(\"bool\", true);\n before.put(\"bool\", false);\n before.put(\"birthday\", DateFormatter.fromString(\"1991010...
{ "fields": [ { "declarator": "property", "modifier": "private", "original_string": "private String property;", "type": "String", "var_name": "property" }, { "declarator": "before", "modifier": "private", "original_string": "private Object before;", "t...
{ "body": "public static List<Diff> of(Object before, Object after) {\n List<Diff> diffs = new ArrayList<>();\n\n Map<String, Object> beforeMap = FastBeanCopier.copy(before, HashMap::new);\n Map<String, Object> afterMap = FastBeanCopier.copy(after, HashMap::new);\n\n for (Map.Entry<String,...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_5
{ "fields": [], "file": "hsweb-commons/hsweb-commons-entity/src/test/java/org/hswebframework/web/commons/entity/param/TermExpressionParserTest.java", "identifier": "TermExpressionParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNest() {\n String expression = \"name = 测试 and (age > 10 or age <= 20) and test like test2 and (age gt age2 or age btw age3,age4 or (age > 10 or age <= 20))\";\n System.out.println(expression);\n List<Term> terms = TermExpressionParser.parse(expression);\n ...
{ "fields": [], "file": "hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/param/TermExpressionParser.java", "identifier": "TermExpressionParser", "interfaces": "", "methods": [ { "class_method_signature": "TermExpressionParser.parse(String expression)", "c...
{ "body": "public static List<Term> parse(String expression) {\n Query<?, QueryParamEntity> conditional = QueryParamEntity.newQuery();\n\n NestConditional<?> nest = null;\n\n // 字符容器\n char[] buf = new char[128];\n // 记录词项的长度, Arrays.copyOf使用\n byte len = 0;\n // 空格数量?...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
49850704_9
{ "fields": [], "file": "hsweb-boost/hsweb-boost-excel/src/test/java/org/hswebframework/web/excel/DefaultExcelImporterTest.java", "identifier": "DefaultExcelImporterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() {\n ExcelImporter.Result<TestBean> result = ExcelImporter\n .instance\n .doImport(this.getClass().getResourceAsStream(\"/test.xls\"), TestBean.class, bean -> null);\n\n Assert.assertEquals(result.success, 1);\n System.out.prin...
{ "fields": [ { "declarator": "headerMappings = new ConcurrentHashMap<>()", "modifier": "protected static", "original_string": "protected static Map<Class, Map<Class, HeaderMapper>> headerMappings = new ConcurrentHashMap<>();", "type": "Map<Class, Map<Class, HeaderMapper>>", "var_nam...
{ "body": "@Override\n @SneakyThrows\n public <T> Result<T> doImport(InputStream inputStream, Class<T> type, Function<T, Error> afterParsed, Class... group) {\n AtomicInteger counter = new AtomicInteger(0);\n AtomicInteger errorCounter = new AtomicInteger(0);\n List<T> data = new ArrayList<...
{ "created": "1/18/2016 3:51:39 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 49850704, "size": null, "stargazer_count": null, "stars": 7015, "updates": "2020-01-27T14:49:25+00:00", "url": "https://github.com/hs-web/hsweb-fr...
134287037_0
{ "fields": [ { "declarator": "RESOURCE_PATH = \"src/test/resources/\"", "modifier": "private static final", "original_string": "private static final String RESOURCE_PATH = \"src/test/resources/\";", "type": "String", "var_name": "RESOURCE_PATH" }, { "declarator": "reso...
{ "body": "@Test\n\tpublic void readingNotation() throws IOException {\n\t\tResource coffeeResource = loadResource(\"SuperBrewer3000.coffee\");\n\t\tResource notationResource = loadResource(\"SuperBrewer3000.coffeenotation\");\n\t\tWorkflowFacade facade = new WorkflowFacade(coffeeResource, notationResource);\n\n\t\tM...
{ "fields": [ { "declarator": "semanticResource", "modifier": "private", "original_string": "private Resource semanticResource;", "type": "Resource", "var_name": "semanticResource" }, { "declarator": "notationResource", "modifier": "private", "original_strin...
{ "body": "public <T extends DiagramElement> Optional<T> findDiagramElement(EObject semanticElement, Class<T> clazz) {\n\t\treturn findDiagramElement(semanticElement).map(elem -> safeCast(elem, clazz));\n\t}", "class_method_signature": "WorkflowFacade.findDiagramElement(EObject semanticElement, Class<T> clazz)", ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 134287037, "size": 24113, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/eclipsesource/graphical-lsp" }
162389327_7
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballplayer\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballplayer\";", "type": "String", "var_name": "API_URL" }, { "de...
{ "body": "@Test\n @InSequence(5)\n public void testRemove() {\n System.out.println(\"remove\");\n Response response = target.path(\"24\").request().delete();\n assertThat(response.getStatus(), is(Response.Status.NO_CONTENT.\n getStatusCode()));\n }", "class_method_signa...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "file"...
{ "body": "@DELETE\n @Path(\"{id}\")\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void remove(\n @PathParam(\"id\") Integer id) {\n super.remove(super.find(id));\n }", "class_method_signature": "FootballPlayerFacadeREST.remove(\n @PathParam(\"id\") Integer id...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_13
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballmanager\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballmanager\";", "type": "String", "var_name": "API_URL" }, { "...
{ "body": "@Test\n @InSequence(4)\n public void testFind() {\n System.out.println(\"find\");\n Response response = target.path(\"6\").request().get();\n assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));\n FootballManager responseEntity\n = respo...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "fil...
{ "body": "@GET\n @Path(\"{id}\")\n @Produces({MediaType.APPLICATION_JSON})\n public FootballManager find(\n @PathParam(\"id\") Long id) {\n return super.find(id);\n }", "class_method_signature": "FootballManagerFacadeREST.find(\n @PathParam(\"id\") Long id)", "constructor...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_12
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballmanager\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballmanager\";", "type": "String", "var_name": "API_URL" }, { "...
{ "body": "@Test\n @InSequence(5)\n public void testRemove() {\n System.out.println(\"remove\");\n Response response = target.path(\"6\").request().delete();\n assertThat(response.getStatus(), is(Response.Status.NO_CONTENT.\n getStatusCode()));\n }", "class_method_signat...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "fil...
{ "body": "@DELETE\n @Path(\"{id}\")\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void remove(\n @PathParam(\"id\") Long id) {\n super.remove(super.find(id));\n }", "class_method_signature": "FootballManagerFacadeREST.remove(\n @PathParam(\"id\") Long id)", ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_6
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballplayer\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballplayer\";", "type": "String", "var_name": "API_URL" }, { "de...
{ "body": "@Test\n @InSequence(3)\n public void testEdit() {\n System.out.println(\"edit\");\n FootballPlayer player = target.path(\"24\").request().get(\n new GenericTypeFootballPlayerImpl());\n player.setPrice(new BigInteger(\"150\"));\n Response response = target.pa...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "file"...
{ "body": "@PUT\n @Path(\"{id}\")\n @Consumes({MediaType.APPLICATION_JSON})\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void edit(\n @PathParam(\"id\") Integer id, FootballPlayer entity) {\n super.edit(entity);\n }", "class_method_signature": "FootballPlayerFacadeRE...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_1
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballteam\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballteam\";", "type": "String", "var_name": "API_URL" }, { "declar...
{ "body": "@Test\n @InSequence(3)\n public void testEdit() {\n System.out.println(\"edit\");\n Team team = target.path(teamId).request().get(\n new GenericTypeTeamImpl());\n team.setName(\"New_Winner_Team\");\n Response response = target.path(teamId).request().put(Enti...
{ "fields": [ { "declarator": "teamService", "modifier": "@Inject\n private", "original_string": "@Inject\n private TeamService teamService;", "type": "TeamService", "var_name": "teamService" } ], "file": "Chapter04/football-team-microservice/src/main/java/com/packtpub/...
{ "body": "@PUT\n @Path(\"{id}\")\n @Consumes({MediaType.APPLICATION_JSON})\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void edit(\n @PathParam(\"id\") String id, Team team) {\n teamService.edit(id, team);\n }", "class_method_signature": "FootballTeamRest.edit(\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_14
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballmanager\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballmanager\";", "type": "String", "var_name": "API_URL" }, { "...
{ "body": "@Test\n @InSequence(1)\n public void testFindAll() {\n System.out.println(\"findAll\");\n Response response = target.request().get();\n assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));\n List<FootballManager> responseEntity\n = respo...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "fil...
{ "body": "@GET\n @Override\n @Produces({MediaType.APPLICATION_JSON})\n public List<FootballManager> findAll() {\n return super.findAll();\n }", "class_method_signature": "FootballManagerFacadeREST.findAll()", "constructor": false, "full_signature": "@GET @Override @Produces({MediaType.APPLIC...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_0
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballteam\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballteam\";", "type": "String", "var_name": "API_URL" }, { "declar...
{ "body": "@Test\n @InSequence(1)\n public void testCreate() {\n System.out.println(\"create\");\n Team team = new Team(\"Test_NewTeam\", \"Favignana\",\n 3, new HashSet<>(Arrays.asList(3, 5, 6, 7, 10,\n 12, 14, 16, 18, 19, 20)));\n Response response = ...
{ "fields": [ { "declarator": "teamService", "modifier": "@Inject\n private", "original_string": "@Inject\n private TeamService teamService;", "type": "TeamService", "var_name": "teamService" } ], "file": "Chapter04/football-team-microservice/src/main/java/com/packtpub/...
{ "body": "@POST\n @Consumes({MediaType.APPLICATION_JSON})\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void create(Team team) {\n teamService.add(team);\n }", "class_method_signature": "FootballTeamRest.create(Team team)", "constructor": false, "full_signature": "@POST @Consu...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_3
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballteam\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballteam\";", "type": "String", "var_name": "API_URL" }, { "declar...
{ "body": "@Test\n @InSequence(4)\n public void testFind() {\n System.out.println(\"find\");\n Response response = target.path(teamId).request().get();\n assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));\n Team responseEntity\n = response.readEn...
{ "fields": [ { "declarator": "teamService", "modifier": "@Inject\n private", "original_string": "@Inject\n private TeamService teamService;", "type": "TeamService", "var_name": "teamService" } ], "file": "Chapter04/football-team-microservice/src/main/java/com/packtpub/...
{ "body": "@GET\n @Path(\"{id}\")\n @Produces({MediaType.APPLICATION_JSON})\n public Team find(\n @PathParam(\"id\") String id) {\n return teamService.find(id);\n }", "class_method_signature": "FootballTeamRest.find(\n @PathParam(\"id\") String id)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_2
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballteam\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballteam\";", "type": "String", "var_name": "API_URL" }, { "declar...
{ "body": "@Test\n @InSequence(5)\n public void testRemove() {\n System.out.println(\"remove\");\n Response response = target.path(teamId).request().delete();\n assertThat(response.getStatus(), is(Response.Status.NO_CONTENT.\n getStatusCode()));\n }", "class_method_signa...
{ "fields": [ { "declarator": "teamService", "modifier": "@Inject\n private", "original_string": "@Inject\n private TeamService teamService;", "type": "TeamService", "var_name": "teamService" } ], "file": "Chapter04/football-team-microservice/src/main/java/com/packtpub/...
{ "body": "@DELETE\n @Path(\"{id}\")\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void remove(\n @PathParam(\"id\") String id) {\n teamService.delete(id);\n }", "class_method_signature": "FootballTeamRest.remove(\n @PathParam(\"id\") String id)", "construct...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_11
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballmanager\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballmanager\";", "type": "String", "var_name": "API_URL" }, { "...
{ "body": "@Test\n @InSequence(3)\n public void testEdit() {\n System.out.println(\"edit\");\n FootballManager manager = target.path(\"6\").request().get(\n new GenericTypeFootballManagerImpl());\n manager.setNickname(\"Max_8Win\");\n Response response = target.path(\"...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "fil...
{ "body": "@PUT\n @Path(\"{id}\")\n @Consumes({MediaType.APPLICATION_JSON})\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void edit(\n @PathParam(\"id\") Long id, FootballManager entity) {\n super.edit(entity);\n }", "class_method_signature": "FootballManagerFacadeRES...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_5
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballplayer\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballplayer\";", "type": "String", "var_name": "API_URL" }, { "de...
{ "body": "@Test\n @InSequence(2)\n public void testCreate() {\n System.out.println(\"create\");\n FootballPlayer player = new FootballPlayer(\"Mauro\", \"Vocale\", 38,\n \"Juventus\",\n \"central midfielder\", new BigInteger(\"100\"));\n Response response = ta...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "file"...
{ "body": "@POST\n @Override\n @Consumes({MediaType.APPLICATION_JSON})\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void create(FootballPlayer entity) {\n super.create(entity);\n }", "class_method_signature": "FootballPlayerFacadeREST.create(FootballPlayer entity)", "construc...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_9
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballplayer\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballplayer\";", "type": "String", "var_name": "API_URL" }, { "de...
{ "body": "@Test\n @InSequence(1)\n public void testFindAll() {\n System.out.println(\"findAll\");\n Response response = target.request().get();\n assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));\n List<FootballPlayer> responseEntity\n = respon...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "file"...
{ "body": "@GET\n @Override\n @Produces({MediaType.APPLICATION_JSON})\n public List<FootballPlayer> findAll() {\n return super.findAll();\n }", "class_method_signature": "FootballPlayerFacadeREST.findAll()", "constructor": false, "full_signature": "@GET @Override @Produces({MediaType.APPLICAT...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_8
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballplayer\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballplayer\";", "type": "String", "var_name": "API_URL" }, { "de...
{ "body": "@Test\n @InSequence(4)\n public void testFind() {\n System.out.println(\"find\");\n Response response = target.path(\"24\").request().get();\n assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));\n FootballPlayer responseEntity\n = respo...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballPlayerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "file"...
{ "body": "@GET\n @Path(\"{id}\")\n @Produces({MediaType.APPLICATION_JSON})\n public FootballPlayer find(\n @PathParam(\"id\") Integer id) {\n return super.find(id);\n }", "class_method_signature": "FootballPlayerFacadeREST.find(\n @PathParam(\"id\") Integer id)", "constru...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_4
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballteam\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballteam\";", "type": "String", "var_name": "API_URL" }, { "declar...
{ "body": "@Test\n @InSequence(2)\n public void testFindAll() {\n System.out.println(\"findAll\");\n Response response = target.request().get();\n assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));\n List<Team> responseEntity\n = response.readEnt...
{ "fields": [ { "declarator": "teamService", "modifier": "@Inject\n private", "original_string": "@Inject\n private TeamService teamService;", "type": "TeamService", "var_name": "teamService" } ], "file": "Chapter04/football-team-microservice/src/main/java/com/packtpub/...
{ "body": "@GET\n @Produces({MediaType.APPLICATION_JSON})\n public List<Team> findAll() {\n return teamService.getTeams();\n }", "class_method_signature": "FootballTeamRest.findAll()", "constructor": false, "full_signature": "@GET @Produces({MediaType.APPLICATION_JSON}) public List<Team> findAll...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
162389327_10
{ "fields": [ { "declarator": "API_URL = \"http://localhost:8080/footballmanager\"", "modifier": "private static final", "original_string": "private static final String API_URL = \"http://localhost:8080/footballmanager\";", "type": "String", "var_name": "API_URL" }, { "...
{ "body": "@Test\n @InSequence(2)\n public void testCreate() {\n System.out.println(\"create\");\n FootballManager manager = new FootballManager(\"Massimiliano\", \"Allegri\", 50,\n \"Max_7Win\");\n Response response = target.request().post(Entity.entity(manager,\n ...
{ "fields": [ { "declarator": "em", "modifier": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private", "original_string": "@PersistenceContext(unitName = \"FootballManagerPU\")\n private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "fil...
{ "body": "@POST\n @Override\n @Consumes({MediaType.APPLICATION_JSON})\n @Transactional(Transactional.TxType.REQUIRES_NEW)\n public void create(FootballManager entity) {\n super.create(entity);\n }", "class_method_signature": "FootballManagerFacadeREST.create(FootballManager entity)", "const...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 162389327, "size": 55117, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/PacktPublishing/Hands-On-Cloud-Native-Microservices-with-Jakarta-EE...
85239682_151
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldReturnFullResponseFromSingle() {\n DisposableServer server = startServer(HttpResponseStatus.OK, \"\\\"OK\\\"\");\n\n TestResource resource = getHttpProxy(server.port());\n\n Response<String> stringResponse = HttpClient.getFullResponse(resource.getSingle())\...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "public static <T> Observable<Response<T>> getFullResponse(Observable<T> source) {\n if (!(source instanceof ObservableWithResponse)) {\n throw new IllegalArgumentException(\"Must be used with observable returned from api call\");\n }\n\n return source.map(data -> new Respons...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_106
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Setter value;", "type": "Setter", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private", "original_string": "private Setter longObservable;", ...
{ "body": "@Test\n public void shouldGetGenericParameterType() {\n assertThat(longObservable.getGenericParameterType().toString()).isEqualTo(\"rx.Observable<java.lang.Long>\");\n assertThat(genericSuperKey.getGenericParameterType().toString()).isEqualTo(\"class java.lang.String\");\n assertTha...
{ "fields": [ { "declarator": "field", "modifier": "private final", "original_string": "private final Field field;", "type": "Field", "var_name": "field" }, { "declarator": "setter", "modifier": "private final", "original_string": "private final Bi...
{ "body": "@Override\n public Type getGenericParameterType() {\n return genericParameterType;\n }", "class_method_signature": "FieldSetter.getGenericParameterType()", "constructor": false, "full_signature": "@Override public Type getGenericParameterType()", "identifier": "getGenericParameterType"...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_49
{ "fields": [ { "declarator": "DESERIALIZER = new ArrayDeserializer((str) -> str, String.class)", "modifier": "private final static", "original_string": "private final static Deserializer<String[]> DESERIALIZER = new ArrayDeserializer((str) -> str, String.class);", "type": "Deserializer<St...
{ "body": "@Test\n public void shouldHandleDeserializationErrorsForEntries() {\n Deserializer<Boolean[]> longDeserializer = new ArrayDeserializer(new LongDeserializer(), Long.class);\n try {\n longDeserializer.deserialize(\"5,a,5\");\n fail(\"Expected exception, but none was thr...
{ "fields": [ { "declarator": "inner", "modifier": "private final", "original_string": "private final Deserializer<T> inner;", "type": "Deserializer<T>", "var_name": "inner" }, { "declarator": "arrayType", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public T[] deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n String[] rawValues = value.split(\",\");\n try {\n T[] deserialized = (T[])Array.newInstance(arrayType, rawValues.length);\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_110
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Getter value;", "type": "Getter", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private", "original_string": "private Getter longObservable;", ...
{ "body": "@Test\n public void shouldGetGenericReturnType() {\n assertThat(longObservable.getGenericReturnType().toString()).isEqualTo(\"rx.Observable<java.lang.Long>\");\n assertThat(genericSuperKey.getGenericReturnType().toString()).isEqualTo(\"class java.lang.String\");\n assertThat(generic...
{ "fields": [ { "declarator": "getterLambda", "modifier": "private final", "original_string": "private final Function<I, T> getterLambda;", "type": "Function<I, T>", "var_name": "getterLambda" }, { "declarator": "returnType", "modifier": "private final", "or...
{ "body": "@Override\n public Type getGenericReturnType() {\n return genericReturnType;\n }", "class_method_signature": "MethodGetter.getGenericReturnType()", "constructor": false, "full_signature": "@Override public Type getGenericReturnType()", "identifier": "getGenericReturnType", "invocatio...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_147
{ "fields": [ { "declarator": "healthRecorder = new HealthRecorder()", "modifier": "private", "original_string": "private HealthRecorder healthRecorder = new HealthRecorder();", "type": "HealthRecorder", "var_name": "healthRecorder" }, { "declarator": "mockAppender", ...
{ "body": "@Test\n public void shouldSupportBeanParam() throws Exception {\n HttpClient client = new HttpClient(new HttpClientConfig(\"localhost\"));\n Method method = TestResource.class.getMethod(\"withBeanParam\", TestResource.Filters.class);\n TestResource.Filters filters = new TestReso...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HttpClient.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpClient.class);", "type": "Logger", "var_name": "LOG" }, ...
{ "body": "protected String getPath(Method method, Object[] arguments, JaxRsMeta meta) {\n String path = meta.getFullPath();\n\n StringBuilder query = null;\n Class<?>[] types = method.getParameterTypes();\n List<Object> args = new ArrayList<>(asList(arguments));\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_2
{ "fields": [ { "declarator": "serializerFactory = new JsonSerializerFactory()", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory = new JsonSerializerFactory();", "type": "JsonSerializerFactory", "var_name": "serializerFactory" } ], ...
{ "body": "@Test\n\tpublic void shouldSerializeUsingPrivateClassWithPublicProp() {\n\t\tPrivateEntity entity = new PrivateEntity();\n\t\tentity.setPublicPropInPrivateClass(\"hello\");\n\t\tFunction<PrivateEntity, String> serializer = serializerFactory.createStringSerializer(PrivateEntity.class);\n\n\t\tassertThat(ser...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonSerializerFactory.java", "identifie...
{ "body": "public <T> Function<T, String> createStringSerializer(TypeReference<T> paramType) {\n return createStringSerializer(mapper.writerFor(paramType));\n }", "class_method_signature": "JsonSerializerFactory.createStringSerializer(TypeReference<T> paramType)", "constructor": false, "full_signature...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_73
{ "fields": [ { "declarator": "value", "modifier": "private", "original_string": "private Setter value;", "type": "Setter", "var_name": "value" }, { "declarator": "longObservable", "modifier": "private", "original_string": "private Setter longObservable;", ...
{ "body": "@Test\n public void shouldGetGenericParameterType() {\n assertThat(longObservable.getGenericParameterType().toString()).isEqualTo(\"rx.Observable<java.lang.Long>\");\n assertThat(genericSuperKey.getGenericParameterType().toString()).isEqualTo(\"class java.lang.String\");\n assertTha...
{ "fields": [ { "declarator": "setterLambda", "modifier": "private final", "original_string": "private final BiConsumer<I, T> setterLambda;", "type": "BiConsumer<I, T>", "var_name": "setterLambda" }, { "declarator": "parameterType", "modifier": "private final", ...
{ "body": "@Override\n public Type getGenericParameterType() {\n return genericParameterType;\n }", "class_method_signature": "MethodSetter.getGenericParameterType()", "constructor": false, "full_signature": "@Override public Type getGenericParameterType()", "identifier": "getGenericParameterType...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_24
{ "fields": [], "file": "jaxrs/src/test/java/se/fortnox/reactivewizard/jaxrs/JaxRsMetaTest.java", "identifier": "JaxRsMetaTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldFindJaxRsClassFromImplementationWithoutInterface() {\n Optional<Class<?>> jaxRsClass = JaxRsMeta.getJaxRsClass(ResourceImplementation.class);\n assertThat(jaxRsClass.isPresent()).isTrue();\n assertThat(jaxRsClass.get()).isEqualTo(ResourceImplementation.clas...
{ "fields": [ { "declarator": "method = null", "modifier": "private", "original_string": "private HttpMethod method = null;", "type": "HttpMethod", "var_name": "method" }, { "declarator": "methodPath = null", "modifier": "private", "original_string":...
{ "body": "public static Optional<Class<?>> getJaxRsClass(Class<?> cls) {\n if (!cls.isInterface()) {\n if (cls.getAnnotation(Path.class) != null) {\n return Optional.of(cls);\n }\n\n for (Class<?> iface : cls.getInterfaces()) {\n if (iface.getAnno...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_32
{ "fields": [ { "declarator": "DESERIALIZER = new EnumDeserializer<>(TestEnum.class)", "modifier": "private final static", "original_string": "private final static Deserializer<TestEnum> DESERIALIZER = new EnumDeserializer<>(TestEnum.class);", "type": "Deserializer<TestEnum>", "var_n...
{ "body": "@Test\n public void shouldThrowDeserializerExceptionForUnknownEnums() {\n try {\n DESERIALIZER.deserialize(\"not a recognized value\");\n fail(\"Expected exception, but none was thrown\");\n } catch (Exception exception) {\n assertThat(exception).isInstance...
{ "fields": [ { "declarator": "paramType", "modifier": "private final", "original_string": "private final Class<T> paramType;", "type": "Class<T>", "var_name": "paramType" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/EnumDeserializer....
{ "body": "@Override\n public T deserialize(String value) throws DeserializerException {\n if (value == null || value.isEmpty()) {\n return null;\n }\n try {\n return Enum.valueOf(paramType, value);\n } catch (Exception parseException) {\n try {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_65
{ "fields": [ { "declarator": "interceptor = new JaxRsRequestContextInterceptor()", "modifier": "private", "original_string": "private JaxRsRequestContextInterceptor interceptor = new JaxRsRequestContextInterceptor();", "type": "JaxRsRequestContextInterceptor", "var_name": "intercept...
{ "body": "@Test\n public void shouldCloseContextAfterHandle() {\n JaxRsRequestContext.open();\n\n interceptor.postHandle(null, null);\n assertThat(JaxRsRequestContext.getContext()).isNull();\n }", "class_method_signature": "JaxRsRequestContextInterceptorTest.shouldCloseContextAfterHandle...
{ "fields": [], "file": "jaxrs-context/src/main/java/se/fortnox/reactivewizard/jaxrs/context/JaxRsRequestContextInterceptor.java", "identifier": "JaxRsRequestContextInterceptor", "interfaces": "implements JaxRsResourceInterceptor", "methods": [ { "class_method_signature": "JaxRsRequestContextInterce...
{ "body": "@Override\n public void postHandle(JaxRsResourceContext context, Publisher<Void> resourceCall) {\n JaxRsRequestContext.close();\n }", "class_method_signature": "JaxRsRequestContextInterceptor.postHandle(JaxRsResourceContext context, Publisher<Void> resourceCall)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_12
{ "fields": [ { "declarator": "serializerFactory", "modifier": "private", "original_string": "private JsonSerializerFactory serializerFactory;", "type": "JsonSerializerFactory", "var_name": "serializerFactory" }, { "declarator": "deserializerFactory", "modifier"...
{ "body": "@Test\n public void shouldSerializeAndDeserializeImmutableObjects() {\n Function<ImmutableEntity, String> serializer = serializerFactory.createStringSerializer(ImmutableEntity.class);\n String json = serializer.apply(immutableEntity);\n\n Function<String, ImmutableEntity> deserializ...
{ "fields": [ { "declarator": "mapper", "modifier": "private final", "original_string": "private final ObjectMapper mapper;", "type": "ObjectMapper", "var_name": "mapper" } ], "file": "json/src/main/java/se/fortnox/reactivewizard/json/JsonDeserializerFactory.java", "identif...
{ "body": "public <T> Function<String, T> createDeserializer(TypeReference<T> typeReference) {\n return createDeserializer(mapper.readerFor(typeReference));\n }", "class_method_signature": "JsonDeserializerFactory.createDeserializer(TypeReference<T> typeReference)", "constructor": false, "full_signatu...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_45
{ "fields": [ { "declarator": "DESERIALIZER = new DateDeserializer(StdDateFormat::new)", "modifier": "private final static", "original_string": "private final static Deserializer<Date> DESERIALIZER = new DateDeserializer(StdDateFormat::new);", "type": "Deserializer<Date>", "var_name"...
{ "body": "@Test\n public void shouldDeserializeTimestampsInMilliseconds() throws DeserializerException {\n Date deserialized = DESERIALIZER.deserialize(\"1262304000000\");\n assertThat(deserialized.toString()).isEqualTo(\"Fri Jan 01 00:00:00 UTC 2010\");\n }", "class_method_signature": "DateDes...
{ "fields": [ { "declarator": "dateFormatProvider", "modifier": "private", "original_string": "private Provider<DateFormat> dateFormatProvider;", "type": "Provider<DateFormat>", "var_name": "dateFormatProvider" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs...
{ "body": "@Override\n public Date deserialize(String value) throws DeserializerException {\n if (value == null) {\n return null;\n }\n try {\n return new Date(Long.parseLong(value));\n } catch (NumberFormatException e) {\n try {\n return ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_53
{ "fields": [ { "declarator": "DESERIALIZER = new BooleanNotNullDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<Boolean> DESERIALIZER = new BooleanNotNullDeserializer();", "type": "Deserializer<Boolean>", "var_name": "DESERIA...
{ "body": "@Test\n public void shouldDeserializeUnknownValuesToFalse() throws DeserializerException {\n assertThat(DESERIALIZER.deserialize(\"anything\")).isEqualTo(false);\n }", "class_method_signature": "BooleanNotNullDeserializerTest.shouldDeserializeUnknownValuesToFalse()", "constructor": false, ...
{ "fields": [], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/BooleanNotNullDeserializer.java", "identifier": "BooleanNotNullDeserializer", "interfaces": "implements Deserializer<Boolean>", "methods": [ { "class_method_signature": "BooleanNotNullDeserializer.deser...
{ "body": "@Override\n public Boolean deserialize(String value) throws DeserializerException {\n if (value == null) {\n throw new DeserializerException(\"invalid.boolean\");\n }\n return Boolean.valueOf(value.trim());\n }", "class_method_signature": "BooleanNotNullDeserializer....
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_90
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldDoIfObservableIsEmpty() {\n Observable<Object> observable = empty();\n\n Consumer<Boolean> thenMock = mock(Consumer.class);\n RxUtils.doIfEmpty(observable, () -> thenMock.accept(true)).toBlocking().subscribe();\n\n verify(thenMock).accept(eq(true))...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> Observable<T> doIfEmpty(Observable<T> output, Action0 action) {\n return output.doOnEach(new Observer<T>() {\n AtomicBoolean empty = new AtomicBoolean(true);\n\n @Override\n public void onCompleted() {\n if (empty.get()) {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_130
{ "fields": [], "file": "jaxrs-api/src/test/java/se/fortnox/reactivewizard/jaxrs/WebExceptionTest.java", "identifier": "WebExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldSetErrorCodeToInternalWhenStatusIs500() {\n WebException webException = new WebException(INTERNAL_SERVER_ERROR);\n assertThat(webException.getError()).isEqualTo(\"internal\");\n }", "class_method_signature": "WebExceptionTest.shouldSetErrorCodeToInternalWhenS...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "error", "modifier": "private", "original_string": "private String error;", ...
{ "body": "public String getError() {\n return error;\n }", "class_method_signature": "WebException.getError()", "constructor": false, "full_signature": "public String getError()", "identifier": "getError", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_28
{ "fields": [ { "declarator": "DESERIALIZER = new LocalTimeDeserializer()", "modifier": "private final static", "original_string": "private final static Deserializer<LocalTime> DESERIALIZER = new LocalTimeDeserializer();", "type": "Deserializer<LocalTime>", "var_name": "DESERIALIZER"...
{ "body": "@Test\n public void shouldThrowDeserializerExceptionForBadDates() {\n try {\n DESERIALIZER.deserialize(\"not a date\");\n fail(\"Expected exception, but none was thrown\");\n } catch (Exception exception) {\n assertThat(exception).isInstanceOf(DeserializerE...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(LocalTimeDeserializer.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(LocalTimeDeserializer.class);", "type": "Logger", "var_name": "LOG" } ],...
{ "body": "@Override\n public LocalTime deserialize(String value) throws DeserializerException {\n if (value == null || value.length() == 0) {\n return null;\n }\n\n try {\n return LocalTime.parse(value);\n } catch (DateTimeParseException e) {\n LOG.warn...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_167
{ "fields": [ { "declarator": "connectionCounter = new ConnectionCounter()", "modifier": "private", "original_string": "private ConnectionCounter connectionCounter = new ConnectionCounter();", "type": "ConnectionCounter", "var_name": "connectionCounter" } ], "file": "server/s...
{ "body": "@Test\n public void shouldReturnFalseWhenExceptionOccuresDuringAwaitZero() throws InterruptedException {\n Semaphore connectionsZero = mock(Semaphore.class);\n when(connectionsZero.tryAcquire(anyLong(), any(TimeUnit.class))).thenThrow(new InterruptedException());\n\n ConnectionCount...
{ "fields": [ { "declarator": "connections", "modifier": "private final", "original_string": "private final AtomicLong connections;", "type": "AtomicLong", "var_name": "connections" }, { "declarator": "connectionsZero", "modifier": "private final", "original...
{ "body": "public boolean awaitZero(int time, TimeUnit timeUnit) {\n try {\n boolean success = connectionsZero.tryAcquire(time, timeUnit);\n if (success) {\n connectionsZero.release();\n }\n return success;\n } catch (Exception e) {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_171
{ "fields": [ { "declarator": "connectionCounter", "modifier": "@Mock", "original_string": "@Mock\n ConnectionCounter connectionCounter;", "type": "ConnectionCounter", "var_name": "connectionCounter" }, { "declarator": "compositeRequestHandler", "modifier": "@M...
{ "body": "@Test\n public void shouldSkipAwaitingShutdownDependencyIfNotSet() throws NoSuchFieldException, IllegalAccessException {\n Appender mockAppender = LoggingMockUtil.createMockedLogAppender(RwServer.class);\n RwServer.awaitShutdownDependency(new ServerConfig().getShutdownTimeoutSeconds());\n ...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(RwServer.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(RwServer.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "co...
{ "body": "static void awaitShutdownDependency(int shutdownTimeoutSeconds) {\n if (blockShutdownUntil == null) {\n return;\n }\n\n LOG.info(\"Wait for completion of shutdown dependency\");\n Thread thread = new Thread(blockShutdownUntil);\n thread.start();\n try {\...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_86
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFirst() {\n assertThat(RxUtils.first(just(true))).isInstanceOf(FirstThen.class);\n }", "class_method_signature": "RxUtilsTest.testFirst()", "constructor": false, "full_signature": "@Test public void testFirst()", "identifier": "testFirst", "invocations": [ ...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static FirstThen first(Observable<?> doFirst) {\n return FirstThen.first(doFirst);\n }", "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first(Observable<?> doFirst)", "identifier": "first", "invoc...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_69
{ "fields": [], "file": "config/src/test/java/se/fortnox/reactivewizard/config/ConfigReaderTest.java", "identifier": "ConfigReaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldReplaceEscapedNewLines() {\n Map<String, String> env = new HashMap<>(System.getenv());\n env.put(\"CLIENTS\", \"\" +\n \"clients:\\\\n\" +\n \" client1:\\\\n\" +\n \" - key41\\\\n\" +\n \" - key24\\\\n\" +\n...
{ "fields": [ { "declarator": "UTF_8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF_8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF_8" }, { "declarato...
{ "body": "public static <T> T fromFile(String configFile, Class<T> cls) {\n try {\n return fromTree(readTree(configFile), cls);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "class_method_signature": "ConfigReader.fromFile(String configFile, Clas...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_126
{ "fields": [], "file": "jaxrs-api/src/test/java/se/fortnox/reactivewizard/jaxrs/WebExceptionTest.java", "identifier": "WebExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldGetIdWhenInitializedWithFieldError() {\n WebException webException = new WebException(new FieldError[0]);\n assertUuid(webException.getId());\n }", "class_method_signature": "WebExceptionTest.shouldGetIdWhenInitializedWithFieldError()", "constructor": false...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "error", "modifier": "private", "original_string": "private String error;", ...
{ "body": "public String getId() {\n return id;\n }", "class_method_signature": "WebException.getId()", "constructor": false, "full_signature": "public String getId()", "identifier": "getId", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "signature": "St...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_127
{ "fields": [], "file": "jaxrs-api/src/test/java/se/fortnox/reactivewizard/jaxrs/WebExceptionTest.java", "identifier": "WebExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldSetDebugLoggingFor404() {\n WebException webException = new WebException(NOT_FOUND);\n assertThat(webException.getLogLevel()).isEqualTo(DEBUG);\n }", "class_method_signature": "WebExceptionTest.shouldSetDebugLoggingFor404()", "constructor": false, "full_s...
{ "fields": [ { "declarator": "id", "modifier": "private", "original_string": "private String id;", "type": "String", "var_name": "id" }, { "declarator": "error", "modifier": "private", "original_string": "private String error;", ...
{ "body": "public Level getLogLevel() {\n return logLevel;\n }", "class_method_signature": "WebException.getLogLevel()", "constructor": false, "full_signature": "public Level getLogLevel()", "identifier": "getLogLevel", "invocations": [], "modifiers": "public", "parameters": "()", "return": ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_87
{ "fields": [], "file": "utils/src/test/java/se/fortnox/reactivewizard/util/rx/RxUtilsTest.java", "identifier": "RxUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIfTrue() {\n assertThat(RxUtils.ifTrue(just(true))).isInstanceOf(IfThenElse.class);\n }", "class_method_signature": "RxUtilsTest.testIfTrue()", "constructor": false, "full_signature": "@Test public void testIfTrue()", "identifier": "testIfTrue", "invocations":...
{ "fields": [], "file": "utils/src/main/java/se/fortnox/reactivewizard/util/rx/RxUtils.java", "identifier": "RxUtils", "interfaces": "", "methods": [ { "class_method_signature": "RxUtils.first(Observable<?> doFirst)", "constructor": false, "full_signature": "public static FirstThen first...
{ "body": "public static <T> IfThenElse<T> ifTrue(Observable<Boolean> ifValue) {\n return new IfThenElse<T>(ifValue);\n }", "class_method_signature": "RxUtils.ifTrue(Observable<Boolean> ifValue)", "constructor": false, "full_signature": "public static IfThenElse<T> ifTrue(Observable<Boolean> ifValue)"...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_68
{ "fields": [], "file": "config/src/test/java/se/fortnox/reactivewizard/config/ConfigReaderTest.java", "identifier": "ConfigReaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldThrowExceptionForInvalidYaml() {\n try {\n ConfigReader.fromFile(\"src/test/resources/testconfig-invalid.yml\", EmptyConfig.class);\n fail(\"Expected exception, but none was thrown\");\n } catch (RuntimeException exception) {\n ass...
{ "fields": [ { "declarator": "UTF_8 = Charset.forName(\"UTF-8\")", "modifier": "private static final", "original_string": "private static final Charset UTF_8 = Charset.forName(\"UTF-8\");", "type": "Charset", "var_name": "UTF_8" }, { "declarato...
{ "body": "public static <T> T fromFile(String configFile, Class<T> cls) {\n try {\n return fromTree(readTree(configFile), cls);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "class_method_signature": "ConfigReader.fromFile(String configFile, Clas...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_170
{ "fields": [ { "declarator": "connectionCounter", "modifier": "@Mock", "original_string": "@Mock\n ConnectionCounter connectionCounter;", "type": "ConnectionCounter", "var_name": "connectionCounter" }, { "declarator": "compositeRequestHandler", "modifier": "@M...
{ "body": "@Test\n public void shouldNotOverrideShutdownDependency() {\n RwServer.registerShutdownDependency(() -> {});\n try {\n RwServer.registerShutdownDependency(() -> {});\n fail();\n } catch (IllegalStateException e) {\n assertThat(e.getMessage()).isEqual...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(RwServer.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(RwServer.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "co...
{ "body": "public static void registerShutdownDependency(Runnable blockShutdownUntil) {\n if (RwServer.blockShutdownUntil != null && blockShutdownUntil != null) {\n throw new IllegalStateException(\"Shutdown dependency is already registered\");\n }\n RwServer.blockShutdownUntil = block...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_166
{ "fields": [ { "declarator": "connectionCounter = new ConnectionCounter()", "modifier": "private", "original_string": "private ConnectionCounter connectionCounter = new ConnectionCounter();", "type": "ConnectionCounter", "var_name": "connectionCounter" } ], "file": "server/s...
{ "body": "@Test\n public void testZeroConnections() {\n assertTrue(connectionCounter.awaitZero(0, TimeUnit.SECONDS));\n }", "class_method_signature": "ConnectionCounterTest.testZeroConnections()", "constructor": false, "full_signature": "@Test public void testZeroConnections()", "identifier": "t...
{ "fields": [ { "declarator": "connections", "modifier": "private final", "original_string": "private final AtomicLong connections;", "type": "AtomicLong", "var_name": "connections" }, { "declarator": "connectionsZero", "modifier": "private final", "original...
{ "body": "public boolean awaitZero(int time, TimeUnit timeUnit) {\n try {\n boolean success = connectionsZero.tryAcquire(time, timeUnit);\n if (success) {\n connectionsZero.release();\n }\n return success;\n } catch (Exception e) {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }
85239682_29
{ "fields": [ { "declarator": "DESERIALIZER = new EnumDeserializer<>(TestEnum.class)", "modifier": "private final static", "original_string": "private final static Deserializer<TestEnum> DESERIALIZER = new EnumDeserializer<>(TestEnum.class);", "type": "Deserializer<TestEnum>", "var_n...
{ "body": "@Test\n public void shouldDeserialize() throws DeserializerException {\n TestEnum deserialized = DESERIALIZER.deserialize(\"FIRST\");\n assertThat(deserialized).isEqualTo(TestEnum.FIRST);\n }", "class_method_signature": "EnumDeserializerTest.shouldDeserialize()", "constructor": fals...
{ "fields": [ { "declarator": "paramType", "modifier": "private final", "original_string": "private final Class<T> paramType;", "type": "Class<T>", "var_name": "paramType" } ], "file": "jaxrs/src/main/java/se/fortnox/reactivewizard/jaxrs/params/deserializing/EnumDeserializer....
{ "body": "@Override\n public T deserialize(String value) throws DeserializerException {\n if (value == null || value.isEmpty()) {\n return null;\n }\n try {\n return Enum.valueOf(paramType, value);\n } catch (Exception parseException) {\n try {\n ...
{ "created": null, "fork": null, "fork_count": 10, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 85239682, "size": 1121, "stargazer_count": 21, "stars": null, "updates": null, "url": "https://github.com/FortnoxAB/reactive-wizard" }