• non-javadoc (unregistered)

    public class FristDescriptor extends XMLEntity { public static final String frist = "snecond";

    /**
     * Gets the.
     */
    private static String getFrist() {
        return frist;
    }
    

    }

  • Álvaro González (github)

    What's the deal with (non-Javadoc)?

  • ExceptionHandler (unregistered)
    Comment held for moderation.
  • Duke of New York (unregistered)

    Should have been called the Highlander pattern imo.

  • ExceptionHandler (unregistered) in reply to Duke of New York
    Comment held for moderation.
  • (nodebb) in reply to Álvaro González

    My guess is that they added that note because the comment there begins with /* instead of /**, so it's not parsed as Javadoc by the Javadoc tooling. But as for why they did that, ¯_(ツ)_/¯

  • SingleBecauseTon (unregistered)
    Comment held for moderation.
  • (nodebb)

    Java has a much cleaner way to execute a block of code that initializes static data: a static initializer block. The ugly private singleton is unnecessary.

    Addendum 2025-07-15 12:51: Also, TRWTF is that failing to parse the XML from the classpath resource just logs the exception and merrily carries on. So if the classpath resource is missing or corrupted, the map will not be populated and this will be discovered much later at runtime, rather than at startup time. It's better for a faulty application to fail at startup than to start but work incorrectly.

  • (nodebb) in reply to Álvaro González

    What's the deal with (non-Javadoc)?

    It's a comment generated by an IDE. It's not a documentation comment, so it won't get included in generated documentation, but it includes a link to the superclass declaration of the method, which is then displayed (I think) in the popup you get by hovering over the method in the IDE. It's for easy navigation from the subclass to the superclass.

  • Rob (unregistered)

    This class is a real WTF. Both BatchManager and BatchDescriptor extend XMLEntity which apparently makes them implement org.xml.sax.ContentHandler indirectly, because the singleton BatchManager instance is used as one in the constructor. For the BatchManager that's probably not that bad because there's no possibility to get an instance (other than using reflection), but BatchDescriptor instances are exposed to the outside world. That means they can be used has ContentHandler for any random XML document. That in turns allows anyone to update their internals, because that's what the content-handling part does.

    A properly written class would have created (package) private ContentHandler implementations instead so the parsing logic doesn't escape the class.

Leave a comment on “Born Single”

Log In or post as a guest

Replying to comment #:

« Return to Article