223

Logic Gem found at work today.

if (value != null) {
return value;
} else {
return null;
}

😂 😂😂😂😂😂

Comments
  • 2
    Its actualli code of guava Optional class.
  • 1
    @insane guava has that? Isn't that made by Google? No wonder angular (also by google) seems so convoluted at times.
  • 1
    @Yankeesrule optional class is kind of best shot for finding a matching object in collection. If its missing. It always returns optional object , but it is absent. And method isPresent returns false.
  • 1
    @insane FYI that is built into Java 8 now. And integrated with spring data which is very convenient
  • 1
    @Yankeesrule yup i know. They like to steal all the good ideas. However they Data object still sucks so much.
  • 1
    Was this dev trying to fill up space with unnecessary code ;O
    Useless
  • 1
    @geeknat I dont know if self promotion is allowed on here (I assume not), but why would we use your app if we already have devRant? Redundant at launch, not a very good development strategy.
  • 0
    @nicnaknic Sorry about that. I've deleted the comments.
  • 1
    During a code review I saw something like this:
    Obj myObj = something.getObject();
    if(myObj == null) throw new NullPointerException();

    You did it again, Junior...
  • 1
    How does interviewing at your place work exactly... To have such employees
Add Comment