diff --git a/org.eventb.texttools/src/org/eventb/texttools/PersistenceHelper.java b/org.eventb.texttools/src/org/eventb/texttools/PersistenceHelper.java index 2b8cf287a929c5864a22ab2e58e5b78572c80da4..d7de9f418fe58fcd510d51283b7033682608d89e 100644 --- a/org.eventb.texttools/src/org/eventb/texttools/PersistenceHelper.java +++ b/org.eventb.texttools/src/org/eventb/texttools/PersistenceHelper.java @@ -159,58 +159,46 @@ public class PersistenceHelper { final EventBNamedCommentedComponentElement oldVersion, final EventBNamedCommentedComponentElement newVersion, final IProgressMonitor monitor) { - try { - long time0 = System.currentTimeMillis(); - - IComparisonFactory comparisonFactory = new DefaultComparisonFactory( - new DefaultEqualityHelperFactory()); + long time0 = System.currentTimeMillis(); - IEObjectMatcher matcher = DefaultMatchEngine - .createDefaultEObjectMatcher(UseIdentifiers.NEVER); + IComparisonFactory comparisonFactory = new DefaultComparisonFactory( + new DefaultEqualityHelperFactory()); - final IMatchEngine eventBMatchEngine = new EventBMatchEngine( - matcher, comparisonFactory); + IEObjectMatcher matcher = DefaultMatchEngine + .createDefaultEObjectMatcher(UseIdentifiers.NEVER); - IMatchEngine.Factory matchEngineFactory = new MatchEngineFactoryImpl() { - @Override - public IMatchEngine getMatchEngine() { - return eventBMatchEngine; - } - }; - matchEngineFactory.setRanking(20); - IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl(); - matchEngineRegistry.add(matchEngineFactory); - EMFCompare comparator = EMFCompare.builder() - .setMatchEngineFactoryRegistry(matchEngineRegistry).build(); + final IMatchEngine eventBMatchEngine = new EventBMatchEngine(matcher, + comparisonFactory); - IComparisonScope scope = new DefaultComparisonScope(oldVersion, - newVersion, null); + IMatchEngine.Factory matchEngineFactory = new MatchEngineFactoryImpl() { + @Override + public IMatchEngine getMatchEngine() { + return eventBMatchEngine; + } + }; + matchEngineFactory.setRanking(20); + IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl(); + matchEngineRegistry.add(matchEngineFactory); + EMFCompare comparator = EMFCompare.builder() + .setMatchEngineFactoryRegistry(matchEngineRegistry).build(); - Comparison comparison = comparator.compare(scope); + IComparisonScope scope = new DefaultComparisonScope(oldVersion, + newVersion, null); - List<Diff> differences = comparison.getDifferences(); + Comparison comparison = comparator.compare(scope); - Registry registry = RegistryImpl.createStandaloneInstance(); - BatchMerger bm = new BatchMerger(registry); + List<Diff> differences = comparison.getDifferences(); - bm.copyAllRightToLeft(differences, null); + long time1 = System.currentTimeMillis(); + Registry registry = RegistryImpl.createStandaloneInstance(); + BatchMerger bm = new BatchMerger(registry); - System.out.println("LeFuck"); + bm.copyAllRightToLeft(differences, null); - // final ModelMerge merge = new ModelMerge(oldVersion, newVersion); - long time1 = System.currentTimeMillis(); - // merge.applyChanges(monitor); - long time2 = System.currentTimeMillis(); - if (DEBUG) { - System.out.println("new ModelMerge: " + (time1 - time0)); - System.out.println("merge.applyChanges: " + (time2 - time1)); - } - if (3 == 2 * 5) { // FIXME temp fix for dead code - throw new InterruptedException(); - } - } catch (final InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + long time2 = System.currentTimeMillis(); + if (DEBUG) { + System.out.println("new ModelMerge: " + (time1 - time0)); + System.out.println("merge.applyChanges: " + (time2 - time1)); } }