-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix thread safety issues by not using singletons for generators (#415)
- Loading branch information
Showing
20 changed files
with
0 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Brett Porter</a> | ||
*/ | ||
@Named("dom4j-reader") | ||
@Singleton | ||
public class Dom4jReaderGenerator extends AbstractXmlJavaGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Brett Porter</a> | ||
*/ | ||
@Named("dom4j-writer") | ||
@Singleton | ||
public class Dom4jWriterGenerator extends AbstractXmlJavaGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Simone Tripodi</a> | ||
*/ | ||
@Named("jackson-reader") | ||
@Singleton | ||
public class JacksonReaderGenerator extends AbstractJacksonGenerator { | ||
|
||
private static final String SOURCE_PARAM = "source"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Simone Tripodi</a> | ||
*/ | ||
@Named("jackson-writer") | ||
@Singleton | ||
public class JacksonWriterGenerator extends AbstractJacksonGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Jason van Zyl</a> | ||
*/ | ||
@Named("java") | ||
@Singleton | ||
public class JavaModelloGenerator extends AbstractJavaModelloGenerator { | ||
|
||
private Collection<String> immutableTypes = new HashSet<String>(Arrays.asList(new String[] { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] | ||
*/ | ||
@Named("jdom-writer") | ||
@Singleton | ||
public class JDOMWriterGenerator extends AbstractJDOMGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Simone Tripodi</a> | ||
*/ | ||
@Named("sax-writer") | ||
@Singleton | ||
public class SaxWriterGenerator extends AbstractXmlJavaGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ | |
*/ | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Singleton; | ||
|
||
import org.codehaus.modello.model.ModelClass; | ||
|
||
|
@@ -33,7 +32,6 @@ | |
* @author <a href="mailto:[email protected]">Simone Tripodi</a> | ||
*/ | ||
@Named("snakeyaml-extended-reader") | ||
@Singleton | ||
public class SnakeYamlExtendedReaderGenerator extends SnakeYamlReaderGenerator { | ||
|
||
@Override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Simone Tripodi</a> | ||
*/ | ||
@Named("snakeyaml-reader") | ||
@Singleton | ||
public class SnakeYamlReaderGenerator extends AbstractSnakeYamlGenerator { | ||
|
||
private static final String SOURCE_PARAM = "source"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Simone Tripodi</a> | ||
*/ | ||
@Named("snakeyaml-writer") | ||
@Singleton | ||
public class SnakeYamlWriterGenerator extends AbstractSnakeYamlGenerator { | ||
|
||
public void generate(Model model, Properties parameters) throws ModelloException { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Emmanuel Venisse</a> | ||
*/ | ||
@Named("stax-reader") | ||
@Singleton | ||
public class StaxReaderGenerator extends AbstractStaxGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Emmanuel Venisse </a> | ||
*/ | ||
@Named("stax-writer") | ||
@Singleton | ||
public class StaxWriterGenerator extends AbstractStaxGenerator { | ||
|
||
private boolean requiresDomSupport; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Emmanuel Venisse</a> | ||
*/ | ||
@Named("xpp3-reader") | ||
@Singleton | ||
public class Xpp3ReaderGenerator extends AbstractXpp3Generator { | ||
|
||
private static final String SOURCE_PARAM = "source"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Emmanuel Venisse </a> | ||
*/ | ||
@Named("xpp3-writer") | ||
@Singleton | ||
public class Xpp3WriterGenerator extends AbstractXpp3Generator { | ||
private String extendedClassnameSuffix; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <a href="mailto:[email protected]">Brett Porter</a> | ||
*/ | ||
@Named("xsd") | ||
@Singleton | ||
public class XsdGenerator extends AbstractXmlGenerator { | ||
/** | ||
* Value standing for any element name (used on xml.tagName) | ||
|