No. That method "creates" the zip file using the tried and tested Java API.
I want to do the thing before the snapshot happens for one reason: taking a
snapshot takes time. And changes can happen between the time I say to take
a snapshot and the time I record the snapshot. So, to guarantee that I will
not events between the time I say I want to take a snapshot and the actual
recording, I am doing this as early as possible. I prefer it this way. I
would rather have a broken snapshot every now and then (which would be
broken anyway), than having to figure out which events we should not apply
to get to the state of the snapshot.

We also had a similar discussion of the eclipse one. It's better to record
early than deal with the multitude of things than can happen in the time
between the snapshot and the recording

-Caius


On Fri, Apr 18, 2014 at 6:34 PM, Mihai Codoban <notifications@github.com>wrote:

> In
> edu.oregonstate.cope.intellij.recorder/src/edu/oregonstate/cope/intellij/recorder/EclipseExporter.java:
>
> > +        this.project = project;
> > +        this.localStorage = localStorage;
> > +        this.recorder = recorder;
> > +    }
> > +
> > +    public void export() {
> > +        Module[] modules = ModuleManager.getInstance(project).getModules();
> > +        for (Module module : modules) {
> > +            boolean wasEclipseFriendly = true;
> > +            if (!isModuleEclipseFriendly(module)) {
> > +                makeModuleEclipseFriendly(module);
> > +                wasEclipseFriendly = false;
> > +            }
> > +            String storageRoot = getStorageRoot(module);
> > +            File zipFile = createZipFile(module.getName(), localStorage);
> > +            recorder.getClientRecorder().recordSnapshot(zipFile.getAbsolutePath());
>
> wouldn't it be safer to move this line at the end of the for? If something
> goes wrong afterwards you'd have an event pointing to a broken zip.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ChangeOrientedProgrammingEnvironment/intellijRecorder/pull/12/files#r11791790>
> .
>