1

What does it mean if you get a NullPointerException on a closing brace in Java? Say, for example, right here:

 SavedState() { this.iZone = DateTimeParserBucket.this.iZone; this.iOffset = DateTimeParserBucket.this.iOffset; this.iSavedFields = DateTimeParserBucket.this.iSavedFields; this.iSavedFieldsCount = DateTimeParserBucket.this.iSavedFieldsCount; } <-- Stack trace says NPE is thrown here 

This is in the stacktrace:

... Caused by: java.lang.NullPointerException at org.joda.time.format.DateTimeParserBucket$SavedState.<init>(DateTimeParserBucket.java:521) ~[joda-time-2.9.5.jar:2.9.5] ... 

1 Answer 1

5

The only reason (barring things being very broken) it would point to a brace is if the source and the code being run aren't in sync. Clean, re-run and see the stacktrace again.

In this case since the stacktrace is coming from inside joda-time, you're probably looking at the source for the wrong version of the library. Make sure you're looking at the source for version 2.9.5.

Sign up to request clarification or add additional context in comments.

1 Comment

Or there might be some generated code involved, e.g when using Lombok.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.