Closes #2171 - Refactor toLowerCopy
This commit is contained in:
parent
5468e23808
commit
10f1d008da
|
@ -76,7 +76,7 @@ public interface BaseQuery<T, U extends Enum<U> & QueryColumnName> {
|
||||||
*/
|
*/
|
||||||
long count();
|
long count();
|
||||||
|
|
||||||
default String[] toLowerCopy(String... source) {
|
static String[] toLowerCopy(String... source) {
|
||||||
if (source == null || source.length == 0) {
|
if (source == null || source.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
// we are currently aware that this is a code smell. Unfortunately the resolution of this
|
// we are currently aware that this is a code smell. Unfortunately the resolution of this
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.simplehistory.impl;
|
package pro.taskana.simplehistory.impl;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.simplehistory.impl;
|
package pro.taskana.simplehistory.impl;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.simplehistory.impl;
|
package pro.taskana.simplehistory.impl;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.classification.internal;
|
package pro.taskana.classification.internal;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.monitor.internal.reports;
|
package pro.taskana.monitor.internal.reports;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -628,19 +630,4 @@ abstract class TimeIntervalReportBuilderImpl<
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] toLowerCopy(String... source) {
|
|
||||||
if (source == null || source.length == 0) {
|
|
||||||
// we are currently aware that this is a code smell. Unfortunately the resolution of this
|
|
||||||
// would cause havoc in our queries, since we do not have a concept
|
|
||||||
// for a user input validation yet. As soon as that is done we can resolve this code smell.
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
String[] target = new String[source.length];
|
|
||||||
for (int i = 0; i < source.length; i++) {
|
|
||||||
target[i] = source[i].toLowerCase();
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.monitor.internal.reports;
|
package pro.taskana.monitor.internal.reports;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import pro.taskana.common.api.IntInterval;
|
import pro.taskana.common.api.IntInterval;
|
||||||
|
@ -543,19 +545,4 @@ public class WorkbasketPriorityReportBuilderImpl implements WorkbasketPriorityRe
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] toLowerCopy(String... source) {
|
|
||||||
if (source == null || source.length == 0) {
|
|
||||||
// we are currently aware that this is a code smell. Unfortunately the resolution of this
|
|
||||||
// would cause havoc in our queries, since we do not have a concept
|
|
||||||
// for a user input validation yet. As soon as that is done we can resolve this code smell.
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
String[] target = new String[source.length];
|
|
||||||
for (int i = 0; i < source.length; i++) {
|
|
||||||
target[i] = source[i].toLowerCase();
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.task.internal;
|
package pro.taskana.task.internal;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.task.internal;
|
package pro.taskana.task.internal;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.workbasket.internal;
|
package pro.taskana.workbasket.internal;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package pro.taskana.workbasket.internal;
|
package pro.taskana.workbasket.internal;
|
||||||
|
|
||||||
|
import static pro.taskana.common.api.BaseQuery.toLowerCopy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
Loading…
Reference in New Issue