guava EventBus learning two source codes

Part I This paper introduces the use of event bus in guava package, and deeply understands the implementation details in the source code EventBus understand First of all, we need to look at the EventBus class. There are many comments on the class, which are summarized as follows: Eventbus ensures that subscribers will not be accessed at the sam ...

Posted by porta325 on Mon, 25 May 2020 18:25:41 -0700

Here are several typical memory overflow cases in Java!

Here are several typical memory overflow cases in Java! Write in frontAs a programmer, more or less will encounter some memory overflow scenarios. If you haven't yet, it means that you may have a relatively short working life, or you are a fake programmer at all! Ha ha, make a joke. Today, we will list several typical memory overflow cases in t ...

Posted by pomme on Sun, 24 May 2020 19:43:06 -0700

My jdk source code: skeleton implementation class of abstractset family

1, Overview AbstractSet class is the skeleton implementation class in Set family. It constructs a layer of abstraction between interface and implementation class. Its purpose is to reuse some common functions and facilitate extension, and provide common method templates for subclasses. The AbstractSet class has much less content than the Abstr ...

Posted by colB on Sun, 24 May 2020 07:31:30 -0700

Design Mode~Hedonic Mode

concept Internal state, external state, enjoyment pool Role & UML Demo: Editor Picture Reuse - Java Reference concept Flyweight Pattern is a shared way to reuse a large number of fine-grained objects to reduce memory usage (to avoid creating and destroying objects in large amounts repeatedly). The Flyweight in the name is one ...

Posted by idevlin on Sat, 23 May 2020 09:56:32 -0700

New feature of JDK9: xlog of JVM

brief introduction In java programs, we use logs to locate and discover potential problems in our projects.In modern java projects, we use logging frameworks such as log4j or slf4j, Logback, and so on to handle logging issues. JVM is the basis of running java programs. Events in JVM such as GC, class loading, JPMS, heap, threads and so on can a ...

Posted by littlejones on Fri, 22 May 2020 16:54:30 -0700

netty summarizes the startup process of the server

Mainly paste code Make a summary for yourself (connection server initialization and processing): 1. NioEventLoop is used to positively handle io connection 2.NioEventLoopGroup can be simply understood as two processing groups, one is accepting connection, the other is processing connection, and the chooser in it is NioEventLoop array Server ...

Posted by KeitaroHimura on Sun, 17 May 2020 07:44:32 -0700

Log series 1 -- slf4j log framework principle

catalog 1. Preface 2. Log face 3. Log Library 4. Log adapter 5. Selection of log base 6.logback.xml configuration file 1. Preface When it comes to logging tools, you must have heard these terms in your daily work or study: log4j, logback, jdk-logging, slf4j, commons-logging, etc. What is the relationship between them and what is their role ...

Posted by dk4210 on Wed, 13 May 2020 19:21:52 -0700

Square root of LeetCode 69. x

My LeetCode: https://leetcode-cn.com/u/ituring/ My LeetCode source code [GitHub]: https://github.com/izhoujie/Algorithmcii Square root of LeetCode 69. x subject Implement the int sqrt(int x) function. Calculates and returns the square root of X, where x is a non negative integer. Because the return type is an integer, the result only retains ...

Posted by turtlefox on Tue, 12 May 2020 02:03:54 -0700

Debugging artifact in jcmd:JDK14

brief introduction Jcmd is the debugging tool that comes with JDK and has very powerful functions.Jcmd was officially introduced in JDK7. With jcmd, you can completely replace many other commonly used tools, such as jstak and jmap. Jcmd can send specific diagnostic commands to the JVM.For security reasons, users using jcmd must have the same us ...

Posted by glassroof on Sun, 10 May 2020 15:57:28 -0700

Java automation test framework - 04 - Test Method of TestNG

From: https://www.cnblogs.com/du-hong/p/11718894.html brief introduction According to the plan in the previous article, this one will share the test method with the kids. 1, Set parameters Test methods can have Parameters. Each test method can have any number of Parameters, and you can pass the correct Parameters to the method by using Te ...

Posted by Okami on Sat, 09 May 2020 01:06:00 -0700