Uploaded image for project: 'Log Tool'
  1. Log Tool
  2. LOGTOOL-93

Message bundles always use String.format() even if no format is used

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Blocker Blocker
    • 2.1.0.Alpha1
    • None
    • None

      The String.format() should only be used if formatting is needed.

      Interface.java
      @Message("Test message")
      RuntimeException testMessage();
      
      Interface_$bundle.java
      @Override
      public final RuntimeException testMessage() {
          final RuntimeException result = new RuntimeException(String.format(testMessage$str()));
          final StackTraceElement[] st = result.getStackTrace();
          result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
          return result;
      }
      

              jperkins-rhn James Perkins
              jperkins-rhn James Perkins
              Archiver:
              rhn-support-sthamilt Stacey Hamilton

                Created:
                Updated:
                Resolved:
                Archived: