Page 1 of 1

About Question enthuware.jwpv6.2.1059 :

Posted: Sun Jun 02, 2013 11:21 am
by jmkenny
Hi,

I just have a question regarding the correct answer of this question.

Code: Select all

String user = loginUser(req);
You said "Assuming loginUser() and generateReport() are valid methods". This does not guarantees that loginUser(req) will never return null. In this case (returns null), even if the LoginServlet receives a post first, generateReport() will not be executed.

So, unless loginUser() can never return null (which should be mentionned), the answer selected is not always the correct one.

Thanks!

Re: About Question enthuware.jwpv6.2.1059 :

Posted: Sun Jun 02, 2013 11:47 am
by admin
That is correct and that is what you expect from the code to do as well. The fact that you need userid to be not null is evident in the give code itself. So it need not be stated explicitly.

HTH,
Paul.

Re: About Question enthuware.jwpv6.2.1059 :

Posted: Sun Jun 02, 2013 12:27 pm
by jmkenny
Why are we supposed to make such assumptions ourserlves?
In the tests, you always mention things like "assuming xxx is correct...". Why do you bother with such statements?

Re: About Question enthuware.jwpv6.2.1059 :

Posted: Sun Jun 02, 2013 4:58 pm
by admin
The assumptions are stated for things that are not reflected in the given code. For example, the code doesn't show loginUser method anywhere, so it is given in the problem statement that this method is valid.

HTH,
Paul.