Sonar Findings (#2708)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -93,10 +93,10 @@ public class MgmtAction extends MgmtBaseEntity {
|
||||
private Long id;
|
||||
@Schema(description = "Type of action", example = "update")
|
||||
private String type;
|
||||
@Deprecated(since = "0.10.0")
|
||||
/**
|
||||
* @deprecated since 0.10.0 - use {@link #active} instead of {@link #status}
|
||||
*/
|
||||
@Deprecated(since = "0.10.0")
|
||||
@Schema(description = "Status of action, use active", example = "finished", deprecated = true)
|
||||
private String status;
|
||||
@Schema(description = "Status of action")
|
||||
|
||||
@@ -100,7 +100,7 @@ public class QLSupport implements ApplicationListener<ContextRefreshedEvent> {
|
||||
* If the database is declared as case-sensitive and ignoreCase is set to <code>false</code> the RSQL queries shall use strict
|
||||
* syntax - i.e. 'and' instead of 'AND' / 'aND'. Otherwise, the queries would be case-insensitive regarding operators.
|
||||
*/
|
||||
@Value("${hawkbit.rsql.case-insensitive-db:false}")
|
||||
@Value("${hawkbit.ql.case-insensitive-db:false}")
|
||||
private boolean caseInsensitiveDB;
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ public class QLSupport implements ApplicationListener<ContextRefreshedEvent> {
|
||||
*/
|
||||
@Setter // for tests only
|
||||
@Deprecated(forRemoval = true, since = "0.6.0")
|
||||
@Value("${hawkbit.rsql.rsql-to-spec-builder:G3}") //
|
||||
@Value("${hawkbit.ql.spec-builder:G3}") //
|
||||
private SpecBuilder specBuilder;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@@ -167,8 +167,8 @@ public class QLSupport implements ApplicationListener<ContextRefreshedEvent> {
|
||||
*/
|
||||
public <A extends Enum<A> & QueryField, T> Specification<T> buildSpec(final String query, final Class<A> queryFieldType) {
|
||||
if (specBuilder == SpecBuilder.G3) {
|
||||
return new SpecificationBuilder<T>(!caseInsensitiveDB && ignoreCase, database)
|
||||
.specification(parseAndTransform(query, queryFieldType, caseInsensitiveDB || ignoreCase));
|
||||
return new SpecificationBuilder<T>(ignoreCase && !caseInsensitiveDB , database)
|
||||
.specification(parseAndTransform(query, queryFieldType, ignoreCase || caseInsensitiveDB));
|
||||
} else {
|
||||
return new SpecificationBuilderLegacy<A, T>(queryFieldType, virtualPropertyResolver, database).specification(query);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public class QLSupport implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
@SuppressWarnings({ "java:S1117" }) // it is again ignoreCase
|
||||
public <A extends Enum<A> & QueryField> EntityMatcher entityMatcher(final String query, final Class<A> queryFieldType) {
|
||||
final boolean ignoreCase = caseInsensitiveDB || this.ignoreCase; // sync with DB and case sensitivity requirements
|
||||
final boolean ignoreCase = this.ignoreCase || caseInsensitiveDB; // sync with DB and case sensitivity requirements
|
||||
return EntityMatcher.of(parseAndTransform(query, queryFieldType, ignoreCase), ignoreCase);
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ public class QLSupport implements ApplicationListener<ContextRefreshedEvent> {
|
||||
}
|
||||
|
||||
// just extension points for subclasses
|
||||
@SuppressWarnings("java:S1172") // comparison and queryFieldType might be useful for subclasses
|
||||
protected <T extends Enum<T> & QueryField> Object transformKey(
|
||||
final String key, final Comparison comparison, final Class<T> queryFieldType) {
|
||||
return key;
|
||||
@@ -267,6 +268,7 @@ public class QLSupport implements ApplicationListener<ContextRefreshedEvent> {
|
||||
}
|
||||
|
||||
// just extension points for subclasses
|
||||
@SuppressWarnings("java:S1172") // comparison and queryFieldType might be useful for subclasses
|
||||
protected <T extends Enum<T> & QueryField> Object transformValueElement(
|
||||
final Object value, final Comparison comparison, final Class<T> queryFieldType) {
|
||||
return value;
|
||||
|
||||
@@ -56,7 +56,7 @@ logging.level.org.eclipse.persistence=${NOISE_SUPPRESS_LEVEL}
|
||||
### Switch to MySQL or MariaDB - END
|
||||
|
||||
## enable / disable case sensitiveness of the DB when playing around
|
||||
#hawkbit.rsql.caseInsensitiveDB=true
|
||||
#hawkbit.ql.case-insensitive-db=true
|
||||
|
||||
hawkbit.repository.cluster.lock.ttl=1000
|
||||
hawkbit.repository.cluster.lock.refreshOnRemainMS=200
|
||||
|
||||
Reference in New Issue
Block a user