Currently i'm creating a modell with modello which contains a name of a class Name which results in the following code generation (Xpp3Reader):
private Name parseName( XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
Name name = new Name();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
{
String name = parser.getAttributeName( i );
String value = parser.getAttributeValue( i );
if ( name.indexOf( ':' ) >= 0 )
{
// just ignore attributes with non-default namespace (for example: xmlns:xsi)
}
else if ( "id".equals( name ) )
{
name.setId( interpolatedTrimmed( value, "id" ) );
}
else
{
checkUnknownAttribute( parser, name, tagName, strict );
}
}
The problem is the name for name which is used. This will produce a clash with the attribute name. I would suggest to change the code generation to use attributeName instead of name which will reduce the possibility of a name clash. Maybe the name before the for loop schould be changed into something like className = new XYZ() ?
Currently i'm creating a modell with modello which contains a name of a class
Name
which results in the following code generation (Xpp3Reader):The problem is the name for
name
which is used. This will produce a clash with the attribute name. I would suggest to change the code generation to useattributeName
instead ofname
which will reduce the possibility of a name clash. Maybe the name before thefor
loop schould be changed into something likeclassName = new XYZ()
?Here the culprit model: