Lâm Thịnh
Lâm Thịnh

Reputation: 19

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

Image show errror

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.

Upvotes: 1

Views: 1131

Answers (1)

lucidbrot
lucidbrot

Reputation: 6188

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.

Upvotes: 1

Related Questions