EDIT: SORRY!
Turns out that I’m an idiot. The exception was being thrown from another call to r.nextInt() which was taking an uninitialized variable as an argument! Foot is very much in mouth.
I’m really not sure what else to say about this:
Random r = new Random();
class SomeClass {
public SomeClass(){
new SomeClass(r.nextInt(5));
}
public SomeClass(int i){
...
Throws a NullPointerException where r.nextInt(5) is called. Any ideas?
Turns out that I’m an idiot. The exception was being thrown from another call to r.nextInt() on the same line which was taking an uninitialized variable as an argument! Foot is very much in mouth. Will read more carefully in future.