o Fixed encoding error during unmarshalling

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@749283 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-02 12:01:21 +00:00
parent d0caac9402
commit e7d408fdda
1 changed files with 8 additions and 4 deletions

View File

@ -68,10 +68,14 @@ public class PomClassicDomainModel implements InputStreamDomainModel
public PomClassicDomainModel( List<ModelProperty> modelProperties )
{
this.modelProperties = modelProperties;
try {
inputBytes = IOUtil.toByteArray( ModelMarshaller.unmarshalModelPropertiesToXml(modelProperties, ProjectUri.baseUri));
} catch (IOException e) {
try
{
String xml = ModelMarshaller.unmarshalModelPropertiesToXml( modelProperties, ProjectUri.baseUri );
inputBytes = xml.getBytes( "UTF-8" );
}
catch ( IOException e )
{
throw new IllegalStateException( "Unmarshalling of model properties failed", e );
}
initializeProperties( modelProperties );
}