Skip to content

Commit

Permalink
prevent null value for firstName2 in print. close #2370
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Apr 29, 2024
1 parent b2095c5 commit 4f8c691
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 38 deletions.
Expand Up @@ -678,15 +678,14 @@ public class ArchiveFileStub extends GenericStub {
private String fileNumber;
private String claimNumber;
private float claimValue;
// private String dictateSign;
private String notice;
private String reason;
private String lawyer;
private String assistant;

private List<ReviewsDetail> reviews = new ArrayList<ReviewsDetail>();
private List<ReviewsDetail> reviews = new ArrayList<>();

private List<AddressDetail> parties=new ArrayList<AddressDetail>();
private List<AddressDetail> parties=new ArrayList<>();

public ArchiveFileStub() {
super();
Expand All @@ -700,42 +699,38 @@ public List<ReviewsDetail> getReviews() {
}

public void sortReviews() {
Comparator c = new Comparator() {

public int compare(Object t, Object t1) {
try {

if (t == null) {
return -1;
}

if (t1 == null) {
return 1;
}

String s1 = ((ReviewsDetail)t).getReviewDate();
String s2 = ((ReviewsDetail)t1).getReviewDate();


if ("".equals(s1)) {
return -1;
}

if ("".equals(s2)) {
return 1;
}

Date d1 = df.parse(s1);
Date d2 = df.parse(s2);

return d1.compareTo(d2);



} catch (Throwable thr) {
//log.error("error sorting by date string", thr);
Comparator c = (Comparator) (Object t, Object t1) -> {
try {

if (t == null) {
return -1;
}

if (t1 == null) {
return 1;
}

String s1 = ((ReviewsDetail)t).getReviewDate();
String s2 = ((ReviewsDetail)t1).getReviewDate();


if ("".equals(s1)) {
return -1;
}

if ("".equals(s2)) {
return 1;
}

Date d1 = df.parse(s1);
Date d2 = df.parse(s2);

return d1.compareTo(d2);



} catch (Throwable thr) {
return -1;
}
};
Collections.sort(this.reviews, c);
Expand Down
Expand Up @@ -775,7 +775,14 @@ private static AddressDetail getAddressDetail(AddressBean b, ArchiveFileAddresse
} else {
d.setFax(b.getFax());
}
d.setFirstName(b.getFirstName() + " " + b.getFirstName2());
String name1=b.getFirstName();
if(name1==null)
name1="";
String name2=b.getFirstName2();
if(name2==null)
name2="";

d.setFirstName(name1 + " " + name2);
d.setName(b.getName());
if (StringUtils.isEmpty(b.getPhone())) {
d.setPhone(" ");
Expand Down

0 comments on commit 4f8c691

Please sign in to comment.