Author: dennisl Date: Tue Mar 24 13:09:48 2009 New Revision: 757777 URL: http://svn.apache.org/viewvc?rev=757777&view=rev Log: [MCHANGES-156] An empty table is shown for a <release> which doesn't have any <action> in it
Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report.properties maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report_de.properties Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java?rev=757777&r1=757776&r2=757777&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java Tue Mar 24 13:09:48 2009 @@ -176,70 +176,81 @@ private void constructActions( Sink sink, List actionList, ResourceBundle bundle ) { - sink.table(); - - sink.tableRow(); - - sinkHeader( sink, bundle.getString( "report.changes.label.type" ) ); - - sinkHeader( sink, bundle.getString( "report.changes.label.changes" ) ); + if( actionList.isEmpty() ) + { + sink.paragraph(); - sinkHeader( sink, bundle.getString( "report.changes.label.by" ) ); + sink.text( bundle.getString("report.changes.text.no.changes") ); - if ( this.isAddActionDate() ) - { - sinkHeader( sink, bundle.getString( "report.changes.label.date" ) ); + sink.paragraph_(); } - sink.tableRow_(); - - for ( int idx = 0; idx < actionList.size(); idx++ ) + else { - Action action = (Action) actionList.get( idx ); + sink.table(); sink.tableRow(); - sinkShowTypeIcon( sink, action.getType() ); + sinkHeader( sink, bundle.getString( "report.changes.label.type" ) ); - sink.tableCell(); + sinkHeader( sink, bundle.getString( "report.changes.label.changes" ) ); - sink.rawText( action.getAction() ); + sinkHeader( sink, bundle.getString( "report.changes.label.by" ) ); + + if ( this.isAddActionDate() ) + { + sinkHeader( sink, bundle.getString( "report.changes.label.date" ) ); + } + sink.tableRow_(); - // no null check needed classes from modello return a new ArrayList - if ( StringUtils.isNotEmpty( action.getIssue() ) || ( !action.getFixedIssues().isEmpty() ) ) + for ( int idx = 0; idx < actionList.size(); idx++ ) { - sink.text( " " + bundle.getString( "report.changes.text.fixes" ) + " " ); + Action action = (Action) actionList.get( idx ); + + sink.tableRow(); - String system = action.getSystem(); - system = StringUtils.isEmpty( system ) ? DEFAULT_ISSUE_SYSTEM_KEY : system; - if ( !canGenerateIssueLinks( system ) ) + sinkShowTypeIcon( sink, action.getType() ); + + sink.tableCell(); + + sink.rawText( action.getAction() ); + + // no null check needed classes from modello return a new ArrayList + if ( StringUtils.isNotEmpty( action.getIssue() ) || ( !action.getFixedIssues().isEmpty() ) ) { - constructIssueText( action.getIssue(), sink, action.getFixedIssues() ); + sink.text( " " + bundle.getString( "report.changes.text.fixes" ) + " " ); + + String system = action.getSystem(); + system = StringUtils.isEmpty( system ) ? DEFAULT_ISSUE_SYSTEM_KEY : system; + if ( !canGenerateIssueLinks( system ) ) + { + constructIssueText( action.getIssue(), sink, action.getFixedIssues() ); + } + else + { + constructIssueLink( action.getIssue(), system, sink, action.getFixedIssues() ); + } + sink.text( "." ); } - else + + if ( StringUtils.isNotEmpty( action.getDueTo() ) || ( !action.getDueTos().isEmpty() ) ) { - constructIssueLink( action.getIssue(), system, sink, action.getFixedIssues() ); + constructDueTo( sink, action, bundle, action.getDueTos() ); } - sink.text( "." ); - } - if ( StringUtils.isNotEmpty( action.getDueTo() ) || ( !action.getDueTos().isEmpty() ) ) - { - constructDueTo( sink, action, bundle, action.getDueTos() ); - } + sink.tableCell_(); - sink.tableCell_(); + sinkCellLink( sink, action.getDev(), "team-list.html#" + action.getDev() ); - sinkCellLink( sink, action.getDev(), "team-list.html#" + action.getDev() ); + if ( this.isAddActionDate() ) + { + sinkCell( sink, action.getDate() ); + } - if ( this.isAddActionDate() ) - { - sinkCell( sink, action.getDate() ); + sink.tableRow_(); } - sink.tableRow_(); + sink.table_(); } - - sink.table_(); } private void constructReleaseHistory( Sink sink, ResourceBundle bundle ) Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report.properties?rev=757777&r1=757776&r2=757777&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report.properties (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report.properties Tue Mar 24 13:09:48 2009 @@ -26,6 +26,7 @@ report.changes.label.changes=Changes report.changes.label.description=Description report.changes.label.by=By +report.changes.text.no.changes=No changes in this release. report.changes.text.rssfeed=Get the RSS feed of the last changes report.changes.text.thanx=Thanks to report.changes.text.fixes=Fixes Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report_de.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report_de.properties?rev=757777&r1=757776&r2=757777&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report_de.properties (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/changes-report_de.properties Tue Mar 24 13:09:48 2009 @@ -26,6 +26,7 @@ report.changes.label.changes=Änderungen report.changes.label.description=Beschreibung report.changes.label.by=Durch +report.changes.text.no.changes=Keine Änderungen für dieses Release. report.changes.text.rssfeed=RSS-Feed der letzten Änderungen report.changes.text.thanx=Dank gilt report.changes.text.fixes=Schließt