Skip to content
Permalink
Browse files
IGNITE-10095: Support Build Parameters specifying: bugfixing
  • Loading branch information
dspavlov committed May 8, 2019
1 parent a9a276e commit 8d697ca3e54e8123d05b2798d751aa63f54428f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
@@ -18,12 +18,10 @@
package org.apache.ignite.ci.tcbot.conf;

import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.jetbrains.annotations.Nullable;

import java.util.*;

public class BuildParameterSpec {
/** Parameter (property) Name. */
private String name;
@@ -69,13 +67,13 @@ public String name() {
* @return some valid value for property or null.
*/
public Object generateValue() {
if (!randomValue)
if (!Boolean.TRUE.equals(randomValue))
return value;

if (selection.isEmpty())
if (selection == null || selection.isEmpty())
return value;

int idx = (int)(Math.random() * selection.size());
int idx = (int) (Math.random() * selection.size());

ParameterValueSpec spec = selection.get(idx);

@@ -17,6 +17,8 @@

package org.apache.ignite.ci.tcbot.conf;

import com.google.common.base.Objects;

/**
* Some parameter value, which label may be used in UI.
*/
@@ -31,4 +33,18 @@ public String value() {
public String label() {
return label;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ParameterValueSpec that = (ParameterValueSpec) o;
return Objects.equal(value, that.value) &&
Objects.equal(label, that.label);
}

@Override
public int hashCode() {
return Objects.hashCode(value, label);
}
}

0 comments on commit 8d697ca

Please sign in to comment.