简体   繁体   中英

IDEA IntelliJ show message "Incompatible type" and can not fix error

图片显示错误

I have tried to click on suggestion action of IDE but it didn't change any thing and error still there. There are same class and library. It's so confusing.

Is that a problem of IDE or can I turn off that error inspection?
This is the error message:

Required type:
org.springframework.web.client.RestTemplate
Provided:
org.springframework.web.client.RestTemplate

I clicked on Quick Fix but it didn't change any thing.

It's okay when I run or debug all projects. I just want to turn off that error of IDE, it always show error when I code

You should be able to disable specific inspections, as per Jetbrains Website . The easiest way is probably this one:

Disable an inspection in the editor

  1. Place the caret at the highlighted line and press Alt+Enter (or click the Intention action icon to use the intention action).

  2. Click the arrow next to the inspection you want to disable, and select Disable inspection .

Alternatively, you can also suppress inspections:

When you suppress an inspection, the code analysis engine doesn't highlight the problem found by this inspection in the specific piece of code (class, method, field, or statement). You can also suppress all inspections in the current class.

After you suppress an inspection, IntelliJ IDEA adds a new element before the selected symbol.

For example in Java, if you suppress an inspection for a class, a method, or a field, the IDE adds the @SuppressWarnings annotation.

Suppress an inspection in the editor

  1. Place the caret at the highlighted line and press Alt+Enter (or click the Intention action icon to use the intention action).

  2. Click the arrow next to the inspection you want to suppress, and select the necessary suppress action.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM