ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [6/9] incubator-ignite git commit: ignite-1015 - minor
Date Wed, 22 Jul 2015 06:05:14 GMT
ignite-1015 - minor


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/38d2a93d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/38d2a93d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/38d2a93d

Branch: refs/heads/ignite-1015
Commit: 38d2a93d0031e599d2e6917a3d070f362892ba47
Parents: 12af70b
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Wed Jul 22 08:23:09 2015 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Wed Jul 22 08:23:09 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/sql/GridSqlAlias.java       | 16 +++-------------
 .../processors/query/h2/sql/GridSqlElement.java     |  7 ++++---
 2 files changed, 7 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38d2a93d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
index 5e827a0..d683370 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
@@ -45,24 +45,14 @@ public class GridSqlAlias extends GridSqlElement {
      * @param useAs Use 'AS' keyword.
      */
     public GridSqlAlias(String alias, GridSqlElement expr, boolean useAs) {
-        super(list(expr));
+        super(new ArrayList<GridSqlElement>(1));
+
+        addChild(expr);
 
         this.useAs = useAs;
         this.alias = alias;
     }
 
-    /**
-     * @param el Element.
-     * @return List.
-     */
-    private static List<GridSqlElement> list(GridSqlElement el) {
-        List<GridSqlElement> res = new ArrayList<>(1);
-
-        res.add(el);
-
-        return res;
-    }
-
     /** {@inheritDoc} */
     @Override public String getSQL() {
         return child().getSQL() + (useAs ? " AS " : " ") + Parser.quoteIdentifier(alias);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38d2a93d/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
index 7ad8d5a..44705de 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlElement.java
@@ -75,7 +75,7 @@ public abstract class GridSqlElement implements Iterable<GridSqlElement>
{
     /**
      * @return First child.
      */
-    public GridSqlElement child() {
+    public <E extends GridSqlElement> E child() {
         return child(0);
     }
 
@@ -83,8 +83,9 @@ public abstract class GridSqlElement implements Iterable<GridSqlElement>
{
      * @param idx Index.
      * @return Child.
      */
-    public GridSqlElement child(int idx) {
-        return children.get(idx);
+    @SuppressWarnings("unchecked")
+    public <E extends GridSqlElement> E child(int idx) {
+        return (E)children.get(idx);
     }
 
     /**


Mime
View raw message