| Summary: | refactoring performance - creation of temp projects questionable | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Milos Kleint <mkleint> |
| Component: | m2e | Assignee: | Project Inbox <m2e.core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | igor, matthew |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Milos Kleint
the whole infrastructure can be replaced by something along these lines (on condition of leaving the EMF models behind and using the PomEdits infrastructure:
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
CompositeChange res = new CompositeChange(getName());
IStructuredModel model = null;
try {
model = StructuredModelManager.getModelManager().getModelForRead(file);
IDocument document = model.getStructuredDocument();
IStructuredModel tempModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(
"org.eclipse.m2e.core.pomFile");
tempModel.getStructuredDocument().setText(StructuredModelManager.getModelManager(), document.get());
IDocument tempDocument = tempModel.getStructuredDocument();
performOnDOMDocument(new OperationTuple((IDOMModel) tempModel, new Operation() {
public void process(Document document) {
//TODO
}));
ChangeCreator chc = new ChangeCreator(file, document, tempDocument, getName());
res.add(chc.createChange());
} catch(Exception exc) {
LOG.error("", exc);
} finally {
if(model != null) {
model.releaseFromRead();
}
}
return res;
}
This should be fixed for the Exclude refactoring by the patch in bug 336580 as per last comment *** This bug has been marked as a duplicate of bug 336580 *** |