There are many uses of compareTo, like "str1.compareTo(str2) == 0" which can be replaced with there better understandable equivalents "str1 == str2" or "str1.equals(str2)". Here are two grep statements to find some of them: git grep '\.compareTo\s*([^)]*)\s*==\s\(0\|COMPARE_EQUAL\)' -> lhs.Name.compareTo(rhs) == 0 git grep '\(0\|COMPARE_EQUAL\)\s*==\s*[a-zA-Z0-9]\+\.compareTo\s*([^)]*)' -> 0 == url.compareTo( EXPAND_PROTOCOL ":" ) Those could be replaced with "str1 == str2". There are many other uses like with != and more. If you need help to find them or to adapt the grep statements please ask me!
...but be aware that the two-parameter form of compareTo is more related to startsWith and to operator ==
(In reply to comment #1) > ...but be aware that the two-parameter form of compareTo is more related to > startsWith and to operator == *than* to operator ==
Efe Gürkan YALAMAN committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=52770659d33f8f08a769043392cfb5a926019fef fdo#62096 Replace O(U)String compareTo with == The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
This commit wasn't notified automatically: http://cgit.freedesktop.org/libreoffice/core/commit/?id=e1f6dac6893e0ad9e1b1f03a3b882cf1e9a08d32
Prashant Pandey committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8398d5d9ac0f169ee7a045f6677919c79a5cbe0f fdo#62096: Replaced some OUString 'compareTo' with '==' The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Artur Dryomov committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b80d8c695e6b6ded231e67ed9a80bcd1f1250c03 fdo#62096 - replace some O(U)String compareTo with == The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Janit Anjaria committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f51450717d4e639bd8af81c7d1ed13cc08e57e22 fdo#62096 Replace OUString compareTo with == operator The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Janit Anjaria committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b444e459c8a3e39c36e7cf6854bd1eae92b0e81a fdo#62096 Replace O(U)String compareTo with == The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sameer Deshmukh committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=560e4fd02f8a4a3e26b3810b12d02a2d2e78593f fdo#62096 - Changed a few compareTo's to '==' The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sameer Deshmukh committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ca54015d7ea10f5648bccb2adfb7a321747e70f9 fdo#62096 Corrected stupid error in previous patch The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Sameer Deshmukh committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=dd47994722eaead16099145e593fbf878072d52b fdo#62096: Replaced some compareTo with == The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Fridrich Å trba committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ff4464659ec54732c45729ace964d60e77d19eb2 Revert "fdo#62096: Replaced some compareTo with ==" The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thomas, can this bug be considered as fixed? I cannot find anything using your grep statements at master.
Wonderful :) I'm closing it.
Migrating Whiteboard tags to Keywords: (EasyHack,SkillCpp,TopicCleanup,DifficultyBeginner ) [NinjaEdit]