Skip to contents
## Loading required package: kaiaulu

This is a wrapper for Refactoring Miner. See README.md for setup details.

tool <- yaml::read_yaml("../tools.yml")
conf <- yaml::read_yaml("../conf/tomcat.yml")
rminer_path <- tool[["refactoring_miner"]]
git_repo_path <- conf[["version_control"]][["log"]]
start_commit <- conf[["analysis"]][["enumeration"]][["commit"]][1]
end_commit <- conf[["analysis"]][["enumeration"]][["commit"]][2]

A sample of parsed refactorings is shown below in json format:

refactorings <- parse_java_code_refactoring_json(rminer_path,git_repo_path,start_commit,end_commit)

str(refactorings$commits[16])
## List of 1
##  $ :List of 4
##   ..$ repository  : chr "https://github.com/apache/tomcat.git"
##   ..$ sha1        : chr "9b1a6f6350b22a3991d785bea91f95c41660fa19"
##   ..$ url         : chr "https://github.com/apache/tomcat/commit/9b1a6f6350b22a3991d785bea91f95c41660fa19"
##   ..$ refactorings:List of 2
##   .. ..$ :List of 4
##   .. .. ..$ type              : chr "Add Method Annotation"
##   .. .. ..$ description       : chr "Add Method Annotation @Deprecated in method public getAttribute(name String) : Object from class org.apache.cat"| __truncated__
##   .. .. ..$ leftSideLocations :List of 1
##   .. .. .. ..$ :List of 8
##   .. .. .. .. ..$ filePath       : chr "java/org/apache/catalina/connector/Connector.java"
##   .. .. .. .. ..$ startLine      : int 324
##   .. .. .. .. ..$ endLine        : int 332
##   .. .. .. .. ..$ startColumn    : int 5
##   .. .. .. .. ..$ endColumn      : int 6
##   .. .. .. .. ..$ codeElementType: chr "METHOD_DECLARATION"
##   .. .. .. .. ..$ description    : chr "original method declaration"
##   .. .. .. .. ..$ codeElement    : chr "public getAttribute(name String) : Object"
##   .. .. ..$ rightSideLocations:List of 2
##   .. .. .. ..$ :List of 8
##   .. .. .. .. ..$ filePath       : chr "java/org/apache/catalina/connector/Connector.java"
##   .. .. .. .. ..$ startLine      : int 333
##   .. .. .. .. ..$ endLine        : int 333
##   .. .. .. .. ..$ startColumn    : int 5
##   .. .. .. .. ..$ endColumn      : int 16
##   .. .. .. .. ..$ codeElementType: chr "ANNOTATION"
##   .. .. .. .. ..$ description    : chr "added annotation"
##   .. .. .. .. ..$ codeElement    : chr "@Deprecated"
##   .. .. .. ..$ :List of 8
##   .. .. .. .. ..$ filePath       : chr "java/org/apache/catalina/connector/Connector.java"
##   .. .. .. .. ..$ startLine      : int 324
##   .. .. .. .. ..$ endLine        : int 336
##   .. .. .. .. ..$ startColumn    : int 5
##   .. .. .. .. ..$ endColumn      : int 6
##   .. .. .. .. ..$ codeElementType: chr "METHOD_DECLARATION"
##   .. .. .. .. ..$ description    : chr "method declaration with added annotation"
##   .. .. .. .. ..$ codeElement    : chr "public getAttribute(name String) : Object"
##   .. ..$ :List of 4
##   .. .. ..$ type              : chr "Add Method Annotation"
##   .. .. ..$ description       : chr "Add Method Annotation @Deprecated in method public setAttribute(name String, value Object) : void from class or"| __truncated__
##   .. .. ..$ leftSideLocations :List of 1
##   .. .. .. ..$ :List of 8
##   .. .. .. .. ..$ filePath       : chr "java/org/apache/catalina/connector/Connector.java"
##   .. .. .. .. ..$ startLine      : int 335
##   .. .. .. .. ..$ endLine        : int 343
##   .. .. .. .. ..$ startColumn    : int 5
##   .. .. .. .. ..$ endColumn      : int 6
##   .. .. .. .. ..$ codeElementType: chr "METHOD_DECLARATION"
##   .. .. .. .. ..$ description    : chr "original method declaration"
##   .. .. .. .. ..$ codeElement    : chr "public setAttribute(name String, value Object) : void"
##   .. .. ..$ rightSideLocations:List of 2
##   .. .. .. ..$ :List of 8
##   .. .. .. .. ..$ filePath       : chr "java/org/apache/catalina/connector/Connector.java"
##   .. .. .. .. ..$ startLine      : int 348
##   .. .. .. .. ..$ endLine        : int 348
##   .. .. .. .. ..$ startColumn    : int 5
##   .. .. .. .. ..$ endColumn      : int 16
##   .. .. .. .. ..$ codeElementType: chr "ANNOTATION"
##   .. .. .. .. ..$ description    : chr "added annotation"
##   .. .. .. .. ..$ codeElement    : chr "@Deprecated"
##   .. .. .. ..$ :List of 8
##   .. .. .. .. ..$ filePath       : chr "java/org/apache/catalina/connector/Connector.java"
##   .. .. .. .. ..$ startLine      : int 339
##   .. .. .. .. ..$ endLine        : int 351
##   .. .. .. .. ..$ startColumn    : int 5
##   .. .. .. .. ..$ endColumn      : int 6
##   .. .. .. .. ..$ codeElementType: chr "METHOD_DECLARATION"
##   .. .. .. .. ..$ description    : chr "method declaration with added annotation"
##   .. .. .. .. ..$ codeElement    : chr "public setAttribute(name String, value Object) : void"