santiagopg 2004/03/23 13:11:09
Modified: java/src/org/apache/xpath/compiler Compiler.java
FunctionTable.java
Log:
Patch to hide static function table in FunctionTable class. We do not want to
expose this table to others.
Revision Changes Path
1.37 +2 -2
xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java
Index: Compiler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/Compiler.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- Compiler.java 17 Feb 2004 04:32:49 -0000 1.36
+++ Compiler.java 23 Mar 2004 21:11:09 -0000 1.37
@@ -1037,7 +1037,7 @@
}
catch (WrongNumberArgsException wnae)
{
- java.lang.String name = FunctionTable.m_functions[funcID].getName();
+ java.lang.String name = FunctionTable.getFunctionName(funcID);
m_errorHandler.fatalError( new TransformerException(
XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS,
1.7 +11 -3
xml-xalan/java/src/org/apache/xpath/compiler/FunctionTable.java
Index: FunctionTable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/compiler/FunctionTable.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FunctionTable.java 17 Feb 2004 04:32:48 -0000 1.6
+++ FunctionTable.java 23 Mar 2004 21:11:09 -0000 1.7
@@ -137,7 +137,7 @@
/**
* The function table.
*/
- public static FuncLoader m_functions[];
+ private static FuncLoader m_functions[];
/**
* Number of built in functions. Be sure to update this as
@@ -154,7 +154,7 @@
* The index to the next free function index.
*/
static int m_funcNextFreeIndex = NUM_BUILT_IN_FUNCS;
-
+
static
{
m_functions = new FuncLoader[NUM_BUILT_IN_FUNCS + NUM_ALLOWABLE_ADDINS];
@@ -215,6 +215,14 @@
FUNC_DOCLOCATION);
m_functions[FUNC_UNPARSED_ENTITY_URI] =
new FuncLoader("FuncUnparsedEntityURI", FUNC_UNPARSED_ENTITY_URI);
+ }
+
+ /**
+ * Return the name of the a function in the static table. Needed to avoid
+ * making the table publicly available.
+ */
+ static String getFunctionName(int funcID) {
+ return m_functions[funcID].getName();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]