garyp       01/07/10 23:49:53

  Modified:    java/src/org/apache/xpath/compiler Compiler.java
  Log:
  Fix bug 2175 <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2175> by adding the 
current time to the method key to ensure method key uniqueness.  Multiple Compilers 
were getting the same hashCode, particularly in Visual Age for Java, due to aggressive 
garbage collection.  Added the current time in mills to distinguish between the 
different functions being compiled.
  
  Revision  Changes    Path
  1.25      +7 -3      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Compiler.java     2001/06/12 19:16:29     1.24
  +++ Compiler.java     2001/07/11 06:49:51     1.25
  @@ -1112,10 +1112,14 @@
   
       opPos++;
   
  -    Function extension = new FuncExtFunction(ns, funcName,
  +    // We create a method key to uniquely identify this function so that we
  +    // can cache the object needed to invoke it.  This way, we only pay the
  +    // reflection overhead on the first call.
   
  -    // Create a method key, for faster lookup.
  -    String.valueOf(opPos) + String.valueOf(hashCode()));
  +    Function extension = new FuncExtFunction(ns, funcName, 
  +         String.valueOf(opPos)
  +       + String.valueOf(hashCode())
  +       + String.valueOf(System.currentTimeMillis()));
   
       try
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to