Menu

#1556 [java] UseLocaleWithCaseConversions does not works with `ResultSet` (false negative)

PMD-5.4.4
closed
None
PMD
3-Major
Bug
5.5.1
UseLocaleWithCaseConversions
2017-01-08
2016-12-12
No

In the following code does not reports any warning:

import java.sql.*;

final class Test {
  private Test() { }

  public static String foo(ResultSet r) throws SQLException {
    return r.getString("bar").toLowerCase();
  }
}

while FindBugs 3.0.1 reports the following:

DM_CONVERT_CASE: Consider using Locale parameterized version of invoked method

A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

String.toUpperCase( Locale l )
String.toLowerCase( Locale l )

versions instead.

Discussion

  • Andreas Dangel

    Andreas Dangel - 2017-01-08
    • summary: UseLocaleWithCaseConversions does not works with ResultSet --> [java] UseLocaleWithCaseConversions does not works with ResultSet
    • assigned_to: Andreas Dangel
     
  • Andreas Dangel

    Andreas Dangel - 2017-01-08
    • summary: [java] UseLocaleWithCaseConversions does not works with ResultSet --> [java] UseLocaleWithCaseConversions does not works with ResultSet (false negative)
     
  • Andreas Dangel

    Andreas Dangel - 2017-01-08
    • status: open --> closed
    • Milestone: New Tickets --> PMD-5.4.4
     
  • Andreas Dangel

    Andreas Dangel - 2017-01-08

    This will be fixed with PMD 5.4.4, 5.5.3 and later.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.