Along with @maciejwolczyk we’ve been training a neural network that learns how to play NetHack, an old roguelike game, that looks like in the screenshot. Recently, something unexpected happened.

  • spongebue@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    1 month ago

    Java was giving a no such method exception at runtime, but it compiled fine. Granted, that method was recently added to the class, but it was pretty simple and again, you’d expect the compiler to detect things like that.

    Turns out the code I inherited from a not-great team had that class in two different places. Maven replaced the one I worked on with the untouched copy, which went into the build.

    • Nithanim@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      Yeah, if you get this exception and not doing anything not-“normal” then the chance is high that there are multiple versions of the same class. A possible way to trigger this is when extracting code to a separate module without changing the package. If you copy instead of move and change something you will have a bad time. It is also possible that the IDE complains but building and executing works.

      Fun times!