Have you never used these efficient idea plug-ins?

 

1、Alibaba Java Coding Guidelines

As a developer, the "Alibaba Development Manual" is necessary for our basic staff, and consciously following the development regulations of the "Alibaba Development Manual" is our self-cultivation as an excellent developer. However, we may not be able to memorize many development protocols one by one, so the appearance of the Alibaba Java Coding Guidelines plug-in helped us solve this problem.

After installing the plug-in, if the code exceeds 80 lines, manually create a thread pool, etc., if these do not conform to the specifications in the "Manual", IDEA will give a warning.

For example, it is stipulated in the development protocol that the thread pool is not allowed to be created by Executors, but through the ThreadPoolExecutor method. This processing method allows students to write more clearly the operating rules of the thread pool and avoid the risk of resource exhaustion. When I use Executors to create, there will be the following prompt:

It is recommended that you must install the plug-in, it will help you check out many hidden dangers and urge you to write more standardized code.

2.Java Bean to Json 

When we usually use postman for interface testing, the requested parameters need to be entered one by one in postman. If there are fewer parameters, and if the parameters are many and complex, it is easy to be careless and make mistakes. Java Bean to Json is an IntelliJ IDEA plug-in that converts Java beans to json. Easily solved this problem for us. The effect of use is as follows: Is it very labor-saving? ~

3、GenerateAllSetter 

GenerateAllSetter plug-in: The function of this plug-in is to call all the set methods of the object with one click, and quickly generate set code for the properties of the existing model entity objects, eliminating the need to go to the entity object to search when setting property values ​​in the development process Time, the default value of the type will be attached when it is generated. The effect is as follows:

Look, like the dto to entity in the above picture, if we tap it by hand, it may take about two minutes, but after using this plug-in, directly Alt+Enter the draft in one second, is it very convenient~

4、GsonFarmat 

In our daily development process, if we often need to parse other services to return json data when making API calls, we generally need to create an entity class as the carrier of json data. Each data in json format with different structure corresponds to an entity class. Would it be troublesome to write these entity classes one by one?

Don't worry, GsonFarmat has solved this trouble perfectly for us. The GsonFarmat plug-in can generate entity beans with one click based on json text. The effects are as follows:

As shown in the figure above, it may take at least two minutes for json to be typed by hand, and then use the GsonFarmat plugin to finalize the draft in 2 seconds. Isn't it awesome~

5、SequenceDiagram 

SequenceDiagram can automatically generate a sequence diagram according to the code call link, which is super awesome and super recommended! This is a great help for studying the source code and sorting out the business code in the work, which can be called an artifact. After the installation is complete, in a certain function of a certain class, right click --> Sequence Diagaram to call it up.

The following figure is a piece of code for my authentication through the gateway, and the call link of the current request can be drawn through the plug-in.

6、MyBatis Log Plugin 

When we use mybatis, sometimes we may encounter some sql exceptions. At this time, we need to check the executed sql statement. However, mybatis generally uses log4j to print the executed sql statement, the type is as follows: at this time, if the sql statement is relatively long and complicated, then it will be more complicated to manually splice it, in case you shake your hands again, what will happen in the process of restoring sql If you make a mistake, it will be very troublesome. The time will be wasted and the problem will not be solved. The development efficiency will be greatly reduced. At this time, our excellent IDEA plug-in Mybatis Log Plugin will be launched.

Click the MyBatis Log Plugin option in the Tools toolbar or use the Ctrl+Alt+Shift+O shortcut to start the Mybatis Log Plugin. When the program is running, the MyBatis Log Plugin will restore the sql log output by mybatis into a complete sql statement. As follows: The sql statement restored by the MyBatis Log Plugin is an executable sql statement, which can be copied and executed directly. Does this avoid errors and save a lot of time?

7、Maven Helper 

During the development process, we often encounter jar package conflict scenarios. How can we quickly know which dependent Jar packages in our project conflict? Maven Helper, an InteliJ IDEA plug-in, helped us solve this problem.

After Maven Helper is installed, we open the pom.xml file, and there will be an additional Dependency Analyzer option at the bottom. Click this option to refresh, find the conflict, right-click, and then select Exclude to exclude the conflicting version of the Jar package. See, is it fast? When you are still wondering which line of code caused the exception and which jar package has conflicted, your colleagues using the Maven Helper plug-in may have submitted the code early.

8.SonarLint 

Sonar is a plug-in for code quality management that can help us detect the following problems in the project:

  1. Lack of unit testing. Statistics and display unit test coverage

  2. Repeat the code. Monitor duplicate codes in the project and check which codes are duplicated online

  3. Insufficient or excessive comments. No comments will make the code less readable, and too many comments will make developers spend too much energy to read the comments, contrary to the original intention

  4. Potential defects. For example, the program may generate null pointers, arrays out of bounds, etc.

  5. Does not follow code standards. Such as methods and classes should not be capitalized

  6. Bad complexity distribution. Files, classes, methods, etc., if the complexity is too high, it will be difficult to change, which will make it difficult for developers to understand them, and if there is no automated unit testing, changes to any components in the program may lead to the need for comprehensive regression testing

Take a chestnut: In the above animation, I carelessly compared two values ​​with different return value types during the development process. Sonar immediately detected that this is meaningless when scanning the file. The comparison, because the comparison result will be false. So as to avoid some unnecessary bugs and risks.

9.Lombok 

We often need to write javabeans in development, we need to spend time to add the corresponding getter/setter, perhaps to write constructor, equals and other methods, and need to maintain, when there are many properties, there will be a large number of getter/setter methods, These seem very lengthy and do not have much technical content. Once the attributes are modified, it is easy to forget to modify the corresponding method. 

Lombok can automatically generate constructors, getter/setter, equals, hashcode, and toString methods for properties at compile time through annotations. all of these,

We just need a few notes to get me.

10、Free MyBatis plugin 

Free MyBatis plugin is a plugin that switches back and forth between mapper interface methods and mapper XML files. The specific effects after installation are as follows:

Click the arrow in the left column to jump between the mapper and the corresponding xml. We don’t need to search and find it manually. Is it very comfortable to use?

11. Programmer Motivator : Chaoyue Yang 

After seeing so many excellent plug-ins in front, everyone must be a bit tired. Don't be sleepy, our surpassing sister is coming~ Chaoyue Yang is the most favorite plugin of my colleague Dan. Write code in IntelliJ IDEA continuously for one hour, Chaoy Yang will remind you to take a break~

what? ? You said you don't like to surpass your sister? ? It’s okay, after the installation is complete, select "Beyond Encouragement Division" in Setting——>Other Settings, you can change the related configuration in the relevant interface, here you can change your favorite goddess/male god photo, set your most satisfactory copywriting And the interval reminder time. After setting it up, start typing the code with peace of mind~ The goddess/male goddess who is tired of knocking will come to remind you, and you can also enjoy the photos of the goddess and take a break.

 

 

Scan the QR code on WeChat and follow my official account

 

 

 

 

Guess you like

Origin blog.csdn.net/CharlesYooSky/article/details/106373515