OT: Patches class, look over

Offtopic, maybe, but constructions like:

"false".equalsIgnoreCase(System.getProperty("idea.debugger.keep.temp.objects"))

Is just

!Boolean.getBoolean("idea.debugger.keep.temp.objects")

Thanks
--
Alexey Efimov, Java Developer
Tops BI


2 comments
Comment actions Permalink

True, but I'd argue that the first is clearer, since 9 Java programmers out of 10 don't know what Boolean.getBoolean() does, and would be somewhat shocked if you told them. There is now an inspections for those stealth system properties methods, with quickfixes to turn them into the more reasonable (if more verbose) alternatives.

--Dave Griffith

0
Comment actions Permalink

Hello Dave,

DG> True, but I'd argue that the first is clearer, since 9 Java
DG> programmers out of 10 don't know what Boolean.getBoolean() does, and
DG> would be somewhat shocked if you told them. There is now an
DG> inspections for those stealth system properties methods, with
DG> quickfixes to turn them into the more reasonable (if more verbose)
DG> alternatives.

The troubles with getBoolean is for beginner:
Boolean.getBoolean("true") == false :) And it not clear, that you should
translate it into "true".equalsIgnoreCase(System.getProperty("true")), but
in follow form:
Boolean.getBoolean("idea.is.something") is not very hard to understand that
"idea.is.somthing" is not boolean literal expression.

Thanks!
--
Alexey Efimov, Java Developer
Tops BI


0

Please sign in to leave a comment.