From d61c6ab3ed70155462de87e0fc186fedac206aba Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 7 Jun 2022 16:36:15 +0200 Subject: GC unused code --- .../main/java/com/yahoo/vespa/DocumentGenMojo.java | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) 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 0183e2d08a6..0f3531720ae 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 @@ -33,7 +33,6 @@ import java.io.FileWriter; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; @@ -459,7 +458,7 @@ public class DocumentGenMojo extends AbstractMojo { exportEquals(className, allUniqueFields, out, 1); Set exportedStructs = exportStructTypes(docType.getTypes(), out, 1, null); if (hasAnyPositionField(allUniqueFields)) { - exportedStructs = exportStructTypes(Arrays.asList(PositionDataType.INSTANCE), out, 1, exportedStructs); + exportedStructs = exportStructTypes(List.of(PositionDataType.INSTANCE), out, 1, exportedStructs); } docTypes.put(docType.getName(), packageName+"."+className); for (DataType exportedStruct : exportedStructs) { @@ -572,16 +571,6 @@ public class DocumentGenMojo extends AbstractMojo { ind(ind)+"}\n\n"); } - private static void exportStructTypeGetter(String name, Collection fields, Writer out, int ind, String methodName, String retType) throws IOException { - out.write(ind(ind)+"private static "+retType+" "+methodName+"() {\n" + - ind(ind+1)+retType+" ret = new "+retType+"(\""+name+"\");\n"); - for (Field f : fields) { - out.write(ind(ind+1)+"ret.addField(new com.yahoo.document.Field(\""+f.getName()+"\", "+toJavaReference(f.getDataType())+"));\n"); - - } - out.write(ind(ind+1)+"return ret;\n"); - out.write(ind(ind)+"}\n\n"); - } private static void addExtendedField(String className, Field f, Writer out, int ind) throws IOException { out.write(ind(ind)+ "ret.addField(new com.yahoo.document.ExtendedField(\""+f.getName()+"\", " + toJavaReference(f.getDataType()) + ",\n"); out.write(ind(ind+1) + "new com.yahoo.document.ExtendedField.Extract() {\n"); @@ -647,17 +636,6 @@ public class DocumentGenMojo extends AbstractMojo { out.write(ind(ind)+"}\n\n"); } - private static void exportOverriddenStructGetter(Collection fields, Writer out, int ind, String methodName, String structType) throws IOException { - out.write(ind(ind)+"@Override @Deprecated public com.yahoo.document.datatypes.Struct "+methodName+"() {\n" + - ind(ind+1)+"com.yahoo.document.datatypes.Struct ret = new com.yahoo.document.datatypes.Struct("+structType+");\n"); - for (Field f : fields) { - out.write(ind(ind+1)+"ret.setFieldValue(\""+f.getName()+"\", getFieldValue(getField(\""+f.getName()+"\")));\n"); - - } - out.write(ind(ind+1)+"return ret;\n"); - out.write(ind(ind)+"}\n\n"); - } - /** * Exports the necessary overridden methods from Document/StructuredFieldValue */ -- cgit v1.2.3