From 2bcaf96baa296ad84881c79f537b1acb3805b160 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 16 Nov 2016 10:58:26 +0100 Subject: Preserve old behavior where doing a setFieldValue on a string field, would make an empty spanTreeMap when there where no annotations. However this is different that using the generated setter, which will not touch any annotations. But that is the same issue as always. --- .../src/main/java/com/yahoo/vespa/DocumentGenMojo.java | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'vespa-documentgen-plugin/src/main/java') diff --git a/vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java b/vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java index 8434f9b635a..a1ba05eacb3 100644 --- a/vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java +++ b/vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java @@ -578,7 +578,6 @@ public class DocumentGenMojo extends AbstractMojo { exportGetFieldCount(fieldSet, out, ind); exportGetField(out, ind); exportGetFieldValue(fieldSet, out, ind); - exportToNamedMap(out, ind); exportSetFieldValue(fieldSet, out, ind); exportRemoveFieldValue(fieldSet, out, ind); exportIterator(fieldSet, out, ind); @@ -598,18 +597,6 @@ public class DocumentGenMojo extends AbstractMojo { out.write(ind(ind)+"}\n\n"); } - private static void exportToNamedMap(Writer out, int ind) throws IOException { - // A helper to convert from SpanTree collection to Map. Can be removed if StringFieldValue is fixed to expose the map. - out.write( - ind()+"private static java.util.Map toNamedMap(java.util.Collection coll) {\n" + - ind(ind+1)+"if (coll==null) return null;\n" + - ind(ind+1)+"java.util.Map ret = new java.util.HashMap();\n" + - ind(ind+1)+"for (com.yahoo.document.annotation.SpanTree st : coll) ret.put(st.getName(), st);\n" + - ind(ind+1)+"return ret;\n" + - ind()+"}\n\n" - ); - } - private static void exportHashCode(Collection fieldSet, Writer out, int ind, String hcBase) throws IOException { out.write(ind(ind)+"@Override public int hashCode() {\n"); out.write(ind(ind+1)+"int hc = "+hcBase+";\n"); -- cgit v1.2.3