Why Java Sucks

Today I stumbled across a bug in the java file handling on windows. On Windows you can have multiple Strings denoting the same file. Like “TEST.txt” and “test.txt”. If you create two file Objects with different names accessing the same file and compare the objects using equals you will get false.

You should read the answer. There’s a workaround, but it kills all the nice things about OO. So now I can’t do a List.contains(myFile), because the List implementation uses the equals method. But as in so many cases they don’t get it.


Posted

in

,

by

Tags:

Comments

One response to “Why Java Sucks”

  1. eisbär Avatar
    eisbär

    Sieht sehr gut aus. Aber Du wirst staunen: ich habe in den fünf Jahren in der Entscheidungsfindung über meinen Fahrradkauf (lag zwischendurch brach) auch über Indigo- Gelb oder Rot, kombiniert mit schwarz nachgedacht.
    Aber ich bin halt doch beruflich belastet, ich gebe es zu und gratuliere Dir zu Deinem neuen – alten Fahrrad!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.