DESCRIPTION

Add support for saving perf stat sessions.

* Created abstract class to handle common functionality of save commands.
* Refactored PerfSaveSessionHandler to make use of abstract class.
* Reimplemeted PerfSaveSessionHandler to copy data file instead of renaming.
* Implemented tests for covering saving functionality.

Change-Id: I4da01e98f83232841d2d1b1b1ada639544ecfd2f


COMMENTS

author: Octavio Lucero
date: 2013-03-06 17:56:20.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2013-03-06 17:56:25.000000000

Patch Set 4:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/1597/ 

-------------------------------------
author: Octavio Lucero
date: 2013-03-06 17:57:04.000000000

Patch Set 4:

Removed trailing whitespace, fixed typo in commit message.

-------------------------------------
author: Brenden Conley
date: 2013-03-06 18:09:45.000000000

Patch Set 4: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/1597/ : SUCCESS

-------------------------------------
author: Nathanael Holden
date: 2013-03-06 19:48:33.000000000

Patch Set 4: I would prefer that you didn't submit this

(6 inline comments)

Just some issues to fix.

Line:48, perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfSaveSessionHandler.java -> This 'else' and the exception caught below seem to do the same thing.. handling a failed copy.

Line:70, perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfSaveSessionHandler.java -> Maybe copyFile shoudn't return a boolean. It will never return false from what I see.. If there's failure, it just expects the exception to be caught.

Line:79, perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfSaveSessionHandler.java -> Correction : '!= -1'

Line:79, perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfSaveSessionHandler.java -> I think this should be '!= 1' since that's the case when EOF is reached.

Line:83, perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfSaveSessionHandler.java -> If an IOException is thrown above hear, then the resources never have a chance to be closed. See PerfSaveStatsHandler for how to handle this case. You could also have the error dialog be opened here, instead of above.

Line:52, perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfSaveStatsHandler.java -> No need to print here. Just leave a comment about how there's nothing to be done in that case.

-------------------------------------
