Resolve "Структура классов для эвристических методов поиска определенных типов классов проекта" #37

Merged
romanov73 merged 1 commits from 12-heuristic into master 2021-04-12 11:04:30 +04:00
2 changed files with 7 additions and 3 deletions

View File

@ -91,6 +91,10 @@ public class Commit extends BaseEntity {
} }
public boolean containsEntity() { public boolean containsEntity() {
return fileChanges.stream().anyMatch(FileChange::isContainsEntity); return fileChanges != null && fileChanges.stream().anyMatch(
fileChange -> fileChange != null
&& fileChange.isContainsEntity() != null
&& fileChange.isContainsEntity()
);
} }
} }

View File

@ -25,7 +25,7 @@ public class FileChange extends BaseEntity {
@Transient @Transient
private boolean added; private boolean added;
private boolean containsEntity; private Boolean containsEntity;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "file_change_id", unique = true) @JoinColumn(name = "file_change_id", unique = true)
@ -79,7 +79,7 @@ public class FileChange extends BaseEntity {
return added; return added;
} }
public boolean isContainsEntity() { public Boolean isContainsEntity() {
return containsEntity; return containsEntity;
} }