Skip to content
Snippets Groups Projects
Commit 02b9820e authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Added control of ModelID string length

parent e76e0719
Branches
Tags
No related merge requests found
......@@ -39,7 +39,16 @@ public class ModelId {
this.setId(theId);
}
private void setId(String theId) {
private void setId(String theId){
theId = theId.trim();
if(theId.length() < 10)
{
theId = theId + new String(new char[10-theId.length()]).replace("\0", "X");
}
else if(theId.length() > 10)
{
theId = theId.substring(0, 10);
}
this.id = theId.toCharArray();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment