[ https://issues.apache.org/jira/browse/CAMEL-12726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16577004#comment-16577004 ]
ASF GitHub Bot commented on CAMEL-12726: ---------------------------------------- GitHub user hiroakiy opened a pull request: https://github.com/apache/camel/pull/2467 CAMEL-12726: Fix FindBugs warnings: Invocation of toString on an array FindBugs-3.0.1 ([http://findbugs.sourceforge.net/](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](http://findbugs.sourceforge.net/bugDescriptions.html#DMI_INVOKING_TOSTRING_ON_ARRAY) You can merge this pull request into a Git repository by running: $ git pull https://github.com/hiroakiy/camel CAMEL-12726 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/2467.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2467 ---- commit 28627fe3301f8e5854194c92bdf4d961996d6e92 Author: Hiroaki Yoshida <hyoshida@...> Date: 2018-08-11T01:33:09Z CAMEL-12726: Fix FindBugs warnings: Invocation of toString on an array ---- > FindBugs warnings: Invocation of toString on an array > ----------------------------------------------------- > > Key: CAMEL-12726 > URL: https://issues.apache.org/jira/browse/CAMEL-12726 > Project: Camel > Issue Type: Bug > Components: camel-box, camel-core, camel-jsch > Reporter: Hiroaki Yoshida > Priority: Major > > FindBugs-3.0.1 ([http://findbugs.sourceforge.net/]) reported 4 > DMI_INVOKING_TOSTRING_ON_ARRAY warnings on master: > {code:java} > 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] > {code} > The description of the bug is as follows: > {quote}*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] > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)