Closed GoogleCodeExporter closed 9 years ago
Original comment by kurt.kluever
on 30 Apr 2013 at 6:22
Maybe naming the method checkedGet(String message) would be more clear to a
reader.
Original comment by d...@iq80.com
on 30 Apr 2013 at 6:23
Interesting...What do you do with the exceptions/error messages? Presumably
they get caught at a higher level and logged? Are you concerned about
debugging (and in that case, isn't the stack trace enough)?
Original comment by kurt.kluever
on 30 Apr 2013 at 6:24
From my POV this is a convenience method which can be used for instance to
return a more descriptive error message to a user (instead of get called on
absent). BTW other frameworks provide this functionality too:
https://github.com/functionaljava/functionaljava/blob/master/core/src/main/java/
fj/data/Option.java#L183.
Original comment by hammersc...@gmail.com
on 7 Feb 2014 at 12:51
Your example is of using a fixed literal string, which conveys no additional
information that the combination of stack trace and API docs don't already
provide. To us, that's not enough motivation. Why bother providing these
strings? The audience for them is an engineer who's going to have to look at
the code regardless.
The real motivation to do this would be if you commonly have data you need to
supply to that string, but in that case, the message construction features of
Preconditions are useful to have anyway.
Original comment by kevinb@google.com
on 10 Feb 2014 at 6:12
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
electrum
on 30 Apr 2013 at 6:20