Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PrototypeFactoryDeprecated #338

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/javarosa/core/model/QuestionDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* filling out a form.
*
* QuestionDef requires that any IDataReferences that are used
* are contained in the FormDefRMS's PrototypeFactoryDeprecated in order
* are registered with PrototypeManager in order
* to be properly deserialized. If they aren't, an exception
* will be thrown at the time of deserialization.
*
Expand Down

This file was deleted.

13 changes: 2 additions & 11 deletions src/main/java/org/javarosa/xform/parse/XFormParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
import org.javarosa.core.util.CacheTable;
import org.javarosa.core.util.StopWatch;
import org.javarosa.core.util.externalizable.PrototypeFactory;
import org.javarosa.core.util.externalizable.PrototypeFactoryDeprecated;
import org.javarosa.model.xform.XPathReference;
import org.javarosa.xform.util.InterningKXmlParser;
import org.javarosa.xform.util.XFormAnswerDataParser;
Expand Down Expand Up @@ -149,7 +148,6 @@ public class XFormParser implements IXFormParserFunctions {
private static HashMap<String, IElementHandler> topLevelHandlers;
private static HashMap<String, IElementHandler> groupLevelHandlers;
private static final Map<String, Integer> typeMappings = TypeMappings.getMap();
private static PrototypeFactoryDeprecated modelPrototypes;
private static List<SubmissionParser> submissionParsers;

private Reader _reader;
Expand Down Expand Up @@ -205,7 +203,6 @@ public static void setAnswerResolver(IAnswerResolver answerResolver) {

private static void staticInit() {
initProcessingRules();
modelPrototypes = new PrototypeFactoryDeprecated();
submissionParsers = new ArrayList<>(1);

referencedInstanceIds = new HashSet<>();
Expand Down Expand Up @@ -2020,14 +2017,8 @@ public static TreeElement buildInstanceStructure(Element node, TreeElement paren
if (typeMappings.get(modelType) == null) {
throw new XFormParseException("ModelType " + modelType + " is not recognized.", node);
}
element = (TreeElement) modelPrototypes.getNewInstance(typeMappings.get(modelType).toString());
if (element == null) {
element = new TreeElement(name, multiplicity);
logger.info("No model type prototype available for {}", modelType);
} else {
element.setName(name);
element.setMult(multiplicity);
}
element = new TreeElement(name, multiplicity);
logger.info("No model type prototype available for {}", modelType);
}
if (node.getNamespace() != null) {
if (!node.getNamespace().equals(docnamespace)) {
Expand Down