News for hackers. Stuff that matters.
Re:Type erasure and reification by bunderbunder on Wednesday December 05, 2018 @03:18PM (#18612078)
As long as you are able to take the same code path for all empty lists, you can do something like

  if (xyz instanceof List) {
    if (xyz.isEmpty()) { ... }
    else if (xyz.get(0) instanceof String) { ... }
    else if (xyz.get(0) instanceof Integer) { ... }
  }
Which, I admit, is a gross hack.

There are no comments on this comment yet.