Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12726

FindBugs warnings: Invocation of toString on an array

    XMLWordPrintableJSON

Details

    • Patch Available
    • Unknown

    Description

      FindBugs-3.0.1 (http://findbugs.sourceforge.net/) reported 4 DMI_INVOKING_TOSTRING_ON_ARRAY warnings on master:

      H C USELESS_STRING: Invocation of toString on org.apache.camel.processor.RemoveHeadersProcessor.getExcludePattern() in new org.apache.camel.management.mbean.ManagedRemoveHeaders(CamelContext, RemoveHeadersProcessor, ProcessorDefinition)  At ManagedRemoveHeaders.java:[line 37]
      H C USELESS_STRING: Invocation of toString on org.apache.camel.processor.RemovePropertiesProcessor.getExcludePattern() in new org.apache.camel.management.mbean.ManagedRemoveProperties(CamelContext, RemovePropertiesProcessor, ProcessorDefinition)  At ManagedRemoveProperties.java:[line 37]
      M C USELESS_STRING: Invocation of toString on ScpConfiguration.getPrivateKeyBytes() in org.apache.camel.component.scp.ScpOperations.createSession(ScpConfiguration)  At ScpOperations.java:[line 262]
      M C USELESS_STRING: Invocation of toString on path in org.apache.camel.component.box.api.BoxFoldersManager.createFolder(String, String[])  At BoxFoldersManager.java:[line 204]
      

      The description of the bug is as follows:

      USELESS_STRING: Invocation of toString on an array (DMI_INVOKING_TOSTRING_ON_ARRAY)
      The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.
      http://findbugs.sourceforge.net/bugDescriptions.html#DMI_INVOKING_TOSTRING_ON_ARRAY

      Attachments

        Activity

          People

            aldettinger Alex Dettinger
            hiroakiyoshida Hiroaki Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: