maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-mboot2/src/main/java MBoot.java
Date Sun, 27 Feb 2005 23:30:07 GMT
brett       2005/02/27 15:30:07

  Modified:    maven-mboot2/src/main/java MBoot.java
  Log:
  mboot needed to be smarter about its parsing - was picking up <version> from anywhere
  removed unused "local" parsing
  
  Revision  Changes    Path
  1.51      +22 -66    maven-components/maven-mboot2/src/main/java/MBoot.java
  
  Index: MBoot.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/MBoot.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- MBoot.java	25 Feb 2005 05:09:13 -0000	1.50
  +++ MBoot.java	27 Feb 2005 23:30:07 -0000	1.51
  @@ -943,6 +943,8 @@
       class ModelReader
           extends DefaultHandler
       {
  +        int depth = 0;
  +
           String artifactId;
   
           String version;
  @@ -963,8 +965,6 @@
   
           private UnitTests unitTests;
   
  -        private Local local = new Local();
  -
           private List resources = new ArrayList();
   
           private Dependency currentDependency;
  @@ -977,8 +977,6 @@
   
           private boolean insideDependency = false;
   
  -        private boolean insideLocal = false;
  -
           private boolean insideUnitTest = false;
   
           private boolean insideResource = false;
  @@ -1014,11 +1012,6 @@
               return resources;
           }
   
  -        public Local getLocal()
  -        {
  -            return local;
  -        }
  -
           public boolean parse( File file )
           {
               this.file = file;
  @@ -1049,14 +1042,10 @@
               {
                   insideParent = true;
               }
  -            else if ( rawName.equals( "repository" ) && !insideLocal )
  +            else if ( rawName.equals( "repository" ) )
               {
                   insideRepository = true;
               }
  -            else if ( rawName.equals( "local" ) )
  -            {
  -                insideLocal = true;
  -            }
               else if ( rawName.equals( "unitTest" ) )
               {
                   unitTests = new UnitTests();
  @@ -1075,6 +1064,7 @@
   
                   insideResource = true;
               }
  +            depth ++;
           }
   
           public void characters( char buffer[], int start, int length )
  @@ -1127,10 +1117,6 @@
   
                   insideParent = false;
               }
  -            else if ( rawName.equals( "local" ) )
  -            {
  -                insideLocal = false;
  -            }
               else if ( rawName.equals( "unitTest" ) )
               {
                   insideUnitTest = false;
  @@ -1226,29 +1212,25 @@
                       unitTests.addExclude( getBodyText() );
                   }
               }
  -            else if ( rawName.equals( "artifactId" ) )
  -            {
  -                artifactId = getBodyText();
  -            }
  -            else if ( rawName.equals( "version" ) )
  -            {
  -                version = getBodyText();
  -            }
  -            else if ( rawName.equals( "groupId" ) )
  -            {
  -                groupId = getBodyText();
  -            }
  -            else if ( rawName.equals( "type" ) )
  -            {
  -                type = getBodyText();
  -            }
  -            else if ( rawName.equals( "repository" ) )
  +            else if ( depth == 2 )
               {
  -                if ( insideLocal )
  +                if ( rawName.equals( "artifactId" ) )
                   {
  -                    local.repository = getBodyText();
  +                    artifactId = getBodyText();
                   }
  -                else
  +                else if ( rawName.equals( "version" ) )
  +                {
  +                    version = getBodyText();
  +                }
  +                else if ( rawName.equals( "groupId" ) )
  +                {
  +                    groupId = getBodyText();
  +                }
  +                else if ( rawName.equals( "type" ) )
  +                {
  +                    type = getBodyText();
  +                }
  +                else if ( rawName.equals( "repository" ) )
                   {
                       insideRepository = false;
                   }
  @@ -1262,6 +1244,8 @@
               }
   
               bodyText = new StringBuffer();
  +
  +            depth --;
           }
   
           public void warning( SAXParseException spe )
  @@ -1544,32 +1528,4 @@
               this.filtering = filtering;
           }
       }
  -
  -    public static class Local
  -        implements Serializable
  -    {
  -        private String repository;
  -
  -        private String online;
  -
  -        public String getRepository()
  -        {
  -            return this.repository;
  -        }
  -
  -        public void setRepository( String repository )
  -        {
  -            this.repository = repository;
  -        }
  -
  -        public String getOnline()
  -        {
  -            return this.online;
  -        }
  -
  -        public void setOnline( String online )
  -        {
  -            this.online = online;
  -        }
  -    }
   }
  
  
  

Mime
View raw message