Skip to content
Snippets Groups Projects
Commit 3aeb2e0c authored by ribeaudc's avatar ribeaudc
Browse files

[LMS-117]

change:
- Make 'createLocationFromMatrixCoordinate' more robust.

SVN: 2926
parent d089f63a
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,9 @@ public final class Location ...@@ -75,7 +75,9 @@ public final class Location
} }
try try
{ {
final int y = split[0].toLowerCase().charAt(0) - 96; final String letter = split[0];
assert letter.length() == 1 : "Only one letter is supported right now.";
final int y = letter.toLowerCase().charAt(0) - 'a' + 1;
final int x = Integer.parseInt(split[1]); final int x = Integer.parseInt(split[1]);
return new Location(x, y); return new Location(x, y);
} catch (NumberFormatException ex) } catch (NumberFormatException ex)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment