You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/05 19:08:00 UTC

[jira] [Commented] (DRILL-6347) Inconsistent method name "field".

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

ASF GitHub Bot commented on DRILL-6347:
---------------------------------------

asfgit closed pull request #1236: DRILL-6347: Inconsistent method name "field".
URL: https://github.com/apache/drill/pull/1236
 
 
   

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/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/PrelVisualizerVisitor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/PrelVisualizerVisitor.java
index 703d648b9e..0ee685f622 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/PrelVisualizerVisitor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/PrelVisualizerVisitor.java
@@ -87,11 +87,11 @@ public void endFields() {
 
     }
 
-    public void field(String label, boolean value) {
-      field(label, Boolean.toString(value));
+    public void visitField(String label, boolean value) {
+      visitField(label, Boolean.toString(value));
     }
 
-    private void field(String label, String value) {
+    private void visitField(String label, String value) {
       indent();
       out.append(label)
          .append(" = ")
@@ -99,10 +99,10 @@ private void field(String label, String value) {
          .append("\n");
     }
 
-    public void listField(String label,
+    public void visitField(String label,
         Object[] values) {
       if (values == null) {
-        field(label, "null");
+        visitField(label, "null");
         return;
       }
       StringBuilder buf = new StringBuilder();
@@ -120,7 +120,7 @@ public void listField(String label,
         }
       }
       buf.append("]");
-      field(label, buf.toString());
+      visitField(label, buf.toString());
     }
 
     @Override
@@ -156,8 +156,8 @@ public Void visitExchange(ExchangePrel prel, VisualizationState value)
 
   private void visitBasePrel(Prel prel, VisualizationState value) {
     value.startNode(prel);
-    value.listField("encodings", prel.getSupportedEncodings());
-    value.field("needsReorder", prel.needsFinalColumnReordering());
+    value.visitField("encodings", prel.getSupportedEncodings());
+    value.visitField("needsReorder", prel.needsFinalColumnReordering());
   }
 
   private void endNode(Prel prel, VisualizationState value) throws Exception {


 

----------------------------------------------------------------
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:
users@infra.apache.org


> Inconsistent method name "field".
> ---------------------------------
>
>                 Key: DRILL-6347
>                 URL: https://issues.apache.org/jira/browse/DRILL-6347
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: KuiLIU
>            Assignee: KuiLIU
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.14.0
>
>
> The following method is names as "field", but the method is mainly doing appending. So that, rename the method as "append" should be better.
> {code:java}
>  private void field(String label, String value) {
>       indent();
>       out.append(label)
>          .append(" = ")
>          .append(value)
>          .append("\n");
>     }
> {code}



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