Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GSD doesn't only detect singletons; it detects four different types of global state, including singletons, hingletons, mingletons and fingletons

uhh, what are hingletons, mingletons and fingletons?



From the usage page:

    * Hingleton - Derived from “helper singleton,” a class which turns another class into a singleton by enforcing that class's singularity.
    * Mingleton - Derived from “method singleton” a class which has any static method that returns some state without taking any parameters.
    * Fingleton - Derived from “field singleton,” a class which contains a public static field.


They are defined in the usage wiki: http://code.google.com/p/google-singleton-detector/wiki/Usag...

  Singleton	 A class for which there should only be one instance in the entire system at any given time. This program detects singletons which enforce their own singularity, which means they keep one static instance of themselves and pass it around through a static getter method.

  Hingleton	 Derived from “helper singleton,” a class which turns another class into a singleton by enforcing that class's singularity.

  Mingleton	 Derived from “method singleton” a class which has any static method that returns some state without taking any parameters.

  Fingleton	 Derived from “field singleton,” a class which contains a public static field.


So, GSD is just "grep -r static . | grep -v class" then?


It operates on JVM bytecode, not on java source code.


No.


This is what happens when you let Professor Frink publish papers.


Or Dr. Seuss (PhD?).




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: