Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4088100

wasteful code in ResourceBundle.java

XMLWordPrintable



      Name: sg39081 Date: 10/22/97


      There is a routine called debug() in resource
      bundle which is called with debug strings. Those
      strings are allocated, and loaded into the class's
      constant pool, but never printed out because
      debugging is turned off.

      A better way to do debugging is:

          if (debug) {
               print your debugging output;
          }

      where debug is declared as

          static final boolean debug = false | true;

      That way the compiler deletes the code, and the
      string constants, and the string allocation from
      the resulting code when debugging is turned off.


      This is just a suggestion. Thanks for listening.
      ======================================================================

            rgillamsunw Richard Gillam (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: