.message("Flow step #" + flowNum);
flowLocations.add(newLocation);
}
- newIssue.addFlow(flowLocations);
+ if (flowLocations.size() == 1) {
+ newIssue.addLocation(flowLocations.get(0));
+ } else {
+ newIssue.addFlow(flowLocations);
+ }
}
}
newIssue.save();
return this;
}
+ @Override
+ public IssueBuilder addLocation(NewIssueLocation secondaryLocation) {
+ newIssue.addLocation(secondaryLocation);
+ return this;
+ }
+
@Override
public IssueBuilder addFlow(Iterable<NewIssueLocation> flowLocations) {
newIssue.addFlow(flowLocations);
throw unsupported();
}
+ @Override
+ public IssueBuilder addLocation(NewIssueLocation secondaryLocation) {
+ throw unsupported();
+ }
+
@Override
public IssueBuilder addFlow(Iterable<NewIssueLocation> flow) {
throw unsupported();
*/
NewIssue at(NewIssueLocation primaryLocation);
+ /**
+ * Add a secondary location for this issue. Several secondary locations can be registered.
+ * @since 5.2
+ */
+ NewIssue addLocation(NewIssueLocation secondaryLocation);
+
/**
* Register a flow for this issue. A flow is an ordered list of issue locations that help to understand the issue.
* It could be a path leading to the primary location. Several flows can be registered.
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
return this;
}
+ @Override
+ public NewIssue addLocation(NewIssueLocation secondaryLocation) {
+ flows.add(Arrays.asList((IssueLocation) secondaryLocation));
+ return this;
+ }
+
@Override
public DefaultIssue addFlow(Iterable<NewIssueLocation> locations) {
List<IssueLocation> flowAsList = new ArrayList<>();
*/
IssueBuilder at(NewIssueLocation primaryLocation);
+ /**
+ * @since 5.2
+ * @see NewIssue#addLocation(NewIssueLocation)
+ */
+ IssueBuilder addLocation(NewIssueLocation secondaryLocation);
+
/**
* @since 5.2
* @see NewIssue#addFlow(Iterable)