{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreian6rzku3ekyiykcrt4l2kex5d4mq427jas3swjysfxllluizh2jq",
    "uri": "at://did:plc:vyjlfm46mfv6u4vjp6qtrfx2/app.bsky.feed.post/3ml4sdn6zl262"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreidg2k33tiuupnstmiowh7hyyvtsbe3gyhfygiytrzynysnhoctrxi"
    },
    "mimeType": "image/jpeg",
    "size": 81260
  },
  "path": "/articles/not-for-nullthing",
  "publishedAt": "2026-05-05T06:30:00.000Z",
  "site": "https://thedailywtf.com",
  "tags": [
    "CodeSOD",
    "who is a real person",
    "Download our guide to learn the best practice of NuGet for the Enterprise."
  ],
  "textContent": "Today's anonymous submitter sends us some code that just makes your mind go… blank when you look at it.\n\n\n    \tpublic static boolean isNull(String value) {\n    \t\treturn StringUtils.isBlank(value);\n    \t}\n\n\n`StringUtils.isBlank` comes from the Apache Commons library. It's a helper function for Java which returns true if a string is, well, _blank_. \"Blank\" in this case is: empty, null, or only whitespace. So it's important to note that `isBlank` may return `true` on a `null`, but it _isn't_ truly a null-check, so wrapping it in `isNull` is just confusing.\n\nBut imagine I've got another problem. Let's say I have a database that's been poorly normalized and maintained. And so I have a bunch of fields that maybe are `null`, but some also maybe contain the _string_ `\"null\"`. What am I going to do then? I need another function.\n\n\n    \tpublic static boolean isNullAndNull(String value) {\n    \t\treturn isNull(value) && \"null\".equalsIgnoreCase(value);\n    \t}\n\n\nAh yes, `isNullAndNull`, the clearest and easiest name I could imagine for this. It tells me exactly what the function is checking: is it null, and is it also null? We add a second check to our `isNull` call- we check if the input value matches the string `\"null\"`. Except we're `&&`ing the conditions together. So this function will always return false. It can't both be blank _and_ contain the string `\"null\"`.\n\nWhich means Jennifer Null, who is a real person, can breathe easy. This version of a null check won't think she's nothing.\n\n[Advertisement] Picking up **NuGet** is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.",
  "title": "CodeSOD: Not for Nullthing"
}