Fix DateTimeParseException

Hover (or tap) to flip

Use the correct formatter pattern and locale, and trim/normalize input before parsing.

Learn more

DateTimeParseException meaning

Hover (or tap) to flip

Thrown when parsing a date/time string fails because the text doesn’t match the expected pattern.

Learn more

Avoid date/time invalid values

Hover (or tap) to flip

Validate inputs and use appropriate java.time types (LocalDate, ZonedDateTime) for the task.

Learn more

DateTimeException meaning

Hover (or tap) to flip

Indicates an invalid date/time operation such as out-of-range values or invalid conversions.

Learn more

Safe removal during Collection iteration

Hover (or tap) to flip

Use Iterator.remove(), collect items to remove later, or use concurrent collections when needed.

Learn more

ConcurrentModificationException meaning

Hover (or tap) to flip

Thrown when a collection is structurally modified while iterating (typical with fail-fast iterators).

Learn more

Safe Date/Time parsing approach

Hover (or tap) to flip

Validate input, handle exceptions, and prefer parsing with known locale/format when relevant.

Learn more

NumberFormatException definition

Hover (or tap) to flip

Occurs when parsing a string into a number fails due to invalid characters or format.

Learn more

BigDecimal comparison rule

Hover (or tap) to flip

Use compareTo() for numeric comparison; equals() also compares scale.

Learn more

BigDecimal purpose

Hover (or tap) to flip

BigDecimal supports precise decimal arithmetic and avoids floating-point rounding issues.

Learn more

Prevent ClassCastException

Hover (or tap) to flip

Use instanceof checks or redesign APIs to rely on polymorphism instead of casting.

Learn more

ClassCastException definition

Hover (or tap) to flip

Thrown when you cast an object to an incompatible type at runtime.

Learn more

Record use case

Hover (or tap) to flip

Use records for DTOs and simple value objects where immutability and brevity matter.

Learn more

Java record definition

Hover (or tap) to flip

A record is a concise immutable data carrier with auto-generated constructor, accessors, equals, hashCode, and toString.

Learn more

Role of permits keyword for sealed classes

Hover (or tap) to flip

The permits clause explicitly lists allowed subclasses, enabling safer modeling and switches.

Learn more

Sealed class definition

Hover (or tap) to flip

A sealed class restricts which subclasses can extend it, declared with permits.

Learn more

Wildcard import threshold in IntelliJ

Hover (or tap) to flip

IntelliJ switches to * imports after a threshold; lowering it or disabling prevents wildcard imports.

Learn more

Disable wildcard imports (IntelliJ)

Hover (or tap) to flip

Configure code style to use explicit imports to improve readability and reduce ambiguity.

Learn more

Mockito: Matcher consistency rule

Hover (or tap) to flip

If you use a matcher for one argument, use matchers for all arguments in that method call.

Learn more

InvalidUseOfMatchersException meaning

Hover (or tap) to flip

Thrown when Mockito matchers are misused (mixing matchers with raw values in the same call).

Learn more