[
https://issues.apache.org/jira/browse/TINKERPOP-1861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16321476#comment-16321476
]
ASF GitHub Bot commented on TINKERPOP-1861:
-------------------------------------------
Github user spmallette commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/772#discussion_r160840162
--- Diff:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
---
@@ -325,9 +325,12 @@ private Builder() {
@SuppressWarnings("unchecked")
@Override
- public BulkLoaderVertexProgram create(final Graph graph) {
-
ConfigurationUtils.append(graph.configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX),
configuration);
- return (BulkLoaderVertexProgram)
VertexProgram.createVertexProgram(graph, configuration);
+ public BulkLoaderVertexProgram create(final Graph... graphs) {
+ if (graphs.length == 0) {
+ throw new IllegalStateException("Must provide at least one
graph to use");
--- End diff --
Better to use a `IllegalArgumentException` in this case as the validation
is on the an argument to `create()` ? I think it should be changed in all the
"programs" as they all seem to validate in the same manner.
> VertexProgram create with varargs for Graphs
> --------------------------------------------
>
> Key: TINKERPOP-1861
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1861
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.7
> Reporter: Philip Graff
> Priority: Minor
>
> VertexProgram.Builder.create(Graph) can be modified to
> VertexProgram.Builder.create(Graph...) so that passing in zero or many graphs
> is naturally handled. The current state of passing in null when no graph is
> needed is bad practice.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)