Skip to content

Commit

Permalink
korrigiert build error von 497 (#500)
Browse files Browse the repository at this point in the history
* BuildFix Java11 StringBuilder.length anstelle StringBuilder.isEmpty

* fix length check of where clause
  • Loading branch information
tolot27 authored Nov 27, 2024
1 parent 156b97b commit c43096e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/de/jost_net/JVerein/Queries/SollbuchungQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ else if (i == anzahl)
ArrayList<Object> param = new ArrayList<>();
if (mitglied != null)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("mitgliedskonto.mitglied = ? ");
param.add(Long.valueOf(mitglied.getID()));
}
Expand All @@ -238,7 +238,7 @@ else if (i == anzahl)
{
// Der Name kann so verwendet werden ohne Umwandeln der Umlaute
String tmpSuchname = (String) control.getSuchname().getValue();
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("((LOWER(mitglied.name) LIKE ?) OR (LOWER(mitglied.vorname) LIKE ?))");
param.add(tmpSuchname.toLowerCase() + "%");
param.add(tmpSuchname.toLowerCase() + "%");
Expand All @@ -260,12 +260,12 @@ else if (control.isSuchnameAktiv()
count++;
if (anzahl == 1)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("mitgliedskonto.mitglied = ?");
}
else if (count == 1)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("(mitgliedskonto.mitglied = ?");
}
else if (count < anzahl)
Expand All @@ -282,20 +282,20 @@ else if (count == anzahl)
}
if (vd != null)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("mitgliedskonto.datum >= ?");
param.add(vd);
}
if (bd != null)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("mitgliedskonto.datum <= ?");
param.add(bd);
}
if (control.isOhneAbbucherAktiv()
&& (Boolean) control.getOhneAbbucher().getValue())
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("mitgliedskonto.zahlungsweg <> ?");
param.add(Zahlungsweg.BASISLASTSCHRIFT);
}
Expand All @@ -304,17 +304,17 @@ else if (count == anzahl)
int mailauswahl = (Integer) control.getMailauswahl().getValue();
if (mailauswahl == MailAuswertungInput.OHNE)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("(email IS NULL OR LENGTH(email) = 0)");
}
if (mailauswahl == MailAuswertungInput.MIT)
{
where.append(where.isEmpty() ? "" : " AND ")
where.append(where.length() == 0 ? "" : " AND ")
.append("(email IS NOT NULL AND LENGTH(email) > 0)");
}
}

if (!where.isEmpty())
if (where.length() > 0)
{
sql.append(" WHERE ").append(where);
}
Expand Down

0 comments on commit c43096e

Please sign in to comment.