Author: shawkins
Date: 2011-12-22 13:31:53 -0500 (Thu, 22 Dec 2011)
New Revision: 3757
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java
Log:
TEIID-1824 minimizing factory creation
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2011-12-22
01:53:47 UTC (rev 3756)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataParser.java 2011-12-22
18:31:53 UTC (rev 3757)
@@ -24,21 +24,31 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.*;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
-import javax.xml.stream.*;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Model;
import org.teiid.adminapi.Translator;
import org.teiid.adminapi.impl.DataPolicyMetadata.PermissionMetaData;
import org.teiid.adminapi.impl.ModelMetaData.ValidationError;
+import org.teiid.core.types.XMLType;
@SuppressWarnings("nls")
public class VDBMetadataParser {
public static VDBMetaData unmarshell(InputStream content) throws XMLStreamException {
- XMLInputFactory inputFactory=XMLInputFactory.newInstance();
+ XMLInputFactory inputFactory=XMLType.getXmlInputFactory();
XMLStreamReader reader = inputFactory.createXMLStreamReader(content);
// elements
Modified:
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java
===================================================================
---
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java 2011-12-22
01:53:47 UTC (rev 3756)
+++
trunk/common-core/src/main/java/org/teiid/core/types/basic/StringToSQLXMLTransform.java 2011-12-22
18:31:53 UTC (rev 3757)
@@ -60,7 +60,7 @@
public static Type isXml(Reader reader) throws TransformationException {
Type type = Type.ELEMENT;
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ XMLInputFactory inputFactory = XMLType.getXmlInputFactory();
try{
XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(reader);
int event = xmlReader.getEventType();
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-12-22
01:53:47 UTC (rev 3756)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-12-22
18:31:53 UTC (rev 3757)
@@ -975,7 +975,6 @@
// ================== Function = convert =====================
- @SuppressWarnings("unchecked")
public static Object convert(Object src, String type)
throws FunctionExecutionException {
try {
@@ -1035,8 +1034,10 @@
* This function should never actually be called - it is here solely so the
* lookup function can be resolved properly. The actual function is
* implemented in the ExpresionEvaluator
- * @param context The context to apply the criteria in
- * @param expression The expression on the left side of the criteria
+ * @param codeTable
+ * @param returnElement
+ * @param keyElement
+ * @param keyValue
* @return Same as expression
*/
public static Object lookup(Object codeTable, Object returnElement, Object
keyElement, Object keyValue) {
Modified:
trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java 2011-12-22
01:53:47 UTC (rev 3756)
+++
trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java 2011-12-22
18:31:53 UTC (rev 3757)
@@ -15,6 +15,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import org.teiid.core.types.XMLType;
import org.teiid.metadata.FunctionMethod;
import org.teiid.metadata.FunctionParameter;
@@ -31,7 +32,7 @@
}
public static FunctionMetadataReader parseFunctions(InputStream content) throws
XMLStreamException {
- XMLInputFactory inputFactory=XMLInputFactory.newInstance();
+ XMLInputFactory inputFactory=XMLType.getXmlInputFactory();
XMLStreamReader reader = inputFactory.createXMLStreamReader(content);
FunctionMetadataReader fmr = new FunctionMetadataReader();
while (reader.hasNext() && (reader.nextTag() !=
XMLStreamConstants.END_ELEMENT)) {