|
Re: NPE when serializing an in-memory model [message #1122143 is a reply to message #1122115] |
Tue, 01 October 2013 09:10 |
|
Hi,
i guess you need at least a fake resource with a fake uri. (at least when you run this code from ui)
i am not sure if this is to be considered as a bug or not.
e.g.
ResourceSet rs = injector.getInstance(ResourceSet.class);
Resource r = rs.createResource(URI.createURI("fake.mydsl"));
r.getContents().add(model);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
r.save(baos, SaveOptions.defaultOptions().toOptionsMap());
String content = baos.toString("UTF-8");
or you bind a more nullsafe PreferenceStoreWhitespaceInformationProvider
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02273 seconds