You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2014/03/16 00:31:58 UTC
svn commit: r1577954 -
/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java
Author: dennisl
Date: Sat Mar 15 23:31:58 2014
New Revision: 1577954
URL: http://svn.apache.org/r1577954
Log:
[MCHANGES-329] RestJiraDownloader does not handle components, type, updated or version
Modified:
maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java
Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java?rev=1577954&r1=1577953&r2=1577954&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java Sat Mar 15 23:31:58 2014
@@ -300,9 +300,14 @@ public class RestJiraDownloader extends
val = fieldsNode.get( "comment" );
processComments( issue, val );
+ val = fieldsNode.get( "components" );
+ processComponents( issue, val );
+
val = fieldsNode.get( "fixVersions" );
processFixVersions( issue, val );
+ val = fieldsNode.get( "issuetype" );
+ processIssueType( issue, val );
val = fieldsNode.get( "priority" );
processPriority( issue, val );
@@ -322,19 +327,18 @@ public class RestJiraDownloader extends
issue.setSummary( val.asText() );
}
- val = issueNode.get( "title" );
+ val = fieldsNode.get( "title" );
if ( val != null )
{
issue.setTitle( val.asText() );
}
- val = issueNode.get( "updated" );
+ val = fieldsNode.get( "updated" );
processUpdated( issue, val );
- val = issueNode.get( "versions" );
+ val = fieldsNode.get( "versions" );
processVersions( issue, val );
-
issueList.add( issue );
}
}
@@ -359,7 +363,7 @@ public class RestJiraDownloader extends
private void processStatus( Issue issue, JsonNode val )
{
- if (val != null )
+ if ( val != null )
{
issue.setStatus( val.get( "name" ).asText() );
}
@@ -367,7 +371,7 @@ public class RestJiraDownloader extends
private void processPriority( Issue issue, JsonNode val )
{
- if (val != null )
+ if ( val != null )
{
issue.setPriority( val.get( "name" ).asText() );
}
@@ -375,7 +379,7 @@ public class RestJiraDownloader extends
private void processResolution( Issue issue, JsonNode val )
{
- if (val != null )
+ if ( val != null )
{
issue.setResolution( val.get( "name" ).asText() );
}
@@ -447,7 +451,7 @@ public class RestJiraDownloader extends
}
catch ( ParseException e )
{
- getLog().warn( "Invalid created date " + val.asText() );
+ getLog().warn( "Invalid updated date " + val.asText() );
}
}
}
@@ -460,7 +464,7 @@ public class RestJiraDownloader extends
private void processFixVersions( Issue issue, JsonNode val )
{
- if (val != null)
+ if ( val != null)
{
assert val.isArray();
for ( int vx = 0; vx < val.size(); vx++ )
@@ -484,6 +488,27 @@ public class RestJiraDownloader extends
}
}
+ private void processComponents( Issue issue, JsonNode val )
+ {
+ if ( val != null )
+ {
+ assert val.isArray();
+ for ( int cx = 0; cx < val.size(); cx++ )
+ {
+ JsonNode cnode = val.get( cx );
+ issue.addComponent( cnode.get( "name" ).asText() );
+ }
+ }
+ }
+
+ private void processIssueType( Issue issue, JsonNode val )
+ {
+ if ( val != null )
+ {
+ issue.setType( val.get( "name" ).asText() );
+ }
+ }
+
private void doSessionAuth( WebClient client )
throws IOException, MojoExecutionException, NoRest
{