cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From coli...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_JavaScriptInterpreter.java
Date Wed, 11 Feb 2004 18:15:29 GMT
coliver     2004/02/11 10:15:29

  Modified:    src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_JavaScriptInterpreter.java
  Log:
  Ensure complete recompilation of compilation unit containing inner classes
  
  Revision  Changes    Path
  1.21      +25 -12    cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
  
  Index: FOM_JavaScriptInterpreter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- FOM_JavaScriptInterpreter.java	31 Jan 2004 16:50:56 -0000	1.20
  +++ FOM_JavaScriptInterpreter.java	11 Feb 2004 18:15:29 -0000	1.21
  @@ -63,6 +63,8 @@
   import java.util.LinkedList;
   import java.util.List;
   import java.util.Map;
  +import java.util.HashSet;
  +import java.util.Set;
   import java.util.StringTokenizer;
   
   import org.apache.avalon.framework.CascadingRuntimeException;
  @@ -179,7 +181,13 @@
                       byte[] contents) {
               javaSource.put(src.getURI(), src.getValidity());
               javaClass.put(className, contents);
  -            sourceToClass.put(src.getURI(), className);
  +            String uri = src.getURI();
  +            Set set = (Set)sourceToClass.get(uri);
  +            if (set == null) {
  +                set = new HashSet();
  +                sourceToClass.put(uri, set);
  +            }
  +            set.add(className);
               classToSource.put(className, src.getURI());
           }
   
  @@ -217,11 +225,16 @@
               iter = invalid.iterator();
               while (iter.hasNext()) {
                   String uri = (String)iter.next();
  -                String className = (String)sourceToClass.get(uri);
  -                sourceToClass.remove(className);
  -                javaClass.remove(className);
  +                Set set = (Set)sourceToClass.get(uri);
  +                Iterator ii = set.iterator();
  +                while (ii.hasNext()) {
  +                    String className = (String)ii.next();
  +                    sourceToClass.remove(className);
  +                    javaClass.remove(className);
  +                    classToSource.remove(className);
  +                }
  +                set.clear();
                   javaSource.remove(uri);
  -                classToSource.remove(className);
               }
               return invalid.size() == 0;
           }
  @@ -332,15 +345,15 @@
                   classLoader.addSourceListener(
                           new CompilingClassLoader.SourceListener() {
                               public void sourceCompiled(Source src) {
  -                            // no action
  +                                // no action
                               }
   
                               public void sourceCompilationError(Source src,
  -                                                String errMsg) {
  -                                throw Context.reportRuntimeError(
  -                                        ToolErrorReporter.getMessage(
  -                                                "msg.uncaughtJSException",
  -                                                errMsg));
  +                                                               String errMsg) {
  +                                
  +                                if (src != null) {
  +                                    throw Context.reportRuntimeError(errMsg);
  +                                }
                               }
                           });
                   updateSourcePath();
  
  
  

Mime
View raw message