Ostrava
From APIDesign
Line 1: | Line 1: | ||
- | [[Ostrava]] is 3rd largest town in Czech Republic. I'll be in [[wikipedia:Ostrava|Ostrava]] at [http://java.cz/article/czjug-ostrava-brezen-2011 JUG meeting] on Mar 2nd, 2011. I'll talk about [[paradox]]es, in a shorter version of the [[ParadoxesVideo]]. Stop by and get a chance to win [[TheAPIBook]]. I am not sure what will be the final quiz to win [[TheAPIBook]], but I'd suggest following one: Can you write a code that | + | [[Ostrava]] is 3rd largest town in Czech Republic. I'll be in [[wikipedia:Ostrava|Ostrava]] at [http://java.cz/article/czjug-ostrava-brezen-2011 JUG meeting] on Mar 2nd, 2011. I'll talk about [[paradox]]es, in a shorter version of the [[ParadoxesVideo]]. Stop by and get a chance to win [[TheAPIBook]]. I am not sure what will be the final quiz to win [[TheAPIBook]], but I'd suggest following one: Can you write a code that throws ''NullPointerException'' directly from the following ''Interval'' class? |
<source lang="java" snippet="interval.api"/> | <source lang="java" snippet="interval.api"/> |
Revision as of 19:22, 3 March 2011
Ostrava is 3rd largest town in Czech Republic. I'll be in Ostrava at JUG meeting on Mar 2nd, 2011. I'll talk about paradoxes, in a shorter version of the ParadoxesVideo. Stop by and get a chance to win TheAPIBook. I am not sure what will be the final quiz to win TheAPIBook, but I'd suggest following one: Can you write a code that throws NullPointerException directly from the following Interval class?
does not exists: interval.api
I tried to follow all the good advices of TheAPIBook. I made the class final, I check for wrong arguments. My internal state is immutable. I guard myself against mutability of Date. Is it really bullet proof code?
Indeed it is not. As about five people during my Paradoxes talk in Ostrava found out (and as few of you commented online), one can subclass Date and override clone method to return null:
does not exists: interval.exploit
This is an interesting way to break many solid APIs. The trick has been invented by the HP guys when they played their HPAPIFest09. I am glad Ostrava discovered the magic as well.