assertj icon indicating copy to clipboard operation
assertj copied to clipboard

different case "NewLines" and "Newlines" in similar assertions

Open Bananeweizen opened this issue 3 years ago • 4 comments

There are multiple assertions on CharSequence that allow ignoring or normalizing newlines. Unfortunately those methods differ in their writing of "newline" as part of the method name. E.g. when editing code to switch between these 2 methods, it is not sufficient to exchange Ignoring by Normalizing, you rather also have to switch between uppercase and lowercase L:

isEqualToIgnoringNewLines isEqualToNormalizingNewlines

It seems reasonable to deprecate and rename all methods containing NewLines to instead use the more common Newlines. (I have not checked if the same problem appears outside CharSequence assertions)

  • assertj core version: 3.23.1
  • no test case

Bananeweizen avatar Aug 29 '22 08:08 Bananeweizen

fair enough, will keep the existing assertion for backward compatibility

joel-costigliola avatar Aug 29 '22 12:08 joel-costigliola

Hi, can I work on this one?

icod avatar Sep 05 '22 14:09 icod

Sure and thanks, @icod!

scordio avatar Sep 05 '22 20:09 scordio

@joel-costigliola, Cool!

A few questions:

  • Should I use the 'since' parameter in the @Deprecated annotation? And if so, which version should I use?
  • What to do which the Javadoc of the deprecated public methods? The new method will have the correct Javadoc ('Newlines'). The old one can just have no Javadoc other than a @deprecated Please use... instead., right?
  • Should there still be unit tests for the deprecated public methods?

icod avatar Sep 09 '22 13:09 icod