← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17770: minor fix, use char array instead of byte array for hex digit validation

 

------------------------------------------------------------
revno: 17770
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-12-22 10:56:13 +0100
message:
  minor fix, use char array instead of byte array for hex digit validation
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java	2014-12-22 09:52:13 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java	2014-12-22 09:56:13 +0000
@@ -396,11 +396,11 @@
             return false;
         }
 
-        byte[] bytes = value.getBytes();
+        char[] chars = value.toCharArray();
 
-        for ( int i = 1; i < bytes.length; i++ )
+        for ( int i = 1; i < chars.length; i++ )
         {
-            if ( !Verifier.isHexDigit( (char) bytes[i] ) )
+            if ( !Verifier.isHexDigit( chars[i] ) )
             {
                 return false;
             }