ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [45/50] [abbrv] incubator-ignite git commit: sprint-6 - Fixed broken Externalizable classes + added check
Date Mon, 15 Jun 2015 17:25:37 GMT
sprint-6 - Fixed broken Externalizable classes + added check


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

Branch: refs/heads/ignite-648-win
Commit: 40f826bf9037e4341904e87b90f20e3eb0388f85
Parents: 2f7b253
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Fri Jun 12 17:05:07 2015 -0700
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Fri Jun 12 17:05:07 2015 -0700

----------------------------------------------------------------------
 .../rest/client/message/GridRouterRequest.java    | 18 ++++++++++++++++++
 .../rest/client/message/GridRouterResponse.java   | 18 ++++++++++++++++++
 .../ignite/tools/classgen/ClassesGenerator.java   | 12 ++++++++++++
 3 files changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/40f826bf/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
index 6dcbf92..7839e22 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.rest.client.message;
 
+import java.io.*;
 import java.util.*;
 
 /**
@@ -30,6 +31,13 @@ public class GridRouterRequest extends GridClientAbstractMessage {
     private final byte[] body;
 
     /**
+     * For {@link Externalizable} (not supported).
+     */
+    public GridRouterRequest() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
      * @param body Message in raw form.
      * @param clientId Client id.
      * @param reqId Request id.
@@ -51,6 +59,16 @@ public class GridRouterRequest extends GridClientAbstractMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return "GridRouterRequest [clientId=" + clientId() + ", reqId=" + requestId() + ",
" +
             "destId=" + destinationId() + ", length=" + body.length + "]";

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/40f826bf/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
index 2ff3e21..9054d8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.rest.client.message;
 
+import java.io.*;
 import java.util.*;
 
 /**
@@ -36,6 +37,13 @@ public class GridRouterResponse extends GridClientAbstractMessage {
     private final int status;
 
     /**
+     * For {@link Externalizable} (not supported).
+     */
+    public GridRouterResponse() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
      * @param body Message in raw form.
      * @param clientId Client id.
      * @param reqId Request id.
@@ -73,6 +81,16 @@ public class GridRouterResponse extends GridClientAbstractMessage {
     }
 
     /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return "GridRouterResponse [" +
             "clientId=" + clientId() +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/40f826bf/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
----------------------------------------------------------------------
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
index feb2d9d..20dcc7f 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
+++ b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
@@ -215,6 +215,18 @@ public class ClassesGenerator {
                     catch (NoSuchFieldException ignored) {
                         errs.add("No serialVersionUID field in class: " + cls.getName());
                     }
+
+                    if (Externalizable.class.isAssignableFrom(cls)) {
+                        try {
+                            Constructor<?> cons = cls.getConstructor();
+
+                            if (!Modifier.isPublic(cons.getModifiers()))
+                                errs.add("Default constructor in Externalizable class is
not public: " + cls.getName());
+                        }
+                        catch (NoSuchMethodException e) {
+                            errs.add("No default constructor in Externalizable class: " +
cls.getName());
+                        }
+                    }
                 }
 
                 classes.add((Class)cls);


Mime
View raw message