Integrated Source Code And Bytecode Viewer

  Wherever applicable, JProfiler provides access to the source code as well as the bytecode of profiled classes and displays them in a source and bytecode viewer frame. The source and bytecode viewer has two tabs, one for source code and the other for bytecode. Both tabs display the same class. Invoking the source and bytecode viewer through the  Show source action in the View menu or context menu displays the frame with the source tab activated, the  Show bytecode action activates the bytecode tab first.

To be able to show the source code of a class, the source must be available from the source path of the session. To be able to jump directly to the chosen method in the source code viewer and to display the bytecode of a class, the class file must be available from the class path of the session. Changes in class path and source path for an active session are recognized immediately by the source and bytecode viewer.

  The source code tab has a method selector combo box displaying the file structure of the source file, including inner classes and other top level classes. When selecting a method, the bytecode viewer opens the class file tree at the corresponding position. The tool bar actions allow you to copy text to the clipboard and search for text in the source file.
  The bytecode of a class is displayed in a tree showing
  • General information
  • Constant pool
  • Interfaces
  • Fields
  • Methods
  • Class file attributes
If you look for the bytecode, select the "Code" child of the desired method. The bytecode viewer is extensively hyperlinked, allowing you to navigate easily to constant pool entries or branch targets and go back and forth in your navigation history with the   navigation controls at the top of the tab.
  Note: When JProfiler is started through an IDE integration, the integrated source code viewer is not used and the source element is displayed in the IDE.