Control flow graph





  •  That reminds me of a part of an open source project I found that had an interface for IO, but it was only defined inside the static blocks at the top of three seperate classes where it was assigned to a public static variable in a class in another package.  That class defined several functions with exactly the same names that just called the methods from that instance.  In the classes where the instances were defined the definition just called several static functions that were defined inside.  They all had conditional statements that took one of 3 different paths depending on the  static state data that was scattered throughout the class. Some of it was public some wasn't.  Of the three different conditions most of the functions couldn't use anything.  A parameter that was passed into a function as String a was used as either a file extension , as a part of a conditional statement or a parameter for an applet depending on on what one of the static variables was set to. 

    One of the functions in some cases returned an IOStream  that was overridden and named the same as the library class so that it contained a File.  The only place it was called the caller just copied the reference to the file and never used the stream. 

     

    By the way, how did you make that.



  • @Chame1eon said:

    By the way, how did you make that.

    go tool pprof


Log in to reply