Skip to content
Snippets Groups Projects
Commit da538e06 authored by Georg Seibt's avatar Georg Seibt :nerd:
Browse files

use Path to represent affected file for consistency with the rest of the library

parent 2f9df1fd
No related branches found
No related tags found
No related merge requests found
package de.uni_passau.fim.seibt.gitwrapper.repo; package de.uni_passau.fim.seibt.gitwrapper.repo;
import java.io.File; import java.io.File;
import java.nio.file.Path;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
...@@ -27,7 +28,7 @@ public class BlameLine { ...@@ -27,7 +28,7 @@ public class BlameLine {
/** /**
* The file in the commit that the line is attributed to. * The file in the commit that the line is attributed to.
*/ */
public final File file; public final Path file;
/** /**
* The actual line from the file. * The actual line from the file.
...@@ -55,7 +56,7 @@ public class BlameLine { ...@@ -55,7 +56,7 @@ public class BlameLine {
* @param otherHeaderFields * @param otherHeaderFields
* other (unrecognized) fields from the 'git blame' commit header * other (unrecognized) fields from the 'git blame' commit header
*/ */
private BlameLine(Commit commit, int originalLineNumber, int finalLineNumber, File file, String line, private BlameLine(Commit commit, int originalLineNumber, int finalLineNumber, Path file, String line,
Map<String, String> otherHeaderFields) { Map<String, String> otherHeaderFields) {
this.commit = commit; this.commit = commit;
...@@ -84,7 +85,7 @@ public class BlameLine { ...@@ -84,7 +85,7 @@ public class BlameLine {
* other (unrecognized) fields from the 'git blame' commit header * other (unrecognized) fields from the 'git blame' commit header
* @return a {@link BlameLine} containing the given header fields * @return a {@link BlameLine} containing the given header fields
*/ */
static BlameLine firstOccurrence(Commit commit, int originalLineNumber, int finalLineNumber, File file, String line, static BlameLine firstOccurrence(Commit commit, int originalLineNumber, int finalLineNumber, Path file, String line,
Map<String, String> otherHeaderFields) { Map<String, String> otherHeaderFields) {
Map<String, String> other; Map<String, String> other;
...@@ -118,7 +119,7 @@ public class BlameLine { ...@@ -118,7 +119,7 @@ public class BlameLine {
String line) { String line) {
Commit commit = firstOccurrence.commit; Commit commit = firstOccurrence.commit;
File file = firstOccurrence.file; Path file = firstOccurrence.file;
Map<String, String> otherHeaderFields = firstOccurrence.otherHeaderFields; Map<String, String> otherHeaderFields = firstOccurrence.otherHeaderFields;
return new BlameLine(commit, originalLineNumber, finalLineNumber, file, line, otherHeaderFields); return new BlameLine(commit, originalLineNumber, finalLineNumber, file, line, otherHeaderFields);
......
...@@ -434,7 +434,7 @@ public class Repository { ...@@ -434,7 +434,7 @@ public class Repository {
ZoneId authorTZ = null; ZoneId authorTZ = null;
ZoneId committerTZ = null; ZoneId committerTZ = null;
File commitFile = null; Path commitFile = null;
Map<String, String> other = new HashMap<>(); Map<String, String> other = new HashMap<>();
...@@ -471,7 +471,7 @@ public class Repository { ...@@ -471,7 +471,7 @@ public class Repository {
committerTZ = ZoneId.of(lineScanner.next()); committerTZ = ZoneId.of(lineScanner.next());
break; break;
case FILENAME: case FILENAME:
commitFile = dir.toPath().resolve(Paths.get(lineScanner.nextLine().trim())).toFile(); commitFile = Paths.get(lineScanner.nextLine().trim());
break; break;
case SUMMARY: case SUMMARY:
// We do not explicitly store the summary of the commit as it is just the first line of its message (for which there is a getter). // We do not explicitly store the summary of the commit as it is just the first line of its message (for which there is a getter).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment