What configuration notifies unhandled exceptions in Eclipse?

when in eclipse I use a method that throws an exception, it usually complains if it is not surrounded by try / catch or if the exception is not selected again. But with a few exceptions (e.g. Integer.parseInt (string)) eclipse will not complain.

How to configure eclipse to complain about all unhandled exceptions?

Thank!

+3
source share
6 answers

The simple answer is: you cannot.

Longer answer:

  • Checked or excluded exceptions are a fundamental part of the Java language.

  • The Eclipse compiler role does not compile errors or warnings for a valid and perfectly acceptable Java.

  • , , () , NullPointerException, ArrayIndexOutOfBoundsException, OutOfMemoryError ..

, ""... NumberFormatException, ... () PMD , " " .

+3

java. : , RuntimeExceptions , try/catch.

+2
+2

AFAIK, Eclipse , Java. , Java. , Eclipse .

Java Throwable , RuntimeException Error.

+1

, " " .

. Java.

+1

The compiler complains only if checked exceptions are not processed. Here it is expected that Integer.parseInt (string) will throw an exception using numberformatexception or a runtime exception. Because he does not agree.

+1
source

All Articles