[ 
https://issues.apache.org/jira/browse/TINKERPOP-2077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16668637#comment-16668637
 ] 

ASF GitHub Bot commented on TINKERPOP-2077:
-------------------------------------------

spmallette closed pull request #967: TINKERPOP-2077: Add default create() 
method to VertexProgram.Builder
URL: https://github.com/apache/tinkerpop/pull/967
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
index 1c8d0cb852..47c9d40d07 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
@@ -241,6 +241,10 @@ public default void workerIterationEnd(final Memory 
memory) {
         public Builder configure(final Object... keyValues);
 
         public <P extends VertexProgram> P create(final Graph graph);
+        
+        default public <P extends VertexProgram> P create() {
+          return this.create(null);
+        }
 
     }
 
diff --git 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
index 3f492d668f..ccf31bad84 100644
--- 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
+++ 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java
@@ -2562,10 +2562,6 @@ public VertexProgramQ create(final Graph graph) {
                 return (VertexProgramQ) 
VertexProgram.createVertexProgram(graph, configuration);
             }
 
-            public VertexProgramQ create() {
-                return create(null);
-            }
-
             public Builder property(final String name) {
                 configuration.setProperty(PROPERTY_CFG_KEY, name);
                 return this;
@@ -2865,10 +2861,6 @@ public VertexProgramR create(final Graph graph) {
                 return (VertexProgramR) 
VertexProgram.createVertexProgram(graph, configuration);
             }
 
-            public VertexProgramR create() {
-                return create(null);
-            }
-
             public Builder direction(final Direction direction) {
                 configuration.setProperty(DIRECTION_CFG_KEY, 
direction.toString());
                 return this;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> VertexProgram.Builder should have a default create() method with no Graph
> -------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2077
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2077
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: hadoop
>    Affects Versions: 3.3.4, 3.2.10
>            Reporter: Philip Graff
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The VertexProgram.Builder interface has a create(Graph) method, however, the 
> Graph is not always needed. This is illustrated by The GraphComputerTest 
> class with VertexProgramQ and VertexProgramR that both implement create() 
> methods that pass in a null Graph. The Builder should just have this as a 
> default method that will then be inherited by the 
> AbstractVertexProgramBuilder and any subsequent builders that use the 
> abstract class or interface.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to