Hello:

I've got an error "String index out of range: -1" when creating a field (string) for a class with sizeMax to 1.

The problem comes from the DataOnDemand_Roo_DataOnDemand.aj within the test classes.

I assume the problem is in the getNewTransient method, when Roo tries to create a validation for that string's length:

Sample: code created with @Size(max = 2) (Roo cannot create code for @Size(max = 1)
Code:
        String tipo = "_" + index;
        if (tipo.length() > 2) {
            tipo = tipo.substring(0, 2);
        }
I could change manually the @Size annotation (javax.validation.constraints.Size) AND then I would have to copy the getNewTransient method to the IntegrationTest.java in order to avoid Roo manages it.

But I think it's a bug that could be fixed.

Thanks.