globalAdmin();
insertActivity("T1", "PROJECT_1", CeActivityDto.Status.SUCCESS);
String today = formatDate(new Date(EXECUTED_AT));
- System.out.println(EXECUTED_AT + " - " + today);
ActivityResponse activityResponse = call(ws.newRequest()
.setParam(CeWsParameters.PARAM_MAX_EXECUTED_AT, today));
*/
package org.sonar.db.ce;
+import java.util.ArrayList;
import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.sonar.db.DatabaseUtils;
-import static java.util.Collections.singletonList;
+import static com.google.common.collect.Lists.newArrayList;
/**
* Db Query used for CE_QUEUE and CE_ACTIVITY tables
public static final int MAX_COMPONENT_UUIDS = DatabaseUtils.PARTITION_SIZE_FOR_ORACLE;
private boolean onlyCurrents = false;
- private List<String> componentUuids;
- private List<String> statuses;
+ // SONAR-7681 a public implementation of List must be used in MyBatis - potential concurrency exceptions otherwise
+ private ArrayList<String> componentUuids;
+ private ArrayList<String> statuses;
private String type;
private Long minSubmittedAt;
private Long maxExecutedAt;
}
public CeTaskQuery setComponentUuids(@Nullable List<String> l) {
- this.componentUuids = l;
+ this.componentUuids = l == null ? null : newArrayList(l);
return this;
}
if (s == null) {
this.componentUuids = null;
} else {
- this.componentUuids = singletonList(s);
+ this.componentUuids = newArrayList(s);
}
return this;
}
}
public CeTaskQuery setStatuses(@Nullable List<String> statuses) {
- this.statuses = statuses;
+ this.statuses = statuses == null ? null : newArrayList(statuses);
return this;
}
import com.google.common.base.Function;
import com.google.common.base.Joiner;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.FluentIterable.from;
+import static com.google.common.collect.Lists.newArrayList;
import static java.util.Objects.requireNonNull;
import static org.sonar.db.DatabaseUtils.buildLikeValue;
import static org.sonar.db.WildcardPosition.AFTER;
public class ComponentTreeQuery {
@CheckForNull
private final String nameOrKeyQuery;
+ // SONAR-7681 a public implementation of List must be used in MyBatis - potential concurrency exceptions otherwise
@CheckForNull
- private final Collection<String> qualifiers;
+ private final ArrayList<String> qualifiers;
@CheckForNull
private final Integer page;
@CheckForNull
private ComponentTreeQuery(Builder builder) {
this.nameOrKeyQuery = builder.nameOrKeyQuery;
- this.qualifiers = builder.qualifiers;
+ this.qualifiers = builder.qualifiers == null ? null : newArrayList(builder.qualifiers);
this.page = builder.page;
this.pageSize = builder.pageSize;
this.baseSnapshot = builder.baseSnapshot;