Skip to content

Commit ae5d5b2

Browse files
committed
Cleaning, unnecessary public fields removed
1 parent 57f8130 commit ae5d5b2

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/main/java/alexp/blog/model/Comment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Comment {
5656

5757
@OneToMany(cascade = CascadeType.ALL, mappedBy = "comment")
5858

59-
public List<CommentRating> commentRatings = new ArrayList<>();
59+
private List<CommentRating> commentRatings = new ArrayList<>();
6060

6161
public int commentLevel() {
6262
Comment comment = this;

src/main/java/alexp/blog/model/Post.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public class Post {
4747
@OneToMany(cascade = CascadeType.ALL, mappedBy = "post")
4848
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
4949
@OrderBy("dateTime ASC")
50-
public List<Comment> comments = new ArrayList<>();
50+
private List<Comment> comments = new ArrayList<>();
5151

5252
@OneToMany(cascade = CascadeType.ALL, mappedBy = "post")
53-
public List<PostRating> postRatings = new ArrayList<>();
53+
private List<PostRating> postRatings = new ArrayList<>();
5454

5555
public static String shortPartSeparator() {
5656
return "===cut===";

src/main/java/alexp/blog/model/User.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,22 @@ public interface ProfileInfoValidationGroup {}
6565
private List<Role> roles = new ArrayList<>();
6666

6767
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "user")
68-
public List<Comment> comments = new ArrayList<>();
68+
private List<Comment> comments = new ArrayList<>();
6969

7070
@Column(nullable = true, length = 1000)
7171
@Size(max = 1000, groups = {ProfileInfoValidationGroup.class})
72-
public String aboutText;
72+
private String aboutText;
7373

7474
@Column(nullable = true, length = 80)
7575
@Pattern(regexp = "^\\s*(https?:\\/\\/.+)?", groups = {ProfileInfoValidationGroup.class})
7676
@Size(max = 80, groups = {ProfileInfoValidationGroup.class})
77-
public String websiteLink;
77+
private String websiteLink;
7878

7979
@Column(nullable = true)
80-
public String smallAvatarLink;
80+
private String smallAvatarLink;
8181

8282
@Column(nullable = true)
83-
public String bigAvatarLink;
83+
private String bigAvatarLink;
8484

8585
public Long getId() {
8686
return Id;

src/main/java/alexp/blog/service/UserServiceImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ public void register(User user) {
8686
@Override
8787
public void changeEmail(String newEmail, String currentPassword) throws AuthException {
8888
User user = currentUser();
89-
System.out.println(user.bigAvatarLink);
9089
if (!passwordEncoder.matches(currentPassword, user.getPassword()))
9190
throw new AuthException("password does not match");
9291

0 commit comments

Comments
 (0)