19
fgysin
6y

Two actual lines of code I stumbled upon...

static ArchiveAbstract ARCHIVE_TRUE = new ArchiveTrue();
static ArchiveAbstract ARCHIVE_FALSE = new ArchiveFalse();

Ok you might think, what is going on? Searching for it's usage yields exactly a single case:

if(someVar instanceof ArchiveTrue ? true : false)

So someone managed to introduce 3 new classes... instead of using a simple boolean.
(╯°□°)╯︵ ┻━┻

Comments
  • 0
    Ha! Was this mid development or in release?

    I’ve actually done a similar thing myself in the past at dev phase to stop compiler warnings etc. when I’m trying to force behaviour one way or the other but without having the actual Boolean hooked up. Always wrapped them in debug compiler constants though to prevent bleed into released code.
  • 1
    Even the condition is triggering
Add Comment