dion        2002/10/14 00:39:23

  Modified:    src/java/org/apache/maven MavenUtils.java
  Log:
  - Rearrange code to allow easier understanding
  - remove unused object
  - cache xml bean infos
  
  Revision  Changes    Path
  1.46      +6 -7      jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java
  
  Index: MavenUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- MavenUtils.java   25 Aug 2002 12:38:08 -0000      1.45
  +++ MavenUtils.java   14 Oct 2002 07:39:23 -0000      1.46
  @@ -189,11 +189,6 @@
       private static Project getJellyProject(Project project, 
           MavenJellyContext parentContext) throws Exception
       {
  -        ByteArrayOutputStream baos = new ByteArrayOutputStream();
  -        Jelly jelly = new Jelly();
  -        Writer writer = new BufferedWriter(new OutputStreamWriter(baos));
  -        XMLParser parser = new XMLParser();
  -        
           JellyContext context = null;
           
           if (parentContext != null)
  @@ -205,15 +200,18 @@
           {
               context = new JellyContext();
           }
  -        
           context.setVariable("pom", project);
  +        XMLParser parser = new XMLParser();
           parser.setContext(context);
           
  +//        Jelly jelly = new Jelly();
           
           Script script = parser.parse(new InputStreamReader(
               getProjectInputStream(project)));
           script = script.compile();
           
  +        ByteArrayOutputStream baos = new ByteArrayOutputStream();
  +        Writer writer = new BufferedWriter(new OutputStreamWriter(baos));
           XMLOutput output = XMLOutput.createXMLOutput(writer);
           script.run(context, output);
           writer.close();
  @@ -566,6 +564,7 @@
   
           // set elements for attributes to true
           introspector.setAttributesForPrimitives(false);
  +        introspector.setCachingEnabled(true);
   
           // wrap collections in an XML element
           //introspector.setWrapCollectionsInElement(true);
  
  
  

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

Reply via email to