• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java is unsound - an interesting article  RSS feed

 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
João told me about that article yesterday. He said it has to do with nulls, so I told him you can do daft things like:-
((Arrays)null).sort(myArray);
I tried the example they showed with the raw type of List and they are incorrect; the code does not type check. As I had expected, the compiler produces a warning. What does Joshua Bloch say in Effective Java? He says you are type‑safe as long as you don't get any warnings and only write @SuppressWarnings when you are absolutely sure about it. I think they are mistaken to imply the compiler is broken.

I shall ask João for the actual paper.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!