brett       2004/10/30 04:30:28

  Modified:    xdocs    Tag: MAVEN-1_0-BRANCH changes.xml
               src/java/org/apache/maven/jelly/tags/werkz Tag:
                        MAVEN-1_0-BRANCH MavenAttainGoalTag.java
  Log:
  PR: MAVEN-1471
  prevent null pointer exception, display a warning instead.
  Cause of this situation is still unknown.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.14.4.45 +1 -0      maven/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven/xdocs/changes.xml,v
  retrieving revision 1.14.4.44
  retrieving revision 1.14.4.45
  diff -u -r1.14.4.44 -r1.14.4.45
  --- changes.xml       30 Oct 2004 11:14:13 -0000      1.14.4.44
  +++ changes.xml       30 Oct 2004 11:30:28 -0000      1.14.4.45
  @@ -25,6 +25,7 @@
     </properties>
     <body>
       <release version="1.0.1-SNAPSHOT" date="in CVS MAVEN-1_0-BRANCH">
  +      <action dev="brett" type="fix" issue="MAVEN-1471">Prevent 
NullPointerException in a case that has been encountered, and display a warning 
instead.</action>
         <action dev="brett" type="fix" issue="MAVEN-1469">Give an error message if 
the parent pom is not valid</action>
         <action dev="brett" type="fix" issue="MAVEN-1439" due-to="Shinobu 
Kawai">Allow the property <code>maven.mode.online</code> to work, but be overridden by 
the <code>-o</code> command line option</action>
         <action dev="brett" type="update">No longer default the 
maven.repo.central[.directory] properties to upload to ibiblio as access is 
restricted</action>
  
  
  
  No                   revision
  No                   revision
  1.2.2.9   +11 -4     
maven/src/java/org/apache/maven/jelly/tags/werkz/MavenAttainGoalTag.java
  
  Index: MavenAttainGoalTag.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/java/org/apache/maven/jelly/tags/werkz/MavenAttainGoalTag.java,v
  retrieving revision 1.2.2.8
  retrieving revision 1.2.2.9
  diff -u -r1.2.2.8 -r1.2.2.9
  --- MavenAttainGoalTag.java   26 Jun 2004 14:52:05 -0000      1.2.2.8
  +++ MavenAttainGoalTag.java   30 Oct 2004 11:30:28 -0000      1.2.2.9
  @@ -81,10 +81,17 @@
                         not great to tie variables to session if we are creating a 
new one */
               Session session = ( Session ) getContext().getVariable( 
PluginManager.GLOBAL_SESSION_KEY );
               this.session = new JellySession( ( ( MavenJellyContext ) getContext() 
).getXMLOutput() );
  -            for ( Iterator i = session.getAttributes().keySet().iterator(); 
i.hasNext();)
  +            if ( session != null )
               {
  -                String key = ( String ) i.next();
  -                this.session.setAttribute( key, session.getAttribute( key ) );
  +                for ( Iterator i = session.getAttributes().keySet().iterator(); 
i.hasNext();)
  +                {
  +                    String key = ( String ) i.next();
  +                    this.session.setAttribute( key, session.getAttribute( key ) );
  +                }
  +            }
  +            else
  +            {
  +                this.session.warn( "WARNING: session was created, but current 
context did not contain the global session" );
               }
           }
   
  
  
  

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

Reply via email to