Merge into master from pull request #268:
java/OFErrorCauseData: fix regression - URGENT (https://github.com/floodlight/loxigen/pull/268)
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 1920bed..707a425 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -502,7 +502,7 @@
udf = JType("UDF") \
.op(version=ANY, read="UDF.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="UDF.ZERO")
error_cause_data = JType("OFErrorCauseData") \
- .op(version=ANY, read="OFErrorCauseData.read(bb, $length, OFVersion.OF_$version)", write="$name.writeTo(bb)");
+ .op(version=ANY, read="OFErrorCauseData.read(bb, $length, OFVersion.OF_$version)", write="$name.writeTo(bb)", default="OFErrorCauseData.NONE");
generic_t = JType("T")
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFErrorCauseData.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFErrorCauseData.java
index b5c7af0..824b809 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFErrorCauseData.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFErrorCauseData.java
@@ -30,6 +30,12 @@
private static final Logger logger =
LoggerFactory.getLogger(OFErrorCauseData.class);
+ /** A default 'empty' cause. Note: the OFVersion OF_13 passed in here is irrelevant,
+ * because parsing of the 0-byte array will always return null, irrespective of the
+ * version.
+ */
+ public static final OFErrorCauseData NONE = new OFErrorCauseData(new byte[0], OFVersion.OF_13);
+
private final byte[] data;
private final OFVersion version;