From 0f14b1acd69a92f9657d971f30abf97d75ef6382 Mon Sep 17 00:00:00 2001 From: BarminaA Date: Mon, 26 Apr 2021 11:54:34 +0400 Subject: [PATCH] #26-Add true and false --- src/main/java/ru/ulstu/extractor/model/LineChange.java | 5 ++--- .../ru/ulstu/extractor/service/GitRepositoryService.java | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/ru/ulstu/extractor/model/LineChange.java b/src/main/java/ru/ulstu/extractor/model/LineChange.java index ff237e7..923909b 100644 --- a/src/main/java/ru/ulstu/extractor/model/LineChange.java +++ b/src/main/java/ru/ulstu/extractor/model/LineChange.java @@ -10,9 +10,8 @@ import javax.persistence.Entity; @Entity public class LineChange extends BaseEntity { - private Boolean added; - - private Boolean removed; + private Boolean added = false; + private Boolean removed = false; private String lineFrom; private String lineTo; diff --git a/src/main/java/ru/ulstu/extractor/service/GitRepositoryService.java b/src/main/java/ru/ulstu/extractor/service/GitRepositoryService.java index a8384f8..17238d1 100644 --- a/src/main/java/ru/ulstu/extractor/service/GitRepositoryService.java +++ b/src/main/java/ru/ulstu/extractor/service/GitRepositoryService.java @@ -260,6 +260,7 @@ public class GitRepositoryService { } } } + lineChange.setRemoved(true); } if (strings[i].startsWith("+")) { while ((i < stringsLength) && strings[i].startsWith("+")) { @@ -275,6 +276,7 @@ public class GitRepositoryService { } } } + lineChange.setAdded(true); } if ((lineChange.getLineTo() != null) || (lineChange.getLineFrom() != null) || ((lineChange.getLineTo() != null) && (lineChange.getLineFrom() != null))) {