nus-cs2113-AY2021S2 / forum

5 stars 0 forks source link

Build failed on autograder but works fine on my computer #4

Closed Leeyp closed 3 years ago

Leeyp commented 3 years ago

I'm not sure why the Github Classroom autograder is rejecting my work, even though my code works fine on my local machine.

I've pushed the entire thing to the Github Classroom, so I don't see why there would be a build error.

Therefore, I am stuck on Week 2 Ex 2. Why is this?

Leeyp commented 3 years ago

Update: I have completed Week 2 Ex 3 and Ex 4 with no issue, it is only Ex 2 that is having issue. I'm confused at why this is the case, could it be because of the risk of invalid input in args?

Thanks for viewing.

kwokyto commented 3 years ago

as prof said in the other thread, try checking for null and return nothing

Leeyp commented 3 years ago

as prof said in the other thread, try checking for null and return nothing

I did that, but it seems like my autograder is still rejecting my answer, for some reason. :<

Leeyp commented 3 years ago

as prof said in the other thread, try checking for null and return nothing

Okay, did a bit more googling and managed to solve it. Apparently, in Java, having null arguments is not equivalent to having 0 arguments. 👎 Learnt something new about Java today!

Though, it is a bit too tricky to be the second testcase overall for this course :(