Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to create custom warning in eclipse?

Tags:

java

eclipse

I know that the obvious answer is "pay attention" but because I am constantly switching between Java and Javascript, I'm endlessly forgetting that == doesn't work for string comparison on the Java side of things. Is there any way to get Eclipse to warn me that I'm probably not doing what I want to be doing when it sees me comparing two strings with == rather than using the equals() method?

like image 585
Yevgeny Simkin Avatar asked Jan 17 '13 04:01

Yevgeny Simkin


Video Answer


1 Answers

There are many static code analyzer available which does such type of things. Few of them are:

  1. checkStyle
  2. PMD
  3. sonar
  4. findBugs

They have many in-built rules and you can configure them in eclipse also. So as and when, you type and save, these tools would also show warnings just like in-built eclipse warnings.

like image 68
Priyank Doshi Avatar answered Oct 19 '22 22:10

Priyank Doshi