After using this IDEA artifact, the leaders all praised me for my good code writing!

Click to follow the official account, Java dry goods will be delivered in time08d64dde1983497a3d70ed2db6a6ff82.png

240616eefa20d4db224681f5b69e702f.png There is no one of the strongest microservice frameworks in China!

313e46e8c8fafacb4ce60845a09bd8c4.png Covers almost all Spring Boot operations!

e8c86649b588525887760a965a73a0c0.png 2023 New Java Interview Questions (2500+)


As a plug-in for checking code specifications, CheckStyle can not only use the default given development specifications, such as Sun's and Google's development specifications, but also import plug-ins like Ali's development specifications.

In fact, each company has different requirements for development specifications, so most companies will specify their own check specifications, which can generally be achieved by importing a given checkstyle.xml file.

As a newcomer, I checkstyled the entire project, and it was miserable, so everyone should pay more attention to the code specification, and benefit others and yourself.

The landlord uses idea, so let’s talk about the import of the plug-in first, and then explain how to modify the non-standard code.

Import the CheckStyle plugin

1. File ——> setting install plugin

479ad011bb46f78a20fdc55bcce3f3c9.png 877f139cb928292181fe0349747707c6.png

You can also download Ali's development specifications to see your personal needs and preferences.

ef0686170a51399587d9b610296805b3.png

2. Configure the plugin

3c20e03374cf0b22aad0384fb6b1500c.png f0cfdb0d8a87e18948993aaa36697e1b.png 48054757fdd0e56e73af6cf3fea58bc8.png

3. Start C

Select the class you need to checkstyle and right-click:

7a217616f9a72e86aad492caa056056b.png

Click checkstyle, because I imported from Alibaba, the button to use checkstyle is occupied, I am too lazy to do it, Ali is fine. To get the full version of "Ali Java Development Manual", please follow the official account Java core technology, reply: manual, you can get it.

or:

061dcecbec28598647c3f9bd83c85fd5.png

Reasons for reporting errors and how to deal with them

Principle: Change the code less, don't be blind and careless when dealing with it, and write more changes when submitting git.

In addition, if you are preparing for an interview to change jobs in the near future, it is recommended to use the Java interview library applet to write questions online, covering 2000+ Java interview questions, covering almost all mainstream technical interview questions.

1. The first category: annotation problems

Missing annotations, click on the question to jump to the place where the annotations are missing

5fb9c8e5b2c64f42e7c780c7e51e1b60.png

The annotation is incomplete, just fill it up

1f68de6325171b681788841e14fb7b9b.png

Completion, each value of @ must be complete

130cf3999cb81790c701962c4b8baf53.png

2. Character placeholder problem

c8bc8939275e768418e991fff47ba6cc.png

First set the code style according to your own needs

d3504300683e0afae738f2024d635bb4.png

Then right click and select

ce2f12d25dc78f2b15eddab45bb47487.png

can be solved

if tab problem

aa8ad4a426139070965a326e2559a119.png

By default, tab=4 spaces, there is no tab, in fact, I will not, welcome to add.

See the name and know the meaning

2165308c8b4d6b76bd9422a09ffe24d9.png

It's ok to change as required

45338ad11bd9068ee9153326e559e4af.png

Just delete it

format problem

name problem

1dab30628f17e3ecba7ca08eff3b9483.png

It is recommended to make less changes. If it is a public class, it will have a greater impact, so pay more attention in advance.

logical error

99b245644b73f4b40e71a235569f68fe.png f2562b69da80e0c0b2e41e8ce970f852.png

Import order

981100cc6cdc2d81c44a11fb3455e27d.png

Similar to this situation, the order of importing packages does not follow the checkstyle specification. Under normal circumstances, the ctrl + shift + o shortcut keys of eclispe can solve this piracy problem, and the same is true for idea. Of course, you can also right-click to select

178af3466d20119233c92ca8f0d29e22.png

Copyright statement: This article is an original article of CSDN blogger "iXinRu", following the CC 4.0 BY-SA copyright agreement, please attach the original source link and this statement for reprinting. Original link: https://blog.csdn.net/iXinRu/article/details/85242553


If you want to learn Spring Boot systematically, I recommend my " Spring Boot Core Technology Course ", based on the latest 3.x version, covering almost all core knowledge points of Spring Boot , one-time payment, permanent learning...

Those who are interested scan the code to contact and subscribe to learn:

f914cbdb2a9cfdf04d407a36271f372e.png

If you want to try/preview, add Brother R on WeChat

e853157b1d36c1c120949f8b4477657a.jpeg

Add WeChat, please note: 399

f7a2550404b9ce5281b4119eda3af021.png Click to read the original text to get 2000+ interview questions!

Guess you like

Origin blog.csdn.net/youanyyou/article/details/131733508