You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2015/12/22 19:04:31 UTC

incubator-geode git commit: GEODE-709: CI Failure in AnalyzeSerializablesJUnitTest

Repository: incubator-geode
Updated Branches:
  refs/heads/develop 05f041391 -> 1a025728a


GEODE-709: CI Failure in AnalyzeSerializablesJUnitTest

JDK 1.7 added three new types of entries to the "constant pool" of
a compiled class: InvokeDynamic, MethodHandle and MethodType.  The test
was failing when it ran into an InvokeDynamic entry (type code 18) in some
compiled class.

Evidently we had no classes that required an InvokeDynamic entry until
recently.

I also changed the test so it will log the name of the class that causes
a failure in constant-pool parsing in the future.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1a025728
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1a025728
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1a025728

Branch: refs/heads/develop
Commit: 1a025728ac45d24f48d17f261a44fd8277f77b7e
Parents: 05f0413
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Tue Dec 22 09:59:34 2015 -0800
Committer: Bruce Schuchardt <bs...@pivotal.io>
Committed: Tue Dec 22 09:59:34 2015 -0800

----------------------------------------------------------------------
 .../gemfire/codeAnalysis/decode/cp/Cp.java      | 14 +++++++--
 .../codeAnalysis/decode/cp/CpInvokeDynamic.java | 33 ++++++++++++++++++++
 .../codeAnalysis/decode/cp/CpMethodHandle.java  | 33 ++++++++++++++++++++
 .../codeAnalysis/decode/cp/CpMethodType.java    | 31 ++++++++++++++++++
 4 files changed, 109 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a025728/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/Cp.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/Cp.java b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/Cp.java
index 54634a1..d68d2e6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/Cp.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/Cp.java
@@ -18,7 +18,8 @@ package com.gemstone.gemfire.codeAnalysis.decode.cp;
 import java.io.*;
 
 /**
- * Cp represents an entry in the constant pool of a class
+ * Cp represents an entry in the constant pool of a class.
+ * See https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4
  */
 public class Cp {
 
@@ -33,6 +34,9 @@ public class Cp {
     protected static final int TAG_Double = 6;
     protected static final int TAG_NameAndType = 12;
     protected static final int TAG_Utf8 = 1;
+    protected static final int TAG_MethodHandle = 15;
+    protected static final int TAG_MethodType = 16;
+    protected static final int TAG_InvokeDynamic = 18;
 
     public static Cp readCp( DataInputStream source ) throws IOException {
         byte tag;
@@ -61,8 +65,14 @@ public class Cp {
                 return new CpNameAndType(source);
             case TAG_Utf8:
                 return new CpUtf8(source);
+            case TAG_MethodHandle:
+                return new CpMethodHandle(source);
+            case TAG_MethodType:
+                return new CpMethodType(source);
+            case TAG_InvokeDynamic:
+                return new CpInvokeDynamic(source);
             default:
-                throw new Error("Unknown tag type in constant pool: " + tag);
+                throw new IOException("Unknown tag type in constant pool: " + tag);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a025728/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpInvokeDynamic.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpInvokeDynamic.java b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpInvokeDynamic.java
new file mode 100755
index 0000000..142700d
--- /dev/null
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpInvokeDynamic.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.codeAnalysis.decode.cp;
+import java.io.*;
+
+import com.gemstone.gemfire.codeAnalysis.decode.CompiledClass;
+
+
+public class CpInvokeDynamic extends Cp {
+    int bootstrap_method_attr_index;
+    int name_and_type_index;
+    CpInvokeDynamic( DataInputStream source ) throws IOException {
+        bootstrap_method_attr_index = source.readUnsignedShort();
+        name_and_type_index = source.readUnsignedShort();
+    }
+    public String returnType(CompiledClass info) {
+        return "not yet implemented";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a025728/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodHandle.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodHandle.java b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodHandle.java
new file mode 100755
index 0000000..841fd8d
--- /dev/null
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodHandle.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.codeAnalysis.decode.cp;
+import java.io.*;
+
+import com.gemstone.gemfire.codeAnalysis.decode.CompiledClass;
+
+
+public class CpMethodHandle extends Cp {
+    byte reference_kind;
+    int reference_index;
+    CpMethodHandle( DataInputStream source ) throws IOException {
+        reference_kind = source.readByte();
+        reference_index = source.readUnsignedShort();
+    }
+    public String returnType(CompiledClass info) {
+        return "not yet implemented";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1a025728/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodType.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodType.java b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodType.java
new file mode 100755
index 0000000..0436bca
--- /dev/null
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/cp/CpMethodType.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.codeAnalysis.decode.cp;
+import java.io.*;
+
+import com.gemstone.gemfire.codeAnalysis.decode.CompiledClass;
+
+
+public class CpMethodType extends Cp {
+    int descriptor_index;
+    CpMethodType( DataInputStream source ) throws IOException {
+        descriptor_index = source.readUnsignedShort();
+    }
+    public String returnType(CompiledClass info) {
+        return "not yet implemented";
+    }
+}