Community
Participate
Working Groups
the current infrastructure for refactoring seems to create temporary projects (copying existing pom files) for the purpose of creating a Change without modifying the original file.
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 ***
Moved to https://github.com/eclipse-m2e/m2e-core/issues/