From 9d9a6149d9b8f1985981fd070d73a7f2e48c6b39 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Fri, 16 Feb 2024 20:26:49 +0100 Subject: [PATCH] Do not use singletons for generators --- .../codehaus/modello/plugin/converters/ConverterGenerator.java | 2 -- .../org/codehaus/modello/plugin/dom4j/Dom4jReaderGenerator.java | 2 -- .../org/codehaus/modello/plugin/dom4j/Dom4jWriterGenerator.java | 2 -- .../codehaus/modello/plugin/jackson/JacksonReaderGenerator.java | 2 -- .../codehaus/modello/plugin/jackson/JacksonWriterGenerator.java | 2 -- .../org/codehaus/modello/plugin/java/JavaModelloGenerator.java | 2 -- .../org/codehaus/modello/plugin/jdom/JDOMWriterGenerator.java | 2 -- .../codehaus/modello/plugin/jsonschema/JsonSchemaGenerator.java | 2 -- .../org/codehaus/modello/plugin/sax/SaxWriterGenerator.java | 2 -- .../plugin/snakeyaml/SnakeYamlExtendedReaderGenerator.java | 2 -- .../modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java | 2 -- .../modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java | 2 -- .../org/codehaus/modello/plugin/stax/StaxReaderGenerator.java | 2 -- .../codehaus/modello/plugin/stax/StaxSerializerGenerator.java | 2 -- .../org/codehaus/modello/plugin/stax/StaxWriterGenerator.java | 2 -- .../modello/plugin/xpp3/Xpp3ExtendedReaderGenerator.java | 2 -- .../modello/plugin/xpp3/Xpp3ExtendedWriterGenerator.java | 2 -- .../org/codehaus/modello/plugin/xpp3/Xpp3ReaderGenerator.java | 2 -- .../org/codehaus/modello/plugin/xpp3/Xpp3WriterGenerator.java | 2 -- .../main/java/org/codehaus/modello/plugin/xsd/XsdGenerator.java | 2 -- 20 files changed, 40 deletions(-) diff --git a/modello-plugins/modello-plugin-converters/src/main/java/org/codehaus/modello/plugin/converters/ConverterGenerator.java b/modello-plugins/modello-plugin-converters/src/main/java/org/codehaus/modello/plugin/converters/ConverterGenerator.java index 1133e5807..9990951a8 100644 --- a/modello-plugins/modello-plugin-converters/src/main/java/org/codehaus/modello/plugin/converters/ConverterGenerator.java +++ b/modello-plugins/modello-plugin-converters/src/main/java/org/codehaus/modello/plugin/converters/ConverterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.ArrayList; @@ -57,7 +56,6 @@ * Generate a basic conversion class between two versions of a model. */ @Named("converters") -@Singleton public class ConverterGenerator extends AbstractJavaModelloGenerator { public void generate(Model model, Properties parameters) throws ModelloException { initialize(model, parameters); diff --git a/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jReaderGenerator.java b/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jReaderGenerator.java index d90ed8112..2502b1e06 100644 --- a/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jReaderGenerator.java +++ b/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -53,7 +52,6 @@ * @author Brett Porter */ @Named("dom4j-reader") -@Singleton public class Dom4jReaderGenerator extends AbstractXmlJavaGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jWriterGenerator.java b/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jWriterGenerator.java index 66308e613..d20b11b0a 100644 --- a/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jWriterGenerator.java +++ b/modello-plugins/modello-plugin-dom4j/src/main/java/org/codehaus/modello/plugin/dom4j/Dom4jWriterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -56,7 +55,6 @@ * @author Brett Porter */ @Named("dom4j-writer") -@Singleton public class Dom4jWriterGenerator extends AbstractXmlJavaGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonReaderGenerator.java b/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonReaderGenerator.java index 885f34e13..5445328b0 100644 --- a/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonReaderGenerator.java +++ b/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -55,7 +54,6 @@ * @author Simone Tripodi */ @Named("jackson-reader") -@Singleton public class JacksonReaderGenerator extends AbstractJacksonGenerator { private static final String SOURCE_PARAM = "source"; diff --git a/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonWriterGenerator.java b/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonWriterGenerator.java index af0c39e68..8199eb92f 100644 --- a/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonWriterGenerator.java +++ b/modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonWriterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -50,7 +49,6 @@ * @author Simone Tripodi */ @Named("jackson-writer") -@Singleton public class JacksonWriterGenerator extends AbstractJacksonGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/JavaModelloGenerator.java b/modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/JavaModelloGenerator.java index 2e346eaf7..7a8360588 100644 --- a/modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/JavaModelloGenerator.java +++ b/modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/JavaModelloGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.io.Serializable; @@ -69,7 +68,6 @@ * @author Jason van Zyl */ @Named("java") -@Singleton public class JavaModelloGenerator extends AbstractJavaModelloGenerator { private Collection immutableTypes = new HashSet(Arrays.asList(new String[] { diff --git a/modello-plugins/modello-plugin-jdom/src/main/java/org/codehaus/modello/plugin/jdom/JDOMWriterGenerator.java b/modello-plugins/modello-plugin-jdom/src/main/java/org/codehaus/modello/plugin/jdom/JDOMWriterGenerator.java index de3a833e3..7283f8a7f 100644 --- a/modello-plugins/modello-plugin-jdom/src/main/java/org/codehaus/modello/plugin/jdom/JDOMWriterGenerator.java +++ b/modello-plugins/modello-plugin-jdom/src/main/java/org/codehaus/modello/plugin/jdom/JDOMWriterGenerator.java @@ -17,7 +17,6 @@ package org.codehaus.modello.plugin.jdom; import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.ArrayList; @@ -48,7 +47,6 @@ * @author mkleint@codehaus.org */ @Named("jdom-writer") -@Singleton public class JDOMWriterGenerator extends AbstractJDOMGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-jsonschema/src/main/java/org/codehaus/modello/plugin/jsonschema/JsonSchemaGenerator.java b/modello-plugins/modello-plugin-jsonschema/src/main/java/org/codehaus/modello/plugin/jsonschema/JsonSchemaGenerator.java index 92ccbff5c..4389b1e69 100644 --- a/modello-plugins/modello-plugin-jsonschema/src/main/java/org/codehaus/modello/plugin/jsonschema/JsonSchemaGenerator.java +++ b/modello-plugins/modello-plugin-jsonschema/src/main/java/org/codehaus/modello/plugin/jsonschema/JsonSchemaGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.File; import java.io.IOException; @@ -52,7 +51,6 @@ * @since 1.8 */ @Named("jsonschema") -@Singleton public final class JsonSchemaGenerator extends AbstractXmlJavaGenerator { public void generate(Model model, Properties parameters) throws ModelloException { diff --git a/modello-plugins/modello-plugin-sax/src/main/java/org/codehaus/modello/plugin/sax/SaxWriterGenerator.java b/modello-plugins/modello-plugin-sax/src/main/java/org/codehaus/modello/plugin/sax/SaxWriterGenerator.java index 6b80b6994..53af30404 100644 --- a/modello-plugins/modello-plugin-sax/src/main/java/org/codehaus/modello/plugin/sax/SaxWriterGenerator.java +++ b/modello-plugins/modello-plugin-sax/src/main/java/org/codehaus/modello/plugin/sax/SaxWriterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -55,7 +54,6 @@ * @author Simone Tripodi */ @Named("sax-writer") -@Singleton public class SaxWriterGenerator extends AbstractXmlJavaGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlExtendedReaderGenerator.java b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlExtendedReaderGenerator.java index def3831c3..a2f5f94e3 100644 --- a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlExtendedReaderGenerator.java +++ b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlExtendedReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import org.codehaus.modello.model.ModelClass; @@ -33,7 +32,6 @@ * @author Simone Tripodi */ @Named("snakeyaml-extended-reader") -@Singleton public class SnakeYamlExtendedReaderGenerator extends SnakeYamlReaderGenerator { @Override diff --git a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java index fb20fb558..78f5c3485 100644 --- a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java +++ b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -53,7 +52,6 @@ * @author Simone Tripodi */ @Named("snakeyaml-reader") -@Singleton public class SnakeYamlReaderGenerator extends AbstractSnakeYamlGenerator { private static final String SOURCE_PARAM = "source"; diff --git a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java index 5894b34b7..33e2112ca 100644 --- a/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java +++ b/modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlWriterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -50,7 +49,6 @@ * @author Simone Tripodi */ @Named("snakeyaml-writer") -@Singleton public class SnakeYamlWriterGenerator extends AbstractSnakeYamlGenerator { public void generate(Model model, Properties parameters) throws ModelloException { diff --git a/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxReaderGenerator.java b/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxReaderGenerator.java index 70784fcb2..7957c2048 100644 --- a/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxReaderGenerator.java +++ b/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.Arrays; @@ -58,7 +57,6 @@ * @author Emmanuel Venisse */ @Named("stax-reader") -@Singleton public class StaxReaderGenerator extends AbstractStaxGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxSerializerGenerator.java b/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxSerializerGenerator.java index 8fb787cd8..566c3f115 100644 --- a/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxSerializerGenerator.java +++ b/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxSerializerGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.ArrayList; @@ -48,7 +47,6 @@ * @author Benjamin Bentmann */ @Named("stax-serializer") -@Singleton public class StaxSerializerGenerator extends AbstractStaxGenerator { public void generate(Model model, Properties parameters) throws ModelloException { diff --git a/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxWriterGenerator.java b/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxWriterGenerator.java index 0e01724c8..9149136e9 100644 --- a/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxWriterGenerator.java +++ b/modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/StaxWriterGenerator.java @@ -24,7 +24,6 @@ import javax.inject.Inject; import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -55,7 +54,6 @@ * @author Emmanuel Venisse */ @Named("stax-writer") -@Singleton public class StaxWriterGenerator extends AbstractStaxGenerator { private boolean requiresDomSupport; diff --git a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedReaderGenerator.java b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedReaderGenerator.java index 138a728ce..9ebe5031e 100644 --- a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedReaderGenerator.java +++ b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import org.codehaus.modello.model.ModelClass; @@ -33,7 +32,6 @@ * @author Benjamin Bentmann */ @Named("xpp3-extended-reader") -@Singleton public class Xpp3ExtendedReaderGenerator extends Xpp3ReaderGenerator { @Override diff --git a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedWriterGenerator.java b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedWriterGenerator.java index e9c2d1d7a..421795f55 100644 --- a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedWriterGenerator.java +++ b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedWriterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import org.codehaus.modello.plugin.java.javasource.JClass; import org.codehaus.modello.plugin.java.javasource.JField; @@ -39,7 +38,6 @@ * @since 1.10 */ @Named("xpp3-extended-writer") -@Singleton public class Xpp3ExtendedWriterGenerator extends Xpp3WriterGenerator { @Override protected boolean isLocationTracking() { diff --git a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ReaderGenerator.java b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ReaderGenerator.java index 1982e09af..69e271e47 100644 --- a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ReaderGenerator.java +++ b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ReaderGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -58,7 +57,6 @@ * @author Emmanuel Venisse */ @Named("xpp3-reader") -@Singleton public class Xpp3ReaderGenerator extends AbstractXpp3Generator { private static final String SOURCE_PARAM = "source"; diff --git a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3WriterGenerator.java b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3WriterGenerator.java index 2ca5be321..9962e174c 100644 --- a/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3WriterGenerator.java +++ b/modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3WriterGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.IOException; import java.util.List; @@ -54,7 +53,6 @@ * @author Emmanuel Venisse */ @Named("xpp3-writer") -@Singleton public class Xpp3WriterGenerator extends AbstractXpp3Generator { private String extendedClassnameSuffix; diff --git a/modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/XsdGenerator.java b/modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/XsdGenerator.java index 1daa7ccc3..c8d88e6c0 100644 --- a/modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/XsdGenerator.java +++ b/modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/XsdGenerator.java @@ -23,7 +23,6 @@ */ import javax.inject.Named; -import javax.inject.Singleton; import java.io.File; import java.io.IOException; @@ -52,7 +51,6 @@ * @author Brett Porter */ @Named("xsd") -@Singleton public class XsdGenerator extends AbstractXmlGenerator { /** * Value standing for any element name (used on xml.tagName)