You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this use case, I agree with you but we can't delete this rule or change the behaviour for a few special uses cases that don't often occur.
For me, your use case is a real use of array copy with deletion of whitspaces, but it is special uses case.
Generally, our rule implementations don't cover all uses cases and some special use cases can't be implemented.
I think you have to mark this use case as not applicable for the rule with a "// NOSONAR" comment with the explanation at the end of the line where the error occurs.
Did you check if it already exists other "System.arrayCopy" method with different parameters to exclude some elements in the copy ?
This is the only method in System to copy arrays. I'm guessing that the point of it is to copy quickly some memory section, I doubt more evolved versions would make sense.
I will just mark the code smell as false positive.
Describe the bug
EC27 suggests
System.arraycopy
when it is not applicable.Expected behavior
System.arraycopy
should not be suggested when the code inside the loop filters / modifies / ... the values.Screenshots
Software Versions
The text was updated successfully, but these errors were encountered: