CodingSpectator icon indicating copy to clipboard operation
CodingSpectator copied to clipboard

Match up CodingSpectator and CodingTracker events

Open reprogrammer opened this issue 13 years ago • 5 comments

Write a program that enables us to compare the performed refactoring events of CodingSpectator and CodingTracker by matching the corresponding events collected by the two data collectors.

reprogrammer avatar Feb 13 '12 04:02 reprogrammer

I confirmed using CodingSpectator 1.0.0.201112231504 for Indigo SR1 that CodingSpectator does not record redone refactorings.

reprogrammer avatar Feb 14 '12 03:02 reprogrammer

@Wanderer777: I realized that it wasn't a good idea to match refactorings based on their timestamps and project names because the project names may change. Instead, I should compare refactorings based on their timestamps and descriptions (See org.eclipse.ltk.core.refactoring.RefactoringDescriptor.equals(Object)). How can I get the "description" attributes of the refactoring descriptors captured by CodingTracker?

reprogrammer avatar Feb 19 '12 19:02 reprogrammer

@reprogrammer: You can use method edu.illinois.codingtracker.operations.refactorings.NewStartedRefactoringOperation.getArguments() to get a map of arguments of a particular refactoring, among which you would be able to find the description of the refactoring, if it is stored as part of the refactoring's descriptor.

Wanderer777 avatar Feb 19 '12 20:02 Wanderer777

@Wanderer777: The edu.illinois.codingtracker.operations.refactorings.NewStartedRefactoringOperation.toString() method doesn't print out the "description" attribute. For example, the "Operation Sequence View" shows the following information for an Extract Method refactoring:

Should always replay: false
Refactoring mode: PERFORM
ID: org.eclipse.jdt.ui.extract.method
Project: P
Flags: 786434
Arguments count: 9
Key: comments
Value: false
Key: destination
Value: 0
Key: exceptions
Value: false
Key: input
Value: /src<{C.java
Key: name
Value: m
Key: replace
Value: false
Key: selection
Value: 62 30
Key: version
Value: 1.0
Key: visibility
Value: 2
Timestamp: 1329189747836

The "description" attribute is common to all refactoring descriptors. Therefore, it is a field of class RefactoringDescriptor (See org.eclipse.ltk.core.refactoring.RefactoringDescriptor.fDescription) like project, id annd flags. Does CodingTracker capture the description attribute?

reprogrammer avatar Feb 19 '12 20:02 reprogrammer

@reprogrammer: CodingTracker captures project, id, flags, and arguments. I thought that description might make part of arguments. Since it does not, it is not recorded by CodingTracker (as well as comment). Thus, unfortunately, you would not be able to use description to match refactorings.

Wanderer777 avatar Feb 19 '12 21:02 Wanderer777