Java 5 update of the code
Checkstyle cleanup
Reformatting
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1685894 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index ba49cef..49b25c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -445,6 +445,7 @@
</execution>
</executions>
<configuration>
+ <useJava5>true</useJava5>
<version>1.0.0</version>
<models>
<model>src/main/mdo/changes.mdo</model>
diff --git a/src/main/java/org/apache/maven/plugin/announcement/AbstractAnnouncementMojo.java b/src/main/java/org/apache/maven/plugin/announcement/AbstractAnnouncementMojo.java
index 8074975..392950e 100644
--- a/src/main/java/org/apache/maven/plugin/announcement/AbstractAnnouncementMojo.java
+++ b/src/main/java/org/apache/maven/plugin/announcement/AbstractAnnouncementMojo.java
@@ -32,9 +32,8 @@
extends AbstractChangesMojo
{
/**
- * This will cause the execution to be run only at the top of a given module
- * tree. That is, run in the project contained in the same folder where the
- * mvn execution was launched.
+ * This will cause the execution to be run only at the top of a given module tree. That is, run in the project
+ * contained in the same folder where the mvn execution was launched.
*
* @since 2.3
*/
diff --git a/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java b/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
index 926c805..583b54f 100644
--- a/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
+++ b/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
@@ -57,9 +57,9 @@
public class AnnouncementMailMojo
extends AbstractAnnouncementMojo
{
- //=========================================
+ // =========================================
// announcement-mail goal fields
- //=========================================
+ // =========================================
/**
* Possible senders.
@@ -68,10 +68,9 @@
private List from;
/**
- * The id of the developer sending the announcement mail. Only used if the <tt>mailSender</tt>
- * attribute is not set. In this case, this should match the id of one of the developers in
- * the pom. If a matching developer is not found, then the first developer in the pom will be
- * used.
+ * The id of the developer sending the announcement mail. Only used if the <tt>mailSender</tt> attribute is not set.
+ * In this case, this should match the id of one of the developers in the pom. If a matching developer is not found,
+ * then the first developer in the pom will be used.
*/
@Parameter( property = "changes.fromDeveloperId" )
private String fromDeveloperId;
@@ -85,21 +84,36 @@
private String mailContentType;
/**
- * Defines the sender of the announcement email. This takes precedence over the list
- * of developers specified in the POM.
- * if the sender is not a member of the development team. Note that since this is a bean type,
- * you cannot specify it from command level with <pre>-D</pre>. Use
- * <pre>-Dchanges.sender='Your Name <you@domain>'</pre> instead.
+ * Defines the sender of the announcement email. This takes precedence over the list of developers specified in the
+ * POM. if the sender is not a member of the development team. Note that since this is a bean type, you cannot
+ * specify it from command level with
+ *
+ * <pre>
+ * -D
+ * </pre>
+ *
+ * . Use
+ *
+ * <pre>
+ * -Dchanges.sender='Your Name <you@domain>'
+ * </pre>
+ *
+ * instead.
*/
@Parameter( property = "changes.mailSender" )
private MailSender mailSender;
/**
- * Defines the sender of the announcement. This takes precedence over both ${changes.mailSender}
- * and the list of developers in the POM.
+ * Defines the sender of the announcement. This takes precedence over both ${changes.mailSender} and the list of
+ * developers in the POM.
* <p/>
* This parameter parses an email address in standard RFC822 format, e.g.
- * <pre>-Dchanges.sender='Your Name <you@domain>'</pre>.
+ *
+ * <pre>
+ * -Dchanges.sender='Your Name <you@domain>'
+ * </pre>
+ *
+ * .
*
* @since 2.7
*/
@@ -146,9 +160,10 @@
/**
* Subject for the email.
*/
- @Parameter( property = "changes.subject",
- defaultValue = "[ANNOUNCEMENT] - ${project.name} ${project.version} released", required = true )
+ // CHECKSTYLE_OFF: LineLength
+ @Parameter( property = "changes.subject", defaultValue = "[ANNOUNCEMENT] - ${project.name} ${project.version} released", required = true )
private String subject;
+ // CHECKSTYLE_ON: LineLength
/**
* The file that contains the generated announcement.
@@ -177,8 +192,8 @@
/**
* Directory which contains the template for announcement email.
*
- * @deprecated Starting with version 2.10 this parameter is no longer used.
- * You must use {@link #announcementDirectory} instead.
+ * @deprecated Starting with version 2.10 this parameter is no longer used. You must use
+ * {@link #announcementDirectory} instead.
*/
@Parameter
private File templateOutputDirectory;
@@ -359,7 +374,7 @@
{
templateEncoding = ReaderFactory.FILE_ENCODING;
getLog().warn( "File encoding has not been set, using platform encoding '" + templateEncoding
- + "', i.e. build is platform dependent!" );
+ + "', i.e. build is platform dependent!" );
}
reader = new InputStreamReader( inputStream, templateEncoding );
@@ -417,9 +432,8 @@
}
else if ( from == null || from.isEmpty() )
{
- throw new MojoExecutionException(
- "The <developers> section in your pom should not be empty. Add a <developer> entry or set the "
- + "mailSender parameter." );
+ throw new MojoExecutionException( "The <developers> section in your pom should not be empty. "
+ + "Add a <developer> entry or set the mailSender parameter." );
}
else if ( fromDeveloperId == null )
{
@@ -437,14 +451,14 @@
return new MailSender( developer.getName(), developer.getEmail() );
}
}
- throw new MojoExecutionException(
- "Missing developer with id '" + fromDeveloperId + "' in the <developers> section in your pom." );
+ throw new MojoExecutionException( "Missing developer with id '" + fromDeveloperId
+ + "' in the <developers> section in your pom." );
}
}
- //================================
+ // ================================
// announcement-mail accessors
- //================================
+ // ================================
public List getBccAddresses()
{
diff --git a/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java b/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
index 976c23a..9073634 100644
--- a/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
+++ b/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
@@ -80,8 +80,8 @@
private static final String GIT_HUB = "GitHub";
/**
- * The name of the file which will contain the generated announcement. If
- * no value is specified the plugin will use the name of the template.
+ * The name of the file which will contain the generated announcement. If no value is specified the plugin will use
+ * the name of the template.
*
* @since 2.4
*/
@@ -89,8 +89,7 @@
private String announcementFile;
/**
- * Map of custom parameters for the announcement.
- * This Map will be passed to the template.
+ * Map of custom parameters for the announcement. This Map will be passed to the template.
*
* @since 2.1
*/
@@ -103,8 +102,7 @@
private String artifactId;
/**
- * Name of the team that develops the artifact.
- * This parameter will be passed to the template.
+ * Name of the team that develops the artifact. This parameter will be passed to the template.
*/
@Parameter( property = "changes.developmentTeam", defaultValue = "${project.name} team", required = true )
private String developmentTeam;
@@ -121,23 +119,20 @@
private String groupId;
/**
- * Short description or introduction of the released artifact.
- * This parameter will be passed to the template.
+ * Short description or introduction of the released artifact. This parameter will be passed to the template.
*/
@Parameter( defaultValue = "${project.description}" )
private String introduction;
/**
- * A list of issue management systems to fetch releases from. This parameter
- * replaces the parameters <code>generateJiraAnnouncement</code> and
- * <code>jiraMerge</code>.
+ * A list of issue management systems to fetch releases from. This parameter replaces the parameters
+ * <code>generateJiraAnnouncement</code> and <code>jiraMerge</code>.
* <p>
* Valid values are: <code>changes.xml</code> and <code>JIRA</code>.
* </p>
- * <strong>Note:</strong> Only one issue management system that is
- * configured in <project>/<issueManagement> can be used. This
- * currently means that you can combine a changes.xml file with one other
- * issue management system.
+ * <strong>Note:</strong> Only one issue management system that is configured in
+ * <project>/<issueManagement> can be used. This currently means that you can combine a changes.xml file
+ * with one other issue management system.
*
* @since 2.4
*/
@@ -145,9 +140,8 @@
private List<String> issueManagementSystems;
/**
- * Maps issues types to action types for grouping issues in announcements.
- * If issue types are not defined for a action type then the default issue type
- * will be applied.
+ * Maps issues types to action types for grouping issues in announcements. If issue types are not defined for a
+ * action type then the default issue type will be applied.
* <p>
* Valid action types: <code>add</code>, <code>fix</code> and <code>update</code>.
* </p>
@@ -168,8 +162,8 @@
/**
* Directory where the announcement file will be generated.
*
- * @deprecated Starting with version 2.10 this parameter is no longer used.
- * You must use {@link #announcementDirectory} instead.
+ * @deprecated Starting with version 2.10 this parameter is no longer used. You must use
+ * {@link #announcementDirectory} instead.
*/
@Parameter
private File outputDirectory;
@@ -199,9 +193,10 @@
* <code>/src/main/resources/ or current project base directory</code>.
* </p>
*/
- @Parameter( property = "changes.templateDirectory", defaultValue = "org/apache/maven/plugin/announcement",
- required = true )
+ // CHECKSTYLE_OFF: LineLength
+ @Parameter( property = "changes.templateDirectory", defaultValue = "org/apache/maven/plugin/announcement", required = true )
private String templateDirectory;
+ // CHECKSTYLE_ON: LineLength
/**
* The template encoding.
@@ -212,9 +207,9 @@
private String templateEncoding;
/**
- * Use the JIRA query language instead of the JIRA query based on HTTP parameters.
- * From JIRA 5.1 and up only JQL is supported. JIRA 4.4 supports both JQL and URL parameter based queries.
- * From 5.1.1 this is obsolete, since REST queries only use JQL.
+ * Use the JIRA query language instead of the JIRA query based on HTTP parameters. From JIRA 5.1 and up only JQL is
+ * supported. JIRA 4.4 supports both JQL and URL parameter based queries. From 5.1.1 this is obsolete, since REST
+ * queries only use JQL.
*
* @since 2.10
*/
@@ -222,16 +217,14 @@
private boolean useJql;
/**
- * Distribution URL of the artifact.
- * This parameter will be passed to the template.
+ * Distribution URL of the artifact. This parameter will be passed to the template.
*/
@Parameter( property = "project.url" )
private String url;
/**
- * URL where the artifact can be downloaded. If not specified,
- * no URL is used.
- * This parameter will be passed to the template.
+ * URL where the artifact can be downloaded. If not specified, no URL is used. This parameter will be passed to the
+ * template.
*/
@Parameter
private String urlDownload;
@@ -257,14 +250,13 @@
@Parameter( defaultValue = "${basedir}/src/changes/changes.xml" )
private File xmlPath;
- //=======================================//
- // JIRA-Announcement Needed Parameters //
- //=======================================//
+ // =======================================//
+ // JIRA-Announcement Needed Parameters //
+ // =======================================//
/**
- * Defines the filter parameters to restrict which issues are retrieved
- * from JIRA. The filter parameter uses the same format of url
- * parameters that is used in a JIRA search.
+ * Defines the filter parameters to restrict which issues are retrieved from JIRA. The filter parameter uses the
+ * same format of url parameters that is used in a JIRA search.
*
* @since 2.4
*/
@@ -274,19 +266,18 @@
/**
* Flag to determine if the plugin will generate a JIRA announcement.
*
- * @deprecated Since version 2.4 this parameter has been deprecated.
- * Please use the issueManagementSystems parameter instead.
+ * @deprecated Since version 2.4 this parameter has been deprecated. Please use the issueManagementSystems parameter
+ * instead.
*/
@Parameter( property = "generateJiraAnnouncement", defaultValue = "false", required = true )
private boolean generateJiraAnnouncement;
/**
- * If releases from JIRA should be merged with the releases from a
- * changes.xml file.
+ * If releases from JIRA should be merged with the releases from a changes.xml file.
*
* @since 2.1
- * @deprecated Since version 2.4 this parameter has been deprecated.
- * Please use the issueManagementSystems parameter instead.
+ * @deprecated Since version 2.4 this parameter has been deprecated. Please use the issueManagementSystems parameter
+ * instead.
*/
@Parameter( property = "changes.jiraMerge", defaultValue = "false" )
private boolean jiraMerge;
@@ -316,19 +307,17 @@
/**
* The maximum number of issues to fetch from JIRA.
* <p>
- * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was
- * called "nbEntries".
+ * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was called "nbEntries".
* </p>
*/
@Parameter( property = "changes.maxEntries", defaultValue = "25", required = true )
private int maxEntries;
/**
- * Include issues from JIRA with these resolution ids. Multiple resolution
- * ids can be specified as a comma separated list of ids.
+ * Include issues from JIRA with these resolution ids. Multiple resolution ids can be specified as a comma separated
+ * list of ids.
* <p>
- * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was
- * called "resolutionId".
+ * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was called "resolutionId".
* </p>
*/
@Parameter( property = "changes.resolutionIds", defaultValue = "Fixed" )
@@ -341,11 +330,10 @@
private Settings settings;
/**
- * Include issues from JIRA with these status ids. Multiple status ids can
- * be specified as a comma separated list of ids.
+ * Include issues from JIRA with these status ids. Multiple status ids can be specified as a comma separated list of
+ * ids.
* <p>
- * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was
- * called "statusId".
+ * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter was called "statusId".
* </p>
*/
@Parameter( property = "changes.statusIds", defaultValue = "Closed" )
@@ -370,11 +358,9 @@
/**
* The prefix used when naming versions in JIRA.
* <p>
- * If you have a project in JIRA with several components that have different
- * release cycles, it is an often used pattern to prefix the version with
- * the name of the component, e.g. maven-filtering-1.0 etc. To fetch issues
- * from JIRA for a release of the "maven-filtering" component you would need
- * to set this parameter to "maven-filtering-".
+ * If you have a project in JIRA with several components that have different release cycles, it is an often used
+ * pattern to prefix the version with the name of the component, e.g. maven-filtering-1.0 etc. To fetch issues from
+ * JIRA for a release of the "maven-filtering" component you would need to set this parameter to "maven-filtering-".
* </p>
*
* @since 2.5
@@ -404,13 +390,12 @@
@Parameter( property = "changes.jiraReceiveTimout", defaultValue = "32000" )
private int jiraReceiveTimout;
- //=======================================//
- // Trac Parameters //
- //=======================================//
+ // =======================================//
+ // Trac Parameters //
+ // =======================================//
/**
- * Defines the Trac password for authentication into a private Trac
- * installation.
+ * Defines the Trac password for authentication into a private Trac installation.
*
* @since 2.4
*/
@@ -426,17 +411,16 @@
private String tracQuery;
/**
- * Defines the Trac username for authentication into a private Trac
- * installation.
+ * Defines the Trac username for authentication into a private Trac installation.
*
* @since 2.4
*/
@Parameter( property = "changes.tracUser", defaultValue = "" )
private String tracUser;
- //=======================================//
- // Github Parameters //
- //=======================================//
+ // =======================================//
+ // Github Parameters //
+ // =======================================//
/**
* The scheme of your github api domain. Only use if using github enterprise.
@@ -462,14 +446,14 @@
*/
@Parameter( defaultValue = "github" )
private String githubAPIServerId;
-
+
private ReleaseUtils releaseUtils = new ReleaseUtils( getLog() );
private ChangesXML xml;
- //=======================================//
- // announcement-generate execution //
- //=======================================//
+ // =======================================//
+ // announcement-generate execution //
+ // =======================================//
/**
* Generate the template
@@ -515,7 +499,7 @@
issueManagementSystems.add( CHANGES_XML );
}
}
-
+
// Fetch releases from the configured issue management systems
List<Release> releases = null;
if ( issueManagementSystems.contains( CHANGES_XML ) )
@@ -543,8 +527,8 @@
}
else
{
- throw new MojoExecutionException(
- "Something is wrong with the Issue Management section. See previous error messages." );
+ throw new MojoExecutionException( "Something is wrong with the Issue Management section. "
+ + "See previous error messages." );
}
}
@@ -558,8 +542,8 @@
}
else
{
- throw new MojoExecutionException(
- "Something is wrong with the Issue Management section. See previous error messages." );
+ throw new MojoExecutionException( "Something is wrong with the Issue Management section. "
+ + "See previous error messages." );
}
}
@@ -591,8 +575,8 @@
// Generate the report
if ( releases == null || releases.isEmpty() )
{
- throw new MojoExecutionException(
- "No releases found in any of the configured issue management systems." );
+ throw new MojoExecutionException( "No releases found in any of the "
+ + "configured issue management systems." );
}
else
{
@@ -613,7 +597,7 @@
String version = ( versionPrefix == null ? "" : versionPrefix ) + getVersion();
getLog().debug( "Generating announcement for version [" + version + "]. Found these releases: "
- + ReleaseUtils.toString( releases ) );
+ + ReleaseUtils.toString( releases ) );
doGenerate( releases, releaseUtils.getLatestRelease( releases, version ) );
}
@@ -665,7 +649,6 @@
context.put( "announceParameters", announceParameters );
}
-
processTemplate( context, announcementDirectory, template, announcementFile );
}
catch ( ResourceNotFoundException rnfe )
@@ -713,10 +696,9 @@
if ( StringUtils.isEmpty( templateEncoding ) )
{
- templateEncoding = ReaderFactory.FILE_ENCODING;
- getLog().warn(
- "File encoding has not been set, using platform encoding " + templateEncoding
- + ", i.e. build is platform dependent!" );
+ templateEncoding = ReaderFactory.FILE_ENCODING;
+ getLog().warn( "File encoding has not been set, using platform encoding " + templateEncoding
+ + ", i.e. build is platform dependent!" );
}
Writer writer = new OutputStreamWriter( new FileOutputStream( f ), templateEncoding );
@@ -813,7 +795,7 @@
private List<Release> getReleases( List<Issue> issues, IssueManagementSystem ims )
throws MojoExecutionException
{
- if ( issueTypes != null )
+ if ( issueTypes != null )
{
ims.applyConfiguration( issueTypes );
}
@@ -858,9 +840,9 @@
{
GitHubDownloader issueDownloader =
new GitHubDownloader( project, githubAPIScheme, githubAPIPort, false, true );
-
+
issueDownloader.configureAuthentication( githubAPIServerId, settings, getLog() );
-
+
return getReleases( issueDownloader.getIssueList(), new GitHubIssueManagementSystem() );
}
catch ( Exception e )
@@ -922,7 +904,7 @@
{
this.introduction = introduction;
}
-
+
public void setIssueTypes( Map<String, String> issueTypes )
{
this.issueTypes = issueTypes;
diff --git a/src/main/java/org/apache/maven/plugin/announcement/MailSender.java b/src/main/java/org/apache/maven/plugin/announcement/MailSender.java
index 7aa494f..e3f361c 100644
--- a/src/main/java/org/apache/maven/plugin/announcement/MailSender.java
+++ b/src/main/java/org/apache/maven/plugin/announcement/MailSender.java
@@ -20,8 +20,8 @@
*/
/**
- * Defines the sender of the announcement if the list of developer is empty or
- * if the sender is not a member of the development team.
+ * Defines the sender of the announcement if the list of developer is empty or if the sender is not a member of the
+ * development team.
*
* @author Stephane Nicoll
*/
@@ -32,13 +32,11 @@
private String email;
-
public MailSender()
{
super();
}
-
public MailSender( String name, String email )
{
this.name = name;
diff --git a/src/main/java/org/apache/maven/plugin/changes/AbstractChangesMojo.java b/src/main/java/org/apache/maven/plugin/changes/AbstractChangesMojo.java
index cdd9198..c1e4f08 100644
--- a/src/main/java/org/apache/maven/plugin/changes/AbstractChangesMojo.java
+++ b/src/main/java/org/apache/maven/plugin/changes/AbstractChangesMojo.java
@@ -49,9 +49,8 @@
protected MavenSession mavenSession;
/**
- * This will cause the execution to be run only at the top of a given module
- * tree. That is, run in the project contained in the same folder where the
- * mvn execution was launched.
+ * This will cause the execution to be run only at the top of a given module tree. That is, run in the project
+ * contained in the same folder where the mvn execution was launched.
*
* @since 2.9
*/
@@ -59,8 +58,8 @@
protected boolean runOnlyAtExecutionRoot;
/**
- * Returns <code>true</code> if the current project is located at the
- * Execution Root Directory (where mvn was launched).
+ * Returns <code>true</code> if the current project is located at the Execution Root Directory (where mvn was
+ * launched).
*
* @return <code>true</code> if the current project is at the Execution Root
*/
diff --git a/src/main/java/org/apache/maven/plugin/changes/AbstractChangesReport.java b/src/main/java/org/apache/maven/plugin/changes/AbstractChangesReport.java
index dd6e8de..ffc54b2 100644
--- a/src/main/java/org/apache/maven/plugin/changes/AbstractChangesReport.java
+++ b/src/main/java/org/apache/maven/plugin/changes/AbstractChangesReport.java
@@ -56,13 +56,10 @@
import java.util.Map;
/**
- * Base class with the things that should be in AbstractMavenReport anyway.
- *
- * Note: This file was copied from r415312 of AbstractProjectInfoReport in
- * maven-project-info-reports, as a work-around to MCHANGES-88.
+ * Base class with the things that should be in AbstractMavenReport anyway. Note: This file was copied from r415312 of
+ * AbstractProjectInfoReport in maven-project-info-reports, as a work-around to MCHANGES-88.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
- *
*/
public abstract class AbstractChangesReport
extends AbstractMavenReport
@@ -85,8 +82,8 @@
/**
* Report output encoding. Note that this parameter is only relevant if the goal is run from the command line or
- * from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output
- * encoding configured in the Maven Site Plugin is used instead.
+ * from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output encoding
+ * configured in the Maven Site Plugin is used instead.
*
* @since 2.4
*/
@@ -94,9 +91,8 @@
private String outputEncoding;
/**
- * This will cause the execution to be run only at the top of a given module
- * tree. That is, run in the project contained in the same folder where the
- * mvn execution was launched.
+ * This will cause the execution to be run only at the top of a given module tree. That is, run in the project
+ * contained in the same folder where the mvn execution was launched.
*
* @since 2.10
*/
@@ -209,7 +205,7 @@
outputDirectory.mkdirs();
File file = new File( outputDirectory, getOutputName() + ".html" );
- fileOutputStream = new FileOutputStream( file ) ;
+ fileOutputStream = new FileOutputStream( file );
Writer writer = new OutputStreamWriter( fileOutputStream, getOutputEncoding() );
siteRenderer.generateDocument( writer, sink, siteContext );
@@ -219,18 +215,18 @@
}
catch ( RendererException e )
{
- throw new MojoExecutionException(
- "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
+ throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
+ + " report generation.", e );
}
catch ( IOException e )
{
- throw new MojoExecutionException(
- "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
+ throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
+ + " report generation.", e );
}
catch ( MavenReportException e )
{
- throw new MojoExecutionException(
- "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation.", e );
+ throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
+ + " report generation.", e );
}
finally
{
@@ -274,8 +270,8 @@
}
/**
- * Returns <code>true</code> if the current project is located at the
- * Execution Root Directory (where mvn was launched).
+ * Returns <code>true</code> if the current project is located at the Execution Root Directory (where mvn was
+ * launched).
*
* @return <code>true</code> if the current project is at the Execution Root
*/
diff --git a/src/main/java/org/apache/maven/plugin/changes/ChangesCheckMojo.java b/src/main/java/org/apache/maven/plugin/changes/ChangesCheckMojo.java
index 7cc0214..3477c7a 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ChangesCheckMojo.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ChangesCheckMojo.java
@@ -31,8 +31,8 @@
import org.apache.maven.plugins.changes.model.Release;
/**
- * Goal which checks that the changes.xml file has the necessary data to
- * generate an announcement or a report for the current release.
+ * Goal which checks that the changes.xml file has the necessary data to generate an announcement or a report for the
+ * current release.
*
* @author Justin Edelson
* @author Dennis Lundberg
@@ -43,15 +43,13 @@
extends AbstractChangesMojo
{
/**
- * The format that a correct release date should have. This value will be
- * used as a pattern to try to parse a date.
+ * The format that a correct release date should have. This value will be used as a pattern to try to parse a date.
*/
@Parameter( property = "changes.releaseDateFormat", defaultValue = "yyyy-MM-dd" )
private String releaseDateFormat;
/**
- * The locale that a correct release date should have. This value will be
- * used as a locale to try to parse a date.
+ * The locale that a correct release date should have. This value will be used as a locale to try to parse a date.
*
* @since 2.10
*/
@@ -78,8 +76,6 @@
@Parameter( property = "changes.skipSnapshots", defaultValue = "false" )
private boolean skipSnapshots;
- private ReleaseUtils releaseUtils = new ReleaseUtils( getLog() );
-
/**
* Check that the latest release contains a valid release date.
*
@@ -108,8 +104,8 @@
if ( !isValidDate( release.getDateRelease(), releaseDateFormat, releaseDateLocale ) )
{
- throw new MojoExecutionException(
- "The file " + xmlPath.getAbsolutePath() + " has an invalid release date." );
+ throw new MojoExecutionException( "The file " + xmlPath.getAbsolutePath()
+ + " has an invalid release date." );
}
}
@@ -121,8 +117,8 @@
}
/**
- * Use the pattern to try to parse a Date from the given string. Kept for
- * backward compatibility with existing unit tests.
+ * Use the pattern to try to parse a Date from the given string. Kept for backward compatibility with existing unit
+ * tests.
*
* @param string A date as text
* @param pattern A pattern that can be used by {@link SimpleDateFormat}
@@ -134,8 +130,7 @@
}
/**
- * Use the pattern to try to parse a Date from the given string using the
- * given Locale.
+ * Use the pattern to try to parse a Date from the given string using the given Locale.
*
* @param string A date as text
* @param pattern A pattern that can be used by {@link SimpleDateFormat}
@@ -168,7 +163,7 @@
{
// Try to find the specified locale on this system
Locale[] locales = Locale.getAvailableLocales();
- for ( int i = 0 ; i < locales.length ; i++ )
+ for ( int i = 0; i < locales.length; i++ )
{
if ( locales[i].toString().equals( locale ) )
{
diff --git a/src/main/java/org/apache/maven/plugin/changes/ChangesMojo.java b/src/main/java/org/apache/maven/plugin/changes/ChangesMojo.java
index 3f256ca..c9638c5 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ChangesMojo.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ChangesMojo.java
@@ -23,34 +23,32 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
-
import java.net.URL;
-
import java.text.SimpleDateFormat;
-
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
import java.util.ResourceBundle;
import org.apache.commons.collections.map.CaseInsensitiveMap;
+import org.apache.commons.io.input.XmlStreamReader;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.changes.model.Release;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.MavenReportException;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenFileFilterRequest;
import org.apache.maven.shared.filtering.MavenFilteringException;
-
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
-import org.apache.commons.io.input.XmlStreamReader;
/**
* Goal which creates a nicely formatted Changes Report in html format from a changes.xml file.
@@ -63,8 +61,8 @@
extends AbstractChangesReport
{
/**
- * A flag whether the report should also include changes from child modules. If set to <code>false</code>, only
- * the changes from current project will be written to the report.
+ * A flag whether the report should also include changes from child modules. If set to <code>false</code>, only the
+ * changes from current project will be written to the report.
*
* @since 2.5
*/
@@ -81,17 +79,14 @@
private boolean addActionDate;
/**
- * Whether HTML code within an action should be escaped. By changing this to
- * <code>false</code> you can restore the behavior that was in version 2.2
- * of this plugin, allowing you to use HTML code to format the content of an
+ * Whether HTML code within an action should be escaped. By changing this to <code>false</code> you can restore the
+ * behavior that was in version 2.2 of this plugin, allowing you to use HTML code to format the content of an
* action.
* <p>
- * <strong>Note:</strong> If you use HTML code in an action you need to
- * place it inside a CDATA section.
+ * <strong>Note:</strong> If you use HTML code in an action you need to place it inside a CDATA section.
* </p>
- * <strong>Note:</strong> Putting any kind of markup inside a CDATA section
- * might mess up the Changes Report or other generated documents, such as
- * PDFs, that are based on your <code>changes.xml</code> file if you are not
+ * <strong>Note:</strong> Putting any kind of markup inside a CDATA section might mess up the Changes Report or
+ * other generated documents, such as PDFs, that are based on your <code>changes.xml</code> file if you are not
* careful.
*
* @since 2.4
@@ -117,10 +112,10 @@
private boolean filteringChanges;
/**
- * Template string that is used to discover the URL to use to display an issue report.
- * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the
- * <code><issueManagement>/<url></code> value from the POM, and removing the last '/'
- * and everything that comes after it. <code>%ISSUE%</code>: this is the issue number.
+ * Template string that is used to discover the URL to use to display an issue report. There are 2 template tokens
+ * you can use. <code>%URL%</code>: this is computed by getting the <code><issueManagement>/<url></code>
+ * value from the POM, and removing the last '/' and everything that comes after it. <code>%ISSUE%</code>: this is
+ * the issue number.
* <p>
* <strong>Note:</strong> In versions of this plugin prior to 2.0-beta-2 this parameter was called
* <code>link_template</code>.
@@ -137,24 +132,22 @@
* map denotes the (case-insensitive) identifier of the issue tracking system and its value gives the URL template.
* <p>
* There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the
- * <code><issueManagement>/<url></code> value from the POM, and removing the last '/'
- * and everything that comes after it. <code>%ISSUE%</code>: this is the issue number.
+ * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' and everything
+ * that comes after it. <code>%ISSUE%</code>: this is the issue number.
* </p>
* <p>
* <strong>Note:</strong> The deprecated issueLinkTemplate will be used for a system called "default".
* </p>
* <p>
- * <strong>Note:</strong> Starting with version 2.4 you usually don't need
- * to specify this, unless you need to link to an issue management system in
- * your Changes report that isn't supported out of the box. See the
- * <a href="./usage.html">Usage page</a> for more
- * information.
+ * <strong>Note:</strong> Starting with version 2.4 you usually don't need to specify this, unless you need to link
+ * to an issue management system in your Changes report that isn't supported out of the box. See the
+ * <a href="./usage.html">Usage page</a> for more information.
* </p>
*
* @since 2.1
*/
@Parameter
- private Map issueLinkTemplatePerSystem;
+ private Map<String, String> issueLinkTemplatePerSystem;
/**
* @since 2.2
@@ -193,8 +186,8 @@
private String system;
/**
- * The URI of a file containing all the team members. If this is set to the
- * special value "none", no links will be generated for the team members.
+ * The URI of a file containing all the team members. If this is set to the special value "none", no links will be
+ * generated for the team members.
*
* @since 2.4
*/
@@ -208,14 +201,13 @@
/**
* The type of the feed to generate.
- *
* <p>
- * Supported values are:
- * <code>"rss_0.9", "rss_0.91N" (RSS 0.91 Netscape), "rss_0.91U" (RSS 0.91 Userland),
+ * Supported values are: <code>"rss_0.9", "rss_0.91N" (RSS 0.91 Netscape), "rss_0.91U" (RSS 0.91 Userland),
* "rss_0.92", "rss_0.93", "rss_0.94", "rss_1.0", "rss_2.0", "atom_0.3", "atom_1.0"</code>.
* </p>
- *
- * <p>If not specified, no feed is generated.</p>
+ * <p>
+ * If not specified, no feed is generated.
+ * </p>
*
* @since 2.9
*/
@@ -233,7 +225,7 @@
private CaseInsensitiveMap caseInsensitiveIssueLinkTemplatePerSystem;
/* --------------------------------------------------------------------- */
- /* Public methods */
+ /* Public methods */
/* --------------------------------------------------------------------- */
public boolean canGenerateReport()
@@ -251,8 +243,7 @@
throws MavenReportException
{
Date now = new Date();
- SimpleDateFormat simpleDateFormat =
- new SimpleDateFormat( publishDateFormat, new Locale( publishDateLocale ) );
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat( publishDateFormat, new Locale( publishDateLocale ) );
Properties additionalProperties = new Properties();
additionalProperties.put( "publishDate", simpleDateFormat.format( now ) );
@@ -273,7 +264,7 @@
}
final String relativePath = absolutePath.substring( basePath.length() );
- List releaseList = changesXml.getReleaseList();
+ List<Release> releaseList = changesXml.getReleaseList();
for ( Object o : project.getCollectedProjects() )
{
final MavenProject childProject = (MavenProject) o;
@@ -281,8 +272,8 @@
final ChangesXML childXml = getChangesFromFile( changesFile, childProject, additionalProperties );
if ( childXml != null )
{
- releaseList = releaseUtils.mergeReleases( releaseList, childProject.getName(),
- childXml.getReleaseList() );
+ releaseList =
+ releaseUtils.mergeReleases( releaseList, childProject.getName(), childXml.getReleaseList() );
}
}
changesXml.setReleaseList( releaseList );
@@ -293,7 +284,7 @@
report.setAuthor( changesXml.getAuthor() );
report.setTitle( changesXml.getTitle() );
- report.setEscapeHTML ( escapeHTML );
+ report.setEscapeHTML( escapeHTML );
// Create a case insensitive version of issueLinkTemplatePerSystem
// We need something case insensitive to maintain backward compatibility
@@ -333,7 +324,7 @@
report.setSystem( system );
- report.setTeamlist ( teamlist );
+ report.setTeamlist( teamlist );
report.setUrl( url );
@@ -375,12 +366,12 @@
}
/* --------------------------------------------------------------------- */
- /* Private methods */
+ /* Private methods */
/* --------------------------------------------------------------------- */
/**
- * Parses specified changes.xml file. It also makes filtering if needed. If specified file doesn't exist
- * it will log warning and return <code>null</code>.
+ * Parses specified changes.xml file. It also makes filtering if needed. If specified file doesn't exist it will log
+ * warning and return <code>null</code>.
*
* @param changesXml changes xml file to parse
* @param project maven project to parse changes for
@@ -413,8 +404,8 @@
project.getGroupId() + "." + project.getArtifactId() + "-changes.xml" );
final MavenFileFilterRequest mavenFileFilterRequest =
- new MavenFileFilterRequest( changesXml, resultFile, true, project, Collections.EMPTY_LIST,
- false, encoding, session, additionalProperties );
+ new MavenFileFilterRequest( changesXml, resultFile, true, project, Collections.<String>emptyList(),
+ false, encoding, session, additionalProperties );
mavenFileFilter.copyFile( mavenFileFilterRequest );
changesXml = resultFile;
}
@@ -439,8 +430,8 @@
}
/**
- * Add the issue link template for the given issue management system,
- * but only if it has not already been configured.
+ * Add the issue link template for the given issue management system, but only if it has not already been
+ * configured.
*
* @param system The issue management system
* @param issueLinkTemplate The issue link template to use
@@ -462,13 +453,8 @@
throws MavenReportException
{
final String pluginResourcesBase = "org/apache/maven/plugin/changes";
- String resourceNames[] = {
- "images/add.gif",
- "images/fix.gif",
- "images/icon_help_sml.gif",
- "images/remove.gif",
- "images/rss.png",
- "images/update.gif" };
+ String resourceNames[] = { "images/add.gif", "images/fix.gif", "images/icon_help_sml.gif", "images/remove.gif",
+ "images/rss.png", "images/update.gif" };
try
{
getLog().debug( "Copying static resources." );
@@ -494,7 +480,7 @@
return teamlist;
}
- private void logIssueLinkTemplatePerSystem( Map issueLinkTemplatePerSystem )
+ private void logIssueLinkTemplatePerSystem( Map<String, String> issueLinkTemplatePerSystem )
{
if ( getLog().isDebugEnabled() )
{
@@ -504,9 +490,8 @@
}
else
{
- for ( Object o : issueLinkTemplatePerSystem.entrySet() )
+ for ( Entry<String, String> entry : issueLinkTemplatePerSystem.entrySet() )
{
- Map.Entry entry = (Map.Entry) o;
getLog().debug( "issueLinkTemplatePerSystem[" + entry.getKey() + "] = " + entry.getValue() );
}
}
diff --git a/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java b/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java
index ca04817..92af085 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ChangesReportGenerator.java
@@ -44,7 +44,8 @@
*
* @version $Id$
*/
-public class ChangesReportGenerator extends AbstractIssuesReportGenerator
+public class ChangesReportGenerator
+ extends AbstractIssuesReportGenerator
{
/**
@@ -62,8 +63,7 @@
private static final String NO_TEAMLIST = "none";
/**
- * The issue management system to use, for actions that do not specify a
- * system.
+ * The issue management system to use, for actions that do not specify a system.
*
* @since 2.4
*/
@@ -73,7 +73,7 @@
private String url;
- private Map issueLinksPerSystem;
+ private Map<String, String> issueLinksPerSystem;
private boolean addActionDate;
@@ -87,14 +87,14 @@
/**
* @since 2.4
*/
- private List releaseList;
+ private List<Release> releaseList;
public ChangesReportGenerator()
{
- issueLinksPerSystem = new HashMap();
+ issueLinksPerSystem = new HashMap<String, String>();
}
- public ChangesReportGenerator( List releaseList )
+ public ChangesReportGenerator( List<Release> releaseList )
{
this();
this.releaseList = releaseList;
@@ -152,12 +152,12 @@
return url;
}
- public Map getIssueLinksPerSystem()
+ public Map<String, String> getIssueLinksPerSystem()
{
return issueLinksPerSystem;
}
- public void setIssueLinksPerSystem( Map issueLinksPerSystem )
+ public void setIssueLinksPerSystem( Map<String, String> issueLinksPerSystem )
{
if ( this.issueLinksPerSystem != null && issueLinksPerSystem == null )
{
@@ -198,7 +198,7 @@
{
return false;
}
- String issueLink = (String) this.issueLinksPerSystem.get( system );
+ String issueLink = this.issueLinksPerSystem.get( system );
// If the issue link entry is blank then no links are possible
if ( StringUtils.isBlank( issueLink ) )
@@ -318,7 +318,7 @@
* @param bundle A resource bundle for i18n
* @param dueTos Other people that helped with an action
*/
- private void constructDueTo( Sink sink, Action action, ResourceBundle bundle, List dueTos )
+ private void constructDueTo( Sink sink, Action action, ResourceBundle bundle, List<DueTo> dueTos )
{
// Create a Map with key : dueTo name, value : dueTo email
@@ -330,9 +330,8 @@
namesEmailMap.put( action.getDueTo(), action.getDueToEmail() );
}
- for ( Object dueTo1 : dueTos )
+ for ( DueTo dueTo : dueTos )
{
- DueTo dueTo = (DueTo) dueTo1;
namesEmailMap.put( dueTo.getName(), dueTo.getEmail() );
}
@@ -374,7 +373,7 @@
* @param sink The sink
* @param fixes The List of issues specified as fixes elements
*/
- private void constructIssueLink( String issue, String system, Sink sink, List fixes )
+ private void constructIssueLink( String issue, String system, Sink sink, List<FixedIssue> fixes )
{
if ( StringUtils.isNotEmpty( issue ) )
{
@@ -390,9 +389,9 @@
}
}
- for ( Iterator iterator = fixes.iterator(); iterator.hasNext(); )
+ for ( Iterator<FixedIssue> iterator = fixes.iterator(); iterator.hasNext(); )
{
- FixedIssue fixedIssue = (FixedIssue) iterator.next();
+ FixedIssue fixedIssue = iterator.next();
String currentIssueId = fixedIssue.getIssue();
if ( StringUtils.isNotEmpty( currentIssueId ) )
{
@@ -411,14 +410,13 @@
}
/**
- * Construct a text that references (but does not link to) the issues that
- * were solved by an action.
+ * Construct a text that references (but does not link to) the issues that were solved by an action.
*
* @param issue The issue specified by attributes
* @param sink The sink
* @param fixes The List of issues specified as fixes elements
*/
- private void constructIssueText( String issue, Sink sink, List fixes )
+ private void constructIssueText( String issue, Sink sink, List<FixedIssue> fixes )
{
if ( StringUtils.isNotEmpty( issue ) )
{
@@ -430,9 +428,9 @@
}
}
- for ( Iterator iterator = fixes.iterator(); iterator.hasNext(); )
+ for ( Iterator<FixedIssue> iterator = fixes.iterator(); iterator.hasNext(); )
{
- FixedIssue fixedIssue = (FixedIssue) iterator.next();
+ FixedIssue fixedIssue = iterator.next();
String currentIssueId = fixedIssue.getIssue();
if ( StringUtils.isNotEmpty( currentIssueId ) )
@@ -447,7 +445,7 @@
}
}
- private void constructReleaseHistory( Sink sink, ResourceBundle bundle, List releaseList )
+ private void constructReleaseHistory( Sink sink, ResourceBundle bundle, List<Release> releaseList )
{
sink.section2();
@@ -467,10 +465,8 @@
sink.tableRow_();
- for ( Object aReleaseList : releaseList )
+ for ( Release release : releaseList )
{
- Release release = (Release) aReleaseList;
-
sink.tableRow();
sinkCellLink( sink, release.getVersion(), "#" + HtmlTools.encodeId( release.getVersion() ) );
@@ -506,11 +502,10 @@
* @param bundle Resource bundle
* @param releaseList Releases to create content for
*/
- private void constructReleases( Sink sink, ResourceBundle bundle, List releaseList )
+ private void constructReleases( Sink sink, ResourceBundle bundle, List<Release> releaseList )
{
- for ( Object aReleaseList : releaseList )
+ for ( Release release : releaseList )
{
- Release release = (Release) aReleaseList;
constructRelease( sink, bundle, release );
}
}
@@ -531,8 +526,7 @@
SinkEventAttributes attrs = new SinkEventAttributeSet();
attrs.addAttribute( SinkEventAttributes.ID, HtmlTools.encodeId( release.getVersion() ) );
sink.sectionTitle( Sink.SECTION_LEVEL_2, attrs );
- sink.text( bundle.getString( "report.changes.label.release" ) + " "
- + release.getVersion() + date );
+ sink.text( bundle.getString( "report.changes.label.release" ) + " " + release.getVersion() + date );
sink.sectionTitle_( Sink.SECTION_LEVEL_2 );
if ( isReleaseEmpty( release ) )
@@ -573,8 +567,8 @@
}
/**
- * Constructs table rows for specified release component. It will create header row for
- * component name and action rows for all component issues.
+ * Constructs table rows for specified release component. It will create header row for component name and action
+ * rows for all component issues.
*
* @param sink Sink
* @param bundle Resource bundle
diff --git a/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java b/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
index 37a2e24..faf23b6 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ChangesValidatorMojo.java
@@ -33,7 +33,6 @@
import org.xml.sax.SAXParseException;
/**
- *
* Goal which validate the <code>changes.xml</code> file.
*
* @author Olivier Lamy
@@ -68,7 +67,7 @@
@Parameter( property = "changes.xmlPath", defaultValue = "src/changes/changes.xml" )
private File xmlPath;
- /**
+ /**
* @see org.apache.maven.plugin.Mojo#execute()
*/
public void execute()
@@ -89,8 +88,8 @@
try
{
- XmlValidationHandler xmlValidationHandler = changesSchemaValidator
- .validateXmlWithSchema( xmlPath, changesXsdVersion, failOnError );
+ XmlValidationHandler xmlValidationHandler =
+ changesSchemaValidator.validateXmlWithSchema( xmlPath, changesXsdVersion, failOnError );
boolean hasErrors = !xmlValidationHandler.getErrors().isEmpty();
if ( hasErrors )
{
diff --git a/src/main/java/org/apache/maven/plugin/changes/ChangesXML.java b/src/main/java/org/apache/maven/plugin/changes/ChangesXML.java
index 308bfc3..1e3b138 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ChangesXML.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ChangesXML.java
@@ -19,18 +19,38 @@
* under the License.
*/
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.plugins.changes.model.Body;
-import org.apache.maven.plugins.changes.model.ChangesDocument;
-import org.apache.maven.plugins.changes.model.Properties;
-import org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader;
-import org.codehaus.plexus.util.IOUtil;
-
import java.io.File;
import java.io.FileInputStream;
import java.util.Collections;
import java.util.List;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.changes.model.Body;
+import org.apache.maven.plugins.changes.model.ChangesDocument;
+import org.apache.maven.plugins.changes.model.Properties;
+import org.apache.maven.plugins.changes.model.Release;
+import org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader;
+import org.codehaus.plexus.util.IOUtil;
+
/**
* A facade for a changes.xml file.
*
@@ -40,7 +60,7 @@
{
/** The list of releases in the changes.xml file. */
- private List releaseList;
+ private List<Release> releaseList;
/** The author in the changes.xml file. */
private String author;
@@ -56,11 +76,13 @@
/**
* Constructor that sets the changes.xml file and the logger.
+ *
* @param xmlPath the changes.xml file
* @param log the logger
* @throws ChangesXMLRuntimeException if there was a fatal error while parsing the changes.xml file
*/
- public ChangesXML( File xmlPath, Log log ) throws ChangesXMLRuntimeException
+ public ChangesXML( File xmlPath, Log log )
+ throws ChangesXMLRuntimeException
{
if ( xmlPath == null || !xmlPath.exists() )
@@ -97,10 +119,8 @@
this.title = properties.getTitle();
}
-
Body body = changesDocument.getBody();
-
if ( body != null )
{
this.releaseList = body.getReleases();
@@ -120,6 +140,7 @@
/**
* Sets the {@link ChangesXML#author} attribute.
+ *
* @param author the new value of the {@link ChangesXML#author} attribute
*/
public void setAuthor( String author )
@@ -129,6 +150,7 @@
/**
* Returns the current value of the author attribute.
+ *
* @return the current value of the author attribute
*/
public String getAuthor()
@@ -138,24 +160,27 @@
/**
* Sets the {@link ChangesXML#releaseList} attribute.
+ *
* @param releaseList the new value of the {@link ChangesXML#releaseList} attribute
*/
- public void setReleaseList( List releaseList )
+ public void setReleaseList( List<Release> releaseList )
{
this.releaseList = releaseList;
}
/**
* Returns the current value of the {@link ChangesXML#releaseList} attribute.
+ *
* @return the current value of the {@link ChangesXML#releaseList} attribute
*/
- public List getReleaseList()
+ public List<Release> getReleaseList()
{
- return releaseList == null ? Collections.EMPTY_LIST : releaseList;
+ return releaseList == null ? Collections.<Release>emptyList() : releaseList;
}
/**
* Sets the {@link ChangesXML#title} attribute.
+ *
* @param title the new value of the {@link ChangesXML#title} attribute
*/
public void setTitle( String title )
@@ -165,6 +190,7 @@
/**
* Returns the current value of the {@link ChangesXML#title} attribute.
+ *
* @return the current value of the {@link ChangesXML#title} attribute
*/
public String getTitle()
@@ -173,7 +199,8 @@
}
/**
- Returns the current value of the {@link ChangesXML#changesDocument} attribute.
+ * Returns the current value of the {@link ChangesXML#changesDocument} attribute.
+ *
* @return the current value of the {@link ChangesXML#changesDocument} attribute
*/
public ChangesDocument getChangesDocument()
@@ -183,6 +210,7 @@
/**
* Returns the current value of the {@link ChangesXML#authorEmail} attribute.
+ *
* @return the current value of the {@link ChangesXML#authorEmail} attribute
*/
public String getAuthorEmail()
@@ -192,6 +220,7 @@
/**
* Sets the {@link ChangesXML#authorEmail} attribute.
+ *
* @param authorEmail the new value of the {@link ChangesXML#authorEmail} attribute
*/
public void setAuthorEmail( String authorEmail )
diff --git a/src/main/java/org/apache/maven/plugin/changes/ChangesXMLRuntimeException.java b/src/main/java/org/apache/maven/plugin/changes/ChangesXMLRuntimeException.java
index 62ea50b..4016e3e 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ChangesXMLRuntimeException.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ChangesXMLRuntimeException.java
@@ -21,8 +21,8 @@
/**
* This is a runtime exception class that is thrown by the
- * {@link ChangesXML#ChangesXML(java.io.File, org.apache.maven.plugin.logging.Log)} constructor if the given
- * changes.xml file cannot be parsed, for example it is not well-formed or valid.
+ * {@link ChangesXML#ChangesXML(java.io.File, org.apache.maven.plugin.logging.Log)} constructor if the given changes.xml
+ * file cannot be parsed, for example it is not well-formed or valid.
*
* @author <a href="mailto:szgabsz91@gmail.com">Gabor Szabo</a>
*/
diff --git a/src/main/java/org/apache/maven/plugin/changes/FeedGenerator.java b/src/main/java/org/apache/maven/plugin/changes/FeedGenerator.java
index 2d09031..65300eb 100644
--- a/src/main/java/org/apache/maven/plugin/changes/FeedGenerator.java
+++ b/src/main/java/org/apache/maven/plugin/changes/FeedGenerator.java
@@ -44,19 +44,21 @@
import org.apache.maven.plugins.changes.model.Release;
-
/**
- *
* @author ltheussl
*/
public class FeedGenerator
{
private final ResourceBundle rbundle;
+
private final SyndFeed feed;
private String link;
+
private String title;
+
private String author;
+
private DateFormat dateFormat;
/**
@@ -121,8 +123,7 @@
}
/**
- * Set the date format.
- * This should match the date format used for the release dates in changes.xml.
+ * Set the date format. This should match the date format used for the release dates in changes.xml.
*
* @param dateFormat may be null.
*/
@@ -157,7 +158,6 @@
* "rss_0.92", "rss_0.93", "rss_0.94", "rss_1.0", "rss_2.0", "atom_0.3", "atom_1.0"</code>.
*
* @param type the feed type to check. May be null.
- *
* @return true if if the given type is supported by the rome library, false otherwise.
*/
public boolean isSupportedFeedType( final String type )
@@ -169,7 +169,6 @@
* A List of supported feed types.
*
* @return a List of supported feed types.
- *
* @see #isSupportedFeedType(java.lang.String)
*/
@SuppressWarnings( "unchecked" )
@@ -182,11 +181,9 @@
* Extract a feed and export it to a Writer.
*
* @param releases the List of Releases. Only the last release is used in the feed.
- * @param feedType The type of the feed to generate.
- * See {@link #isSupportedFeedType(java.lang.String)} for supported values.
- *
+ * @param feedType The type of the feed to generate. See {@link #isSupportedFeedType(java.lang.String)} for
+ * supported values.
* @param writer a Writer. Note that this is not flushed nor closed upon exit.
- *
* @throws IOException if an error occurs during export.
*/
public void export( final List<Release> releases, final String feedType, final Writer writer )
@@ -199,8 +196,8 @@
feed.setLink( link );
feed.setDescription( rbundle.getString( "report.changes.text.rssfeed.description" ) );
feed.setLanguage( rbundle.getLocale().getLanguage() );
- //feed.setCopyright( );
- //feed.setEncoding();
+ // feed.setCopyright( );
+ // feed.setEncoding();
feed.setEntries( getEntries( releases ) );
try
@@ -250,9 +247,8 @@
}
// TODO: localize?
- sb.append( "<p>Version " )
- .append( release.getVersion() ).append( " is available with " )
- .append( release.getActions().size() ).append( " fixed issues.</p>" );
+ sb.append( "<p>Version " ).append( release.getVersion() ).append( " is available with " );
+ sb.append( release.getActions().size() ).append( " fixed issues.</p>" );
syndContent.setValue( sb.toString() );
diff --git a/src/main/java/org/apache/maven/plugin/changes/IssueAdapter.java b/src/main/java/org/apache/maven/plugin/changes/IssueAdapter.java
index c8042ec..0b30e51 100644
--- a/src/main/java/org/apache/maven/plugin/changes/IssueAdapter.java
+++ b/src/main/java/org/apache/maven/plugin/changes/IssueAdapter.java
@@ -40,6 +40,7 @@
public class IssueAdapter
{
private static final String UNKNOWN_ISSUE_TYPE = "";
+
private IssueManagementSystem ims;
/**
diff --git a/src/main/java/org/apache/maven/plugin/changes/ProjectUtils.java b/src/main/java/org/apache/maven/plugin/changes/ProjectUtils.java
index 272c45e..2ef3eb0 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ProjectUtils.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ProjectUtils.java
@@ -38,8 +38,8 @@
* @param issueManagementSystem The name of the issue management system that is required
* @param mojoResult What the calling mojo produces, used in the error messages
* @param log A log
- * @return <code>true</code> if the <issueManagement> element of the POM is complete,
- * otherwise <code>false</code>
+ * @return <code>true</code> if the <issueManagement> element of the POM is complete, otherwise
+ * <code>false</code>
*/
public static boolean validateIfIssueManagementComplete( MavenProject project, String issueManagementSystem,
String mojoResult, Log log )
diff --git a/src/main/java/org/apache/maven/plugin/changes/ReleaseUtils.java b/src/main/java/org/apache/maven/plugin/changes/ReleaseUtils.java
index e9377ba..4274c1e 100644
--- a/src/main/java/org/apache/maven/plugin/changes/ReleaseUtils.java
+++ b/src/main/java/org/apache/maven/plugin/changes/ReleaseUtils.java
@@ -47,8 +47,7 @@
}
/**
- * Get the latest release by matching the supplied releases
- * with the version from the pom.
+ * Get the latest release by matching the supplied releases with the version from the pom.
*
* @param releases list of releases
* @param pomVersion Version of the artifact
@@ -94,8 +93,8 @@
{
if ( getLog().isDebugEnabled() )
{
- getLog().debug( "The release: " + release.getVersion()
- + " has " + release.getActions().size() + " actions." );
+ getLog().debug( "The release: " + release.getVersion() + " has " + release.getActions().size()
+ + " actions." );
}
if ( release.getVersion() != null && release.getVersion().equals( version ) )
@@ -125,9 +124,8 @@
}
/**
- * Merge releases from one issue tracker with releases from another issue
- * tracker. If a release is found in both issue trackers, i.e. they have
- * the same version, their issues are merged into one release.
+ * Merge releases from one issue tracker with releases from another issue tracker. If a release is found in both
+ * issue trackers, i.e. they have the same version, their issues are merged into one release.
*
* @param firstReleases Releases from the first issue tracker
* @param secondReleases Releases from the second issue tracker
@@ -179,14 +177,13 @@
}
/**
- * Convert an untyped List of Release objects that comes from changes.xml
- * into a typed List of Release objects.
+ * Convert an untyped List of Release objects that comes from changes.xml into a typed List of Release objects.
*
* @param changesReleases An untyped List of Release objects
* @return A type List of Release objects
* @todo When Modello can generate typed collections this method is no longer needed
*/
- public List<Release> convertReleaseList( List changesReleases )
+ public List<Release> convertReleaseList( List<Release> changesReleases )
{
List<Release> releases = new ArrayList<Release>();
@@ -201,28 +198,28 @@
}
/**
- * Merge releases from parent component with releases from child component.
- * If a release is found in both components, i.e. they have the same version,
- * their issues are merged into one (parent) release with component marker
- * for component issues.
+ * Merge releases from parent component with releases from child component. If a release is found in both
+ * components, i.e. they have the same version, their issues are merged into one (parent) release with component
+ * marker for component issues.
*
* @param releases Releases from the parent component
* @param componentName child component name (retrieved from project name)
* @param componentReleases Releases from the child component
* @return A list containing the merged releases
*/
- public List mergeReleases( final List releases, final String componentName, final List componentReleases )
+ public List<Release> mergeReleases( final List<Release> releases, final String componentName,
+ final List<Release> componentReleases )
{
if ( releases == null && componentReleases == null )
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
if ( componentReleases == null )
{
return releases;
}
- final List mergedReleases = new ArrayList();
+ final List<Release> mergedReleases = new ArrayList<Release>();
if ( releases != null )
{
@@ -257,12 +254,9 @@
private static String toString( Release release )
{
- return release.getClass().getSimpleName()
- + "[version='" + release.getVersion() + "'"
- + ", date='" + release.getDateRelease() + "'"
- + ", description='" + release.getDescription() + "'"
- + ", actionsSize=" + release.getActions().size()
- + "]";
+ return release.getClass().getSimpleName() + "[version='" + release.getVersion() + "'" + ", date='"
+ + release.getDateRelease() + "'" + ", description='" + release.getDescription() + "'" + ", actionsSize="
+ + release.getActions().size() + "]";
}
public static String toString( List<Release> releases )
diff --git a/src/main/java/org/apache/maven/plugin/changes/schema/DefaultChangesSchemaValidator.java b/src/main/java/org/apache/maven/plugin/changes/schema/DefaultChangesSchemaValidator.java
index 3b9a9d8..3395593 100644
--- a/src/main/java/org/apache/maven/plugin/changes/schema/DefaultChangesSchemaValidator.java
+++ b/src/main/java/org/apache/maven/plugin/changes/schema/DefaultChangesSchemaValidator.java
@@ -23,18 +23,16 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
+import java.util.HashMap;
import java.util.Map;
-import org.apache.commons.io.input.XmlStreamReader;
-
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
-import org.codehaus.plexus.util.FastMap;
+import org.apache.commons.io.input.XmlStreamReader;
import org.codehaus.plexus.util.IOUtil;
-
import org.xml.sax.SAXException;
/**
@@ -54,7 +52,7 @@
public static final String CHANGES_SCHEMA_PATH = "META-INF/changes/xsd/";
- private Map compiledSchemas = new FastMap();
+ private Map<String, Schema> compiledSchemas = new HashMap<String, Schema>();
public XmlValidationHandler validateXmlWithSchema( File file, String schemaVersion, boolean failOnValidationError )
throws SchemaValidatorException
diff --git a/src/main/java/org/apache/maven/plugin/changes/schema/SchemaValidatorException.java b/src/main/java/org/apache/maven/plugin/changes/schema/SchemaValidatorException.java
index 7876e70..dfa528b 100644
--- a/src/main/java/org/apache/maven/plugin/changes/schema/SchemaValidatorException.java
+++ b/src/main/java/org/apache/maven/plugin/changes/schema/SchemaValidatorException.java
@@ -27,7 +27,12 @@
public class SchemaValidatorException
extends Exception
{
-
+
+ /**
+ * Generated serial UID.
+ */
+ private static final long serialVersionUID = -8265574906534248274L;
+
/**
* @param message
* @param cause
diff --git a/src/main/java/org/apache/maven/plugin/github/GitHubDownloader.java b/src/main/java/org/apache/maven/plugin/github/GitHubDownloader.java
index 5326dbd..48cf56b 100644
--- a/src/main/java/org/apache/maven/plugin/github/GitHubDownloader.java
+++ b/src/main/java/org/apache/maven/plugin/github/GitHubDownloader.java
@@ -75,7 +75,7 @@
public GitHubDownloader( MavenProject project, String githubScheme, int githubPort, boolean includeOpenIssues,
boolean onlyMilestoneIssues )
- throws MalformedURLException
+ throws MalformedURLException
{
this.includeOpenIssues = includeOpenIssues;
this.onlyMilestoneIssues = onlyMilestoneIssues;
@@ -114,8 +114,8 @@
if ( urlPathParts.length != 3 )
{
- throw new MalformedURLException(
- "GitHub issue management URL must look like, [GITHUB_DOMAIN]/[OWNER]/[REPO]/issues" );
+ throw new MalformedURLException( "GitHub issue management URL must look like, "
+ + "[GITHUB_DOMAIN]/[OWNER]/[REPO]/issues" );
}
this.githubOwner = urlPathParts[0];
@@ -227,9 +227,9 @@
configured = true;
break;
-}
+ }
}
-
+
if ( !configured )
{
log.warn( "Can't find server id [" + githubAPIServerId + "] configured in githubAPIServerId." );
diff --git a/src/main/java/org/apache/maven/plugin/github/GitHubIssueManagementSystem.java b/src/main/java/org/apache/maven/plugin/github/GitHubIssueManagementSystem.java
index 49c76f7..1ded82e 100644
--- a/src/main/java/org/apache/maven/plugin/github/GitHubIssueManagementSystem.java
+++ b/src/main/java/org/apache/maven/plugin/github/GitHubIssueManagementSystem.java
@@ -23,7 +23,6 @@
import org.apache.maven.plugin.issues.AbstractIssueManagementSystem;
/**
- *
* @since 2.8
*/
public class GitHubIssueManagementSystem
diff --git a/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java b/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java
index 82ad52c..ae32330 100644
--- a/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java
+++ b/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java
@@ -38,8 +38,7 @@
import java.util.ResourceBundle;
/**
- * Goal which downloads issues from GitHub and generates a
- * report.
+ * Goal which downloads issues from GitHub and generates a report.
*
* @author Bryan Baugher
* @since 2.8
@@ -52,31 +51,27 @@
/**
* Valid Github columns.
*/
- @SuppressWarnings( "checkstyle:staticvariablename" )
- private static Map<String, Integer> GITHUB_COLUMNS = new HashMap<String, Integer>();
+ private static Map<String, Integer> githubColumns = new HashMap<String, Integer>();
static
{
- GITHUB_COLUMNS.put( "Assignee", IssuesReportHelper.COLUMN_ASSIGNEE );
- GITHUB_COLUMNS.put( "Created", IssuesReportHelper.COLUMN_CREATED );
- GITHUB_COLUMNS.put( "Fix Version", IssuesReportHelper.COLUMN_FIX_VERSION );
- GITHUB_COLUMNS.put( "Id", IssuesReportHelper.COLUMN_ID );
- GITHUB_COLUMNS.put( "Reporter", IssuesReportHelper.COLUMN_REPORTER );
- GITHUB_COLUMNS.put( "Status", IssuesReportHelper.COLUMN_STATUS );
- GITHUB_COLUMNS.put( "Summary", IssuesReportHelper.COLUMN_SUMMARY );
- GITHUB_COLUMNS.put( "Type", IssuesReportHelper.COLUMN_TYPE );
- GITHUB_COLUMNS.put( "Updated", IssuesReportHelper.COLUMN_UPDATED );
+ githubColumns.put( "Assignee", IssuesReportHelper.COLUMN_ASSIGNEE );
+ githubColumns.put( "Created", IssuesReportHelper.COLUMN_CREATED );
+ githubColumns.put( "Fix Version", IssuesReportHelper.COLUMN_FIX_VERSION );
+ githubColumns.put( "Id", IssuesReportHelper.COLUMN_ID );
+ githubColumns.put( "Reporter", IssuesReportHelper.COLUMN_REPORTER );
+ githubColumns.put( "Status", IssuesReportHelper.COLUMN_STATUS );
+ githubColumns.put( "Summary", IssuesReportHelper.COLUMN_SUMMARY );
+ githubColumns.put( "Type", IssuesReportHelper.COLUMN_TYPE );
+ githubColumns.put( "Updated", IssuesReportHelper.COLUMN_UPDATED );
}
/**
- * Sets the column names that you want to show in the report. The columns
- * will appear in the report in the same order as you specify them here.
- * Multiple values can be separated by commas.
+ * Sets the column names that you want to show in the report. The columns will appear in the report in the same
+ * order as you specify them here. Multiple values can be separated by commas.
* <p>
- * Valid columns are: <code>Assignee</code>, <code>Created</code>,
- * <code>Fix Version</code>, <code>Id</code>, <code>Reporter</code>,
- * <code>Status</code>, <code>Summary</code>, <code>Type</code> and
- * <code>Updated</code>.
+ * Valid columns are: <code>Assignee</code>, <code>Created</code>, <code>Fix Version</code>, <code>Id</code>,
+ * <code>Reporter</code>, <code>Status</code>, <code>Summary</code>, <code>Type</code> and <code>Updated</code>.
* </p>
*/
@Parameter( defaultValue = "Id,Type,Summary,Assignee,Reporter,Status,Created,Updated,Fix Version" )
@@ -120,9 +115,8 @@
private boolean onlyMilestoneIssues;
/**
- * If you only want to show issues for the current version in the report.
- * The current version being used is <code>${project.version}</code> minus
- * any "-SNAPSHOT" suffix.
+ * If you only want to show issues for the current version in the report. The current version being used is
+ * <code>${project.version}</code> minus any "-SNAPSHOT" suffix.
*/
@Parameter( defaultValue = "false" )
private boolean onlyCurrentVersion;
@@ -143,7 +137,7 @@
}
/* --------------------------------------------------------------------- */
- /* Public methods */
+ /* Public methods */
/* --------------------------------------------------------------------- */
/**
@@ -166,12 +160,12 @@
{
// Validate parameters
- List<Integer> columnIds = IssuesReportHelper.getColumnIds( columnNames, GITHUB_COLUMNS );
+ List<Integer> columnIds = IssuesReportHelper.getColumnIds( columnNames, githubColumns );
if ( columnIds.size() == 0 )
{
// This can happen if the user has configured column names and they are all invalid
- throw new MavenReportException(
- "maven-changes-plugin: None of the configured columnNames '" + columnNames + "' are valid." );
+ throw new MavenReportException( "maven-changes-plugin: None of the configured columnNames '" + columnNames
+ + "' are valid." );
}
try
@@ -215,7 +209,7 @@
}
/* --------------------------------------------------------------------- */
- /* Private methods */
+ /* Private methods */
/* --------------------------------------------------------------------- */
private ResourceBundle getBundle( Locale locale )
diff --git a/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java b/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java
index 13f0e57..669132a 100644
--- a/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java
+++ b/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java
@@ -31,9 +31,8 @@
* modularity for support of multiple systems.<br>
* Initially, all it provides is a structure for mapping from per-IMS issue types to the three categories defined in
* {@link org.apache.maven.plugin.changes.IssueAdapter}. <br/>
- * Note that the map in here is <strong>not</strong> immutable. It contains the default
- * configuration for an IMS. Users are expected to add entries to the map via configuration
- * to reflect their customizations.
+ * Note that the map in here is <strong>not</strong> immutable. It contains the default configuration for an IMS. Users
+ * are expected to add entries to the map via configuration to reflect their customizations.
*
* @version $Id$
*/
@@ -47,20 +46,23 @@
issueTypeMap = new HashMap<String, IssueType>();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.apache.maven.plugin.issues.IssueManagementSystem#getIssueTypeMap()
*/
public Map<String, IssueType> getIssueTypeMap()
{
return issueTypeMap;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.apache.maven.plugin.issues.IssueManagementSystem#getName()
*/
public abstract String getName();
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.apache.maven.plugin.issues.IssueManagementSystem#applyConfiguration(java.util.Map)
*/
public void applyConfiguration( Map<String, String> issueTypes )
@@ -75,7 +77,7 @@
}
String imsTypes = me.getValue();
String[] imsTypeArray = imsTypes.split( "," );
- for ( String imsType : imsTypeArray )
+ for ( String imsType : imsTypeArray )
{
issueTypeMap.put( imsType, type );
}
diff --git a/src/main/java/org/apache/maven/plugin/issues/Issue.java b/src/main/java/org/apache/maven/plugin/issues/Issue.java
index 443fa2c..490c1fc 100644
--- a/src/main/java/org/apache/maven/plugin/issues/Issue.java
+++ b/src/main/java/org/apache/maven/plugin/issues/Issue.java
@@ -254,10 +254,7 @@
public String toString()
{
- return this.getClass().getSimpleName()
- + "[id='" + this.getId() + "'"
- + ", title='" + this.getTitle() + "'"
- + ", fixVersions='" + this.getFixVersions() + "'"
- + "]";
+ return this.getClass().getSimpleName() + "[id='" + this.getId() + "'" + ", title='" + this.getTitle() + "'"
+ + ", fixVersions='" + this.getFixVersions() + "'" + "]";
}
}
diff --git a/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java b/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java
index a356033..5597e62 100644
--- a/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java
+++ b/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java
@@ -53,7 +53,7 @@
* Configure this issue management system.
*
* @param issueTypes The mapping of issue types used in this issue management system to the ones used in a
- * changes.xml file
+ * changes.xml file
* @throws MojoExecutionException If the configuration fails
*/
void applyConfiguration( Map<String, String> issueTypes )
diff --git a/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java b/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java
index 3e86bc0..bc18512 100644
--- a/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java
+++ b/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java
@@ -41,8 +41,7 @@
* @param issues A list of issues
* @param prefix The prefix of the "Fix Version" that should match
* @return A <code>List</code> of issues fixed in versions that match the supplied prefix
- * @throws org.apache.maven.plugin.MojoExecutionException
- * If no issues could be found for the supplied prefix
+ * @throws org.apache.maven.plugin.MojoExecutionException If no issues could be found for the supplied prefix
*/
public static List<Issue> filterIssuesWithVersionPrefix( List<Issue> issues, String prefix )
throws MojoExecutionException
@@ -78,16 +77,14 @@
}
/**
- * Find the issues for only the supplied version, by matching the "Fix for"
- * version in the supplied list of issues with the supplied version.
- * If the supplied version is a SNAPSHOT, then that part of the version
- * will be removed prior to the matching.
+ * Find the issues for only the supplied version, by matching the "Fix for" version in the supplied list of issues
+ * with the supplied version. If the supplied version is a SNAPSHOT, then that part of the version will be removed
+ * prior to the matching.
*
* @param issues A list of issues
* @param version The version that issues should be returned for
* @return A <code>List</code> of issues for the supplied version
- * @throws org.apache.maven.plugin.MojoExecutionException
- * If no issues could be found for the supplied version
+ * @throws org.apache.maven.plugin.MojoExecutionException If no issues could be found for the supplied version
*/
public static List<Issue> getIssuesForVersion( List<Issue> issues, String version )
throws MojoExecutionException
diff --git a/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java b/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java
index 5494925..5cba012 100644
--- a/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java
+++ b/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java
@@ -34,7 +34,8 @@
* @version $Id$
* @since 2.4
*/
-public class IssuesReportGenerator extends AbstractIssuesReportGenerator
+public class IssuesReportGenerator
+ extends AbstractIssuesReportGenerator
{
/**
* Fallback value that is used if date field are not available.
@@ -42,8 +43,7 @@
private static final String NOT_AVAILABLE = "n/a";
/**
- * Holds the id:s for the columns to include in the report, in the order
- * that they should appear in the report.
+ * Holds the id:s for the columns to include in the report, in the order that they should appear in the report.
*/
private int[] columns;
@@ -68,7 +68,7 @@
sinkEndReport( sink );
}
- public void doGenerateReport( ResourceBundle bundle, Sink sink, List issueList )
+ public void doGenerateReport( ResourceBundle bundle, Sink sink, List<Issue> issueList )
{
sinkBeginReport( sink, bundle );
@@ -82,7 +82,7 @@
sinkEndReport( sink );
}
- private void constructHeaderRow( Sink sink, List issueList, ResourceBundle bundle )
+ private void constructHeaderRow( Sink sink, List<Issue> issueList, ResourceBundle bundle )
{
if ( issueList == null )
{
@@ -162,20 +162,18 @@
sink.tableRow_();
}
- private void constructDetailRows( Sink sink, List issueList, ResourceBundle bundle, Locale locale )
+ private void constructDetailRows( Sink sink, List<Issue> issueList, ResourceBundle bundle, Locale locale )
{
if ( issueList == null )
{
return;
}
- for ( Object anIssueList : issueList )
+ for ( Issue issue : issueList )
{
// Use a DateFormat based on the Locale
DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT, locale );
- Issue issue = (Issue) anIssueList;
-
sink.tableRow();
for ( int column : columns )
diff --git a/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java b/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java
index e349997..a52c56b 100644
--- a/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java
+++ b/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java
@@ -77,10 +77,9 @@
}
/**
- * Get a list of id:s for the columns that are to be included in the report.
- * This method also handles deprecated column names, which will still work.
- * If deprecated column names are used they generate a warning, indicating
- * the replacement column name.
+ * Get a list of id:s for the columns that are to be included in the report. This method also handles deprecated
+ * column names, which will still work. If deprecated column names are used they generate a warning, indicating the
+ * replacement column name.
*
* @param columnNames The names of the columns
* @param allColumns A mapping from column name to column id
@@ -115,7 +114,7 @@
if ( log != null )
{
log.warn( "The columnName '" + columnName + "' has been deprecated." + " Please use "
- + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." );
+ + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." );
}
}
}
diff --git a/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java b/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
index d942a2c..eccd51b 100644
--- a/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
+++ b/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java
@@ -34,8 +34,8 @@
import java.util.List;
/**
- * Abstract API, more or less, to retrieving issue information from JIRA.
- * Intended to have subclasses for the old (RSS) and new (REST) ways of doing things.
+ * Abstract API, more or less, to retrieving issue information from JIRA. Intended to have subclasses for the old (RSS)
+ * and new (REST) ways of doing things.
*
* @author mfranken@xebia.com
* @author jruiz@exist.com
@@ -47,53 +47,80 @@
/** Log for debug output. */
protected Log log;
+
/** Output file for xml document. */
protected File output;
+
/** The maximum number of entries to show. */
protected int nbEntriesMax;
+
/** The filter to apply to query to JIRA. */
protected String filter;
+
/** Ids of fix versions to show, as comma separated string. */
protected String fixVersionIds;
+
/** Ids of status to show, as comma separated string. */
protected String statusIds;
+
/** Ids of resolution to show, as comma separated string. */
protected String resolutionIds;
+
/** Ids of priority to show, as comma separated string. */
protected String priorityIds;
+
/** The component to show. */
protected String component;
+
/** Ids of types to show, as comma separated string. */
protected String typeIds;
+
/** Column names to sort by, as comma separated string. */
protected String sortColumnNames;
+
/** The username to log into JIRA. */
protected String jiraUser;
+
/** The password to log into JIRA. */
protected String jiraPassword;
+
/** The username to log into webserver. */
protected String webUser;
+
/** The password to log into webserver. */
protected String webPassword;
+
/** The maven project. */
protected MavenProject project;
+
/** The maven settings. */
protected Settings settings;
- /** Use JQL, JIRA query language, instead of URL parameter based queries.
- * Note that this is down here to make it easier for the mojo to deal with
- * both new and old flavors. */
+
+ /**
+ * Use JQL, JIRA query language, instead of URL parameter based queries. Note that this is down here to make it
+ * easier for the mojo to deal with both new and old flavors.
+ */
protected boolean useJql;
+
/** Filter the JIRA query based on the current version */
protected boolean onlyCurrentVersion;
+
/** The versionPrefix to apply to the POM version */
protected String versionPrefix;
+
/** The pattern used to parse dates from the JIRA xml file. */
protected String jiraDatePattern;
+
protected String proxyHost;
+
protected int proxyPort;
+
protected String proxyUser;
+
protected String proxyPass;
+
protected int connectionTimeout;
+
protected int receiveTimout;
/**
@@ -101,8 +128,8 @@
*
* @throws Exception on error
*/
- public abstract void doExecute() throws Exception;
-
+ public abstract void doExecute()
+ throws Exception;
/**
* Check to see if we think that JIRA authentication is needed.
@@ -114,7 +141,6 @@
return ( jiraUser != null ) && ( jiraUser.length() > 0 ) && ( jiraPassword != null );
}
-
protected void getProxyInfo( String jiraUrl )
{
// see whether there is any proxy defined in maven
@@ -157,7 +183,7 @@
// Validation of proxy method copied from org.apache.maven.wagon.proxy.ProxyUtils.
// @todo Can use original when maven-changes-plugin requires a more recent version of Maven
- //if ( ProxyUtils.validateNonProxyHosts( proxyInfo, jiraHost ) )
+ // if ( ProxyUtils.validateNonProxyHosts( proxyInfo, jiraHost ) )
if ( JiraHelper.validateNonProxyHosts( proxyInfo, jiraHost ) )
{
return;
@@ -200,8 +226,8 @@
}
}
-
- public abstract List<Issue> getIssueList() throws MojoExecutionException;
+ public abstract List<Issue> getIssueList()
+ throws MojoExecutionException;
public void setJiraDatePattern( String jiraDatePattern )
{
@@ -226,7 +252,7 @@
/**
* Sets the project.
*
- * @param thisProject The project to set
+ * @param thisProject The project to set
*/
public void setMavenProject( Object thisProject )
{
@@ -236,7 +262,7 @@
/**
* Sets the maximum number of Issues to show.
*
- * @param nbEntries The maximum number of Issues
+ * @param nbEntries The maximum number of Issues
*/
public void setNbEntries( final int nbEntries )
{
@@ -246,7 +272,7 @@
/**
* Sets the statusIds.
*
- * @param thisStatusIds The id(s) of the status to show, as comma separated string
+ * @param thisStatusIds The id(s) of the status to show, as comma separated string
*/
public void setStatusIds( String thisStatusIds )
{
@@ -256,7 +282,7 @@
/**
* Sets the priorityIds.
*
- * @param thisPriorityIds The id(s) of the priority to show, as comma separated string
+ * @param thisPriorityIds The id(s) of the priority to show, as comma separated string
*/
public void setPriorityIds( String thisPriorityIds )
{
@@ -266,7 +292,7 @@
/**
* Sets the resolutionIds.
*
- * @param thisResolutionIds The id(s) of the resolution to show, as comma separated string
+ * @param thisResolutionIds The id(s) of the resolution to show, as comma separated string
*/
public void setResolutionIds( String thisResolutionIds )
{
@@ -286,7 +312,7 @@
/**
* Sets the password for authentication against the webserver.
*
- * @param thisWebPassword The password of the webserver
+ * @param thisWebPassword The password of the webserver
*/
public void setWebPassword( String thisWebPassword )
{
@@ -296,7 +322,7 @@
/**
* Sets the username for authentication against the webserver.
*
- * @param thisWebUser The username of the webserver
+ * @param thisWebUser The username of the webserver
*/
public void setWebUser( String thisWebUser )
{
@@ -306,7 +332,7 @@
/**
* Sets the password to log into a secured JIRA.
*
- * @param thisJiraPassword The password for JIRA
+ * @param thisJiraPassword The password for JIRA
*/
public void setJiraPassword( final String thisJiraPassword )
{
@@ -316,7 +342,7 @@
/**
* Sets the username to log into a secured JIRA.
*
- * @param thisJiraUser The username for JIRA
+ * @param thisJiraUser The username for JIRA
*/
public void setJiraUser( String thisJiraUser )
{
@@ -326,7 +352,7 @@
/**
* Sets the filter to apply to query to JIRA.
*
- * @param thisFilter The filter to query JIRA
+ * @param thisFilter The filter to query JIRA
*/
public void setFilter( String thisFilter )
{
@@ -336,7 +362,7 @@
/**
* Sets the component(s) to apply to query JIRA.
*
- * @param theseComponents The id(s) of components to show, as comma separated string
+ * @param theseComponents The id(s) of components to show, as comma separated string
*/
public void setComponent( String theseComponents )
{
@@ -356,7 +382,7 @@
/**
* Sets the typeIds.
*
- * @param theseTypeIds The id(s) of the types to show, as comma separated string
+ * @param theseTypeIds The id(s) of the types to show, as comma separated string
*/
public void setTypeIds( String theseTypeIds )
{
diff --git a/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java b/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java
index 8d729a5..0587afe 100644
--- a/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java
+++ b/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java
@@ -25,17 +25,15 @@
import java.util.List;
/**
- * Jira downloader that uses REST or RSS, depending.
- * This code is not very attractive. However, JIRA has
- * supported REST for a very long time, and so the
- * fallback is only relevant for people with very old
- * copies of JIRA.
+ * Jira downloader that uses REST or RSS, depending. This code is not very attractive. However, JIRA has supported REST
+ * for a very long time, and so the fallback is only relevant for people with very old copies of JIRA.
*/
-public class AdaptiveJiraDownloader extends AbstractJiraDownloader
+public class AdaptiveJiraDownloader
+ extends AbstractJiraDownloader
{
private AbstractJiraDownloader effectiveDownloader;
- private boolean forceClassic;
+ private boolean forceClassic;
public void doExecute()
throws Exception
@@ -54,7 +52,7 @@
effectiveDownloader.doExecute();
}
}
-
+
private void copySettings( AbstractJiraDownloader target )
{
target.setLog( getLog() );
@@ -82,7 +80,6 @@
target.setReceiveTimout( receiveTimout );
}
-
public List<Issue> getIssueList()
throws MojoExecutionException
{
diff --git a/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java b/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java
index 6c97f0e..82045e4 100644
--- a/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java
+++ b/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java
@@ -75,7 +75,7 @@
// MCHANGES-89 Allow circular redirects
HttpClientParams clientParams = client.getParams();
clientParams.setBooleanParameter( HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true );
- clientParams.setCookiePolicy( CookiePolicy.BROWSER_COMPATIBILITY ); //MCHANGES-237
+ clientParams.setCookiePolicy( CookiePolicy.BROWSER_COMPATIBILITY ); // MCHANGES-237
HttpState state = new HttpState();
@@ -148,25 +148,19 @@
}
else
{
+ // CHECKSTYLE_OFF: LineLength
// create the URL for getting the proper issues from JIRA
- String jqlQuery = new JqlQueryBuilder( log )
- .project( jiraProject )
- .fixVersion( getFixFor() )
- .fixVersionIds( fixVersionIds )
- .statusIds( statusIds )
- .priorityIds( priorityIds )
- .resolutionIds( resolutionIds )
- .components( component )
- .typeIds( typeIds )
- .sortColumnNames( sortColumnNames )
- .build();
+ String jqlQuery =
+ new JqlQueryBuilder( log ).project( jiraProject ).fixVersion( getFixFor() ).fixVersionIds( fixVersionIds ).statusIds( statusIds ).priorityIds( priorityIds ).resolutionIds( resolutionIds ).components( component ).typeIds( typeIds ).sortColumnNames( sortColumnNames ).build();
- String url = new UrlBuilder( jiraUrl, "sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml" )
- .addParameter( "tempMax", nbEntriesMax )
- .addParameter( "reset", "true" )
- .addParameter( "jqlQuery", jqlQuery )
- .build();
+ String url =
+ new UrlBuilder( jiraUrl,
+ "sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml" ).addParameter( "tempMax",
+ nbEntriesMax ).addParameter( "reset",
+ "true" ).addParameter( "jqlQuery",
+ jqlQuery ).build();
+ // CHECKSTYLE_ON: LineLength
return url;
}
}
@@ -180,14 +174,14 @@
if ( jiraId == null || jiraId.length() == 0 )
{
log.debug( "The JIRA URL " + project.getIssueManagement().getUrl()
- + " doesn't include a pid, trying to extract it from JIRA." );
+ + " doesn't include a pid, trying to extract it from JIRA." );
jiraId = JiraHelper.getPidFromJira( log, project.getIssueManagement().getUrl(), client );
}
if ( jiraId == null )
{
throw new RuntimeException( "The issue management URL in the POM does not include a pid,"
- + " and it was not possible to extract it from the page at that URL." );
+ + " and it was not possible to extract it from the page at that URL." );
}
else
{
@@ -199,16 +193,10 @@
fullURL += "&fixfor=" + getFixFor();
}
- String createdFilter = new ParameterQueryBuilder( log )
- .fixVersionIds( fixVersionIds )
- .statusIds( statusIds )
- .priorityIds( priorityIds )
- .resolutionIds( resolutionIds )
- .components( component )
- .typeIds( typeIds )
- .sortColumnNames( sortColumnNames )
- .filter( filter )
- .build();
+ // CHECKSTYLE_OFF: LineLength
+ String createdFilter =
+ new ParameterQueryBuilder( log ).fixVersionIds( fixVersionIds ).statusIds( statusIds ).priorityIds( priorityIds ).resolutionIds( resolutionIds ).components( component ).typeIds( typeIds ).sortColumnNames( sortColumnNames ).filter( filter ).build();
+ // CHECKSTYLE_ON: LineLength
if ( createdFilter.charAt( 0 ) != '&' )
{
@@ -243,12 +231,11 @@
}
/**
- * Authenticate against JIRA. This method relies on jiraUser and
- * jiraPassword being set. You can check this by calling
- * isJiraAuthenticationConfigured().
+ * Authenticate against JIRA. This method relies on jiraUser and jiraPassword being set. You can check this by
+ * calling isJiraAuthenticationConfigured().
*
- * @param client the HttpClient
- * @param jiraUrl the JIRA installation
+ * @param client the HttpClient
+ * @param jiraUrl the JIRA installation
* @return <code>true</code> if the authentication was successful, otherwise <code>false</code>
*/
private boolean doJiraAuthentication( HttpClient client, final String jiraUrl )
@@ -305,8 +292,8 @@
}
/**
- * Evaluate if the login attempt to JIRA was successful or not. We can't
- * use the status code because JIRA returns 200 even if the login fails.
+ * Evaluate if the login attempt to JIRA was successful or not. We can't use the status code because JIRA returns
+ * 200 even if the login fails.
*
* @param loginGet The method that was executed
* @return <code>false</code> if we find an error message in the response body, otherwise <code>true</code>
@@ -323,7 +310,7 @@
/**
* Setup proxy access if we have to.
*
- * @param client the HttpClient
+ * @param client the HttpClient
*/
private void determineProxy( String jiraUrl, HttpClient client )
{
@@ -341,10 +328,9 @@
{
getLog().debug( "Using proxy user: " + proxyUser );
- client.getState().setProxyCredentials(
- new AuthScope( null, AuthScope.ANY_PORT, null,
- AuthScope.ANY_SCHEME ),
- new UsernamePasswordCredentials( proxyUser, proxyPass ) );
+ client.getState().setProxyCredentials( new AuthScope( null, AuthScope.ANY_PORT, null,
+ AuthScope.ANY_SCHEME ),
+ new UsernamePasswordCredentials( proxyUser, proxyPass ) );
}
}
}
@@ -352,8 +338,8 @@
/**
* Downloads the given link using the configured HttpClient, possibly following redirects.
*
- * @param cl the HttpClient
- * @param link the URL to JIRA
+ * @param cl the HttpClient
+ * @param link the URL to JIRA
*/
private void download( final HttpClient cl, final String link )
{
diff --git a/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java b/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java
index 1f680d8..4f9e16d 100644
--- a/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java
+++ b/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java
@@ -31,7 +31,9 @@
extends AbstractIssueManagementSystem
{
private static final String DEFAULT_ADD_TYPE = "New Feature";
+
private static final String DEFAULT_FIX_TYPE = "Bug";
+
private static final String DEFAULT_UPDATE_TYPE = "Improvement";
public JIRAIssueManagmentSystem()
diff --git a/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java b/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java
index 4f0c899..1a2e9a6 100644
--- a/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java
+++ b/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java
@@ -38,11 +38,10 @@
*/
public class JiraHelper
{
- private static final String PID = "?pid="; //MCHANGES-281 addd ?
+ private static final String PID = "?pid="; // MCHANGES-281 addd ?
/**
- * Parse out the base URL for JIRA and the JIRA project id from the issue
- * management URL.
+ * Parse out the base URL for JIRA and the JIRA project id from the issue management URL.
*
* @param issueManagementUrl The URL to the issue management system
* @return A <code>Map</code> containing the URL and project id
@@ -99,9 +98,9 @@
/**
* Try to get a JIRA pid from the issue management URL.
*
- * @param log Used to tell the user what happened
+ * @param log Used to tell the user what happened
* @param issueManagementUrl The URL to the issue management system
- * @param client The client used to connect to JIRA
+ * @param client The client used to connect to JIRA
* @return The JIRA id for the project, or null if it can't be found
*/
public static String getPidFromJira( Log log, String issueManagementUrl, HttpClient client )
@@ -148,10 +147,10 @@
/**
* Check if the specified host is in the list of non proxy hosts.
* <p/>
- * Method copied from org.apache.maven.wagon.proxy.ProxyUtils. Can be deleted when maven-changes-plugin
- * references a more recent version of maven-project
+ * Method copied from org.apache.maven.wagon.proxy.ProxyUtils. Can be deleted when maven-changes-plugin references a
+ * more recent version of maven-project
*
- * @param proxy the proxy info object contains set of properties.
+ * @param proxy the proxy info object contains set of properties.
* @param targetHost the target hostname
* @return true if the hostname is in the list of non proxy hosts, false otherwise.
*/
@@ -192,9 +191,8 @@
}
/**
- * Parse out the base URL for JIRA and the JIRA project name from the issue
- * management URL.
- * The issue management URL is assumed to be of the format http(s)://host:port/browse/{projectname}
+ * Parse out the base URL for JIRA and the JIRA project name from the issue management URL. The issue management URL
+ * is assumed to be of the format http(s)://host:port/browse/{projectname}
*
* @param issueManagementUrl The URL to the issue management system
* @return A <code>Map</code> containing the URL and project name
@@ -217,12 +215,12 @@
if ( indexProject != -1 )
{
- //Project name has trailing '/'
+ // Project name has trailing '/'
project = issueManagementUrl.substring( indexBrowseEnd, indexProject );
}
else
{
- //Project name without trailing '/'
+ // Project name without trailing '/'
project = issueManagementUrl.substring( indexBrowseEnd );
}
}
@@ -243,7 +241,7 @@
*/
public static String getBaseUrl( String url )
{
- int index = url.indexOf( "/", 8 ); //Ignore http:// or https://
+ int index = url.indexOf( "/", 8 ); // Ignore http:// or https://
return url.substring( 0, index );
}
}
diff --git a/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java b/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
index 41b0fe0..09ddcaf 100644
--- a/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
+++ b/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java
@@ -72,15 +72,12 @@
}
/**
- * Sets the names of the columns that you want in the report. The columns
- * will appear in the report in the same order as you specify them here.
- * Multiple values can be separated by commas.
+ * Sets the names of the columns that you want in the report. The columns will appear in the report in the same
+ * order as you specify them here. Multiple values can be separated by commas.
* <p>
- * Valid columns are: <code>Assignee</code>, <code>Component</code>,
- * <code>Created</code>, <code>Fix Version</code>, <code>Id</code>,
- * <code>Key</code>, <code>Priority</code>, <code>Reporter</code>,
- * <code>Resolution</code>, <code>Status</code>, <code>Summary</code>,
- * <code>Type</code>, <code>Updated</code> and <code>Version</code>.
+ * Valid columns are: <code>Assignee</code>, <code>Component</code>, <code>Created</code>, <code>Fix Version</code>,
+ * <code>Id</code>, <code>Key</code>, <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>,
+ * <code>Status</code>, <code>Summary</code>, <code>Type</code>, <code>Updated</code> and <code>Version</code>.
* </p>
*
* @since 2.0
@@ -89,9 +86,9 @@
private String columnNames;
/**
- * Use the JIRA query language instead of the JIRA query based on HTTP parameters.
- * From JIRA 5.1 and up only JQL is supported. JIRA 4.4 supports both JQL and URL parameter based queries.
- * From 5.1.1 this is obsolete, since REST queries only use JQL.
+ * Use the JIRA query language instead of the JIRA query based on HTTP parameters. From JIRA 5.1 and up only JQL is
+ * supported. JIRA 4.4 supports both JQL and URL parameter based queries. From 5.1.1 this is obsolete, since REST
+ * queries only use JQL.
*
* @since 2.8
*/
@@ -99,36 +96,33 @@
private boolean useJql;
/**
- * Since JIRA 5.1.1, it is no longer possible to construct a URL that downloads RSS. Meanwhile
- * JIRA added a REST API in 4.2. By default, this plugin uses the REST API if available.
- * Setting this parameter to true forces it to attempt to use RSS.
+ * Since JIRA 5.1.1, it is no longer possible to construct a URL that downloads RSS. Meanwhile JIRA added a REST API
+ * in 4.2. By default, this plugin uses the REST API if available. Setting this parameter to true forces it to
+ * attempt to use RSS.
*
* @since 2.9
*/
@Parameter( defaultValue = "false" )
private boolean forceRss;
-
+
/**
- * Sets the component(s) that you want to limit your report to include.
- * Multiple values can be separated by commas (such as 10011,10012).
- * If this is set to empty - that means all components will be included.
+ * Sets the component(s) that you want to limit your report to include. Multiple values can be separated by commas
+ * (such as 10011,10012). If this is set to empty - that means all components will be included.
*/
@Parameter( defaultValue = "" )
private String component;
/**
- * Defines the filter parameters to restrict which issues are retrieved
- * from JIRA. The filter parameter uses the same format of url
- * parameters that is used in a JIRA search.
+ * Defines the filter parameters to restrict which issues are retrieved from JIRA. The filter parameter uses the
+ * same format of url parameters that is used in a JIRA search.
*/
@Parameter( defaultValue = "" )
private String filter;
/**
- * Sets the fix version id(s) that you want to limit your report to include.
- * These are JIRA's internal version ids, <b>NOT</b> the human readable display ones.
- * Multiple fix versions can be separated by commas.
- * If this is set to empty - that means all fix versions will be included.
+ * Sets the fix version id(s) that you want to limit your report to include. These are JIRA's internal version ids,
+ * <b>NOT</b> the human readable display ones. Multiple fix versions can be separated by commas. If this is set to
+ * empty - that means all fix versions will be included.
*
* @since 2.0
*/
@@ -136,8 +130,7 @@
private String fixVersionIds;
/**
- * The pattern used by dates in the JIRA XML-file. This is used to parse
- * the Created and Updated fields.
+ * The pattern used by dates in the JIRA XML-file. This is used to parse the Created and Updated fields.
*
* @since 2.4
*/
@@ -169,9 +162,8 @@
private int maxEntries;
/**
- * If you only want to show issues for the current version in the report.
- * The current version being used is <code>${project.version}</code> minus
- * any "-SNAPSHOT" suffix.
+ * If you only want to show issues for the current version in the report. The current version being used is
+ * <code>${project.version}</code> minus any "-SNAPSHOT" suffix.
*
* @since 2.0
*/
@@ -179,24 +171,19 @@
private boolean onlyCurrentVersion;
/**
- * Sets the priority(s) that you want to limit your report to include.
- * Valid statuses are <code>Blocker</code>, <code>Critical</code>,
- * <code>Major</code>, <code>Minor</code> and <code>Trivial</code>.
- * Multiple values can be separated by commas.
- * If this is set to empty - that means all priorities will be included.
+ * Sets the priority(s) that you want to limit your report to include. Valid statuses are <code>Blocker</code>,
+ * <code>Critical</code>, <code>Major</code>, <code>Minor</code> and <code>Trivial</code>. Multiple values can be
+ * separated by commas. If this is set to empty - that means all priorities will be included.
*/
@Parameter( defaultValue = "" )
private String priorityIds;
/**
- * Sets the resolution(s) that you want to fetch from JIRA.
- * Valid resolutions are: <code>Unresolved</code>, <code>Fixed</code>,
- * <code>Won't Fix</code>, <code>Duplicate</code>, <code>Incomplete</code>
- * and <code>Cannot Reproduce</code>.
- * Multiple values can be separated by commas.
+ * Sets the resolution(s) that you want to fetch from JIRA. Valid resolutions are: <code>Unresolved</code>,
+ * <code>Fixed</code>, <code>Won't Fix</code>, <code>Duplicate</code>, <code>Incomplete</code> and
+ * <code>Cannot Reproduce</code>. Multiple values can be separated by commas.
* <p>
- * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no
- * default value.
+ * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no default value.
* </p>
*/
@Parameter( defaultValue = "Fixed" )
@@ -217,30 +204,22 @@
private boolean skip;
/**
- * Sets the column names that you want to sort the report by. Add
- * <code>DESC</code> following the column name
- * to specify <i>descending</i> sequence. For
- * example <code>Fix Version DESC, Type</code> sorts first by
- * the Fix Version in descending order and then by Type in
- * ascending order. By default sorting is done in ascending order, but is
- * possible to specify <code>ASC</code> for consistency. The previous
- * example would then become <code>Fix Version DESC, Type ASC</code>.
+ * Sets the column names that you want to sort the report by. Add <code>DESC</code> following the column name to
+ * specify <i>descending</i> sequence. For example <code>Fix Version DESC, Type</code> sorts first by the Fix
+ * Version in descending order and then by Type in ascending order. By default sorting is done in ascending order,
+ * but is possible to specify <code>ASC</code> for consistency. The previous example would then become
+ * <code>Fix Version DESC, Type ASC</code>.
* <p>
- * Valid columns are: <code>Assignee</code>, <code>Component</code>,
- * <code>Created</code>, <code>Fix Version</code>, <code>Id</code>,
- * <code>Key</code>, <code>Priority</code>, <code>Reporter</code>,
- * <code>Resolution</code>, <code>Status</code>, <code>Summary</code>,
- * <code>Type</code>, <code>Updated</code> and <code>Version</code>.
+ * Valid columns are: <code>Assignee</code>, <code>Component</code>, <code>Created</code>, <code>Fix Version</code>,
+ * <code>Id</code>, <code>Key</code>, <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>,
+ * <code>Status</code>, <code>Summary</code>, <code>Type</code>, <code>Updated</code> and <code>Version</code>.
* </p>
* <p>
- * <strong>Note:</strong> If you are using JIRA 4 you need to put your
- * sort column names in the reverse order. The handling of this changed
- * between JIRA 3 and JIRA 4. The current default value is suitable for
- * JIRA 3. This may change in the future, so please configure your sort
- * column names in an order that works for your own JIRA version. If you
- * use JQL, by setting the <code>useJql</code> parameter to
- * <code>true</code>, then the order of the fields are in normal order
- * again. Starting with JIRA 5.1 you have to use JQL.
+ * <strong>Note:</strong> If you are using JIRA 4 you need to put your sort column names in the reverse order. The
+ * handling of this changed between JIRA 3 and JIRA 4. The current default value is suitable for JIRA 3. This may
+ * change in the future, so please configure your sort column names in an order that works for your own JIRA
+ * version. If you use JQL, by setting the <code>useJql</code> parameter to <code>true</code>, then the order of the
+ * fields are in normal order again. Starting with JIRA 5.1 you have to use JQL.
* </p>
*
* @since 2.0
@@ -249,35 +228,27 @@
private String sortColumnNames;
/**
- * Sets the status(es) that you want to fetch from JIRA.
- * Valid statuses are: <code>Open</code>, <code>In Progress</code>,
- * <code>Reopened</code>, <code>Resolved</code> and <code>Closed</code>.
- * Multiple values can be separated by commas.
+ * Sets the status(es) that you want to fetch from JIRA. Valid statuses are: <code>Open</code>,
+ * <code>In Progress</code>, <code>Reopened</code>, <code>Resolved</code> and <code>Closed</code>. Multiple values
+ * can be separated by commas.
* <p>
- * If your installation of JIRA uses custom status IDs, you can reference
- * them here by their numeric values.
- * You can obtain them on the Statuses page
- * (in 4.0.2 it's under Administration > Issue Settings > Statuses)
- * - just hover over the Edit link for the status you want and
- * you'll see something like
- * <your JIRA URL>/secure/admin/EditStatus!default.jspa?id=12345;
- * in this case the value is 12345.
+ * If your installation of JIRA uses custom status IDs, you can reference them here by their numeric values. You can
+ * obtain them on the Statuses page (in 4.0.2 it's under Administration > Issue Settings > Statuses) - just hover
+ * over the Edit link for the status you want and you'll see something like <your JIRA
+ * URL>/secure/admin/EditStatus!default.jspa?id=12345; in this case the value is 12345.
* </p>
* <p>
- * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no
- * default value.
+ * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no default value.
* </p>
*/
@Parameter( defaultValue = "Closed" )
private String statusIds;
/**
- * Sets the types(s) that you want to limit your report to include.
- * Valid types are: <code>Bug</code>, <code>New Feature</code>,
- * <code>Task</code>, <code>Improvement</code>, <code>Wish</code>,
- * <code>Test</code> and <code>Sub-task</code>.
- * Multiple values can be separated by commas.
- * If this is set to empty - that means all types will be included.
+ * Sets the types(s) that you want to limit your report to include. Valid types are: <code>Bug</code>,
+ * <code>New Feature</code>, <code>Task</code>, <code>Improvement</code>, <code>Wish</code>, <code>Test</code> and
+ * <code>Sub-task</code>. Multiple values can be separated by commas. If this is set to empty - that means all types
+ * will be included.
*
* @since 2.0
*/
@@ -287,11 +258,9 @@
/**
* The prefix used when naming versions in JIRA.
* <p>
- * If you have a project in JIRA with several components that have different
- * release cycles, it is an often used pattern to prefix the version with
- * the name of the component, e.g. maven-filtering-1.0 etc. To fetch issues
- * from JIRA for a release of the "maven-filtering" component you would need
- * to set this parameter to "maven-filtering-".
+ * If you have a project in JIRA with several components that have different release cycles, it is an often used
+ * pattern to prefix the version with the name of the component, e.g. maven-filtering-1.0 etc. To fetch issues from
+ * JIRA for a release of the "maven-filtering" component you would need to set this parameter to "maven-filtering-".
* </p>
*
* @since 2.4
@@ -310,14 +279,14 @@
*/
@Parameter( defaultValue = "" )
private String webUser;
-
+
/*
* Used for tests.
*/
private AbstractJiraDownloader mockDownloader;
/* --------------------------------------------------------------------- */
- /* Public methods */
+ /* Public methods */
/* --------------------------------------------------------------------- */
/**
@@ -335,7 +304,7 @@
{
return false;
}
- if ( mockDownloader != null )
+ if ( mockDownloader != null )
{
return true;
}
@@ -350,8 +319,8 @@
if ( columnIds.isEmpty() )
{
// This can happen if the user has configured column names and they are all invalid
- throw new MavenReportException(
- "maven-changes-plugin: None of the configured columnNames '" + columnNames + "' are valid." );
+ throw new MavenReportException( "maven-changes-plugin: None of the configured columnNames '" + columnNames
+ + "' are valid." );
}
try
@@ -422,7 +391,7 @@
}
/* --------------------------------------------------------------------- */
- /* Private methods */
+ /* Private methods */
/* --------------------------------------------------------------------- */
private ResourceBundle getBundle( Locale locale )
@@ -469,9 +438,9 @@
issueDownloader.setSettings( settings );
issueDownloader.setUseJql( useJql );
-
+
issueDownloader.setOnlyCurrentVersion( onlyCurrentVersion );
-
+
issueDownloader.setVersionPrefix( versionPrefix );
}
diff --git a/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java b/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
index b75b314..b257d28 100644
--- a/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
+++ b/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
@@ -27,8 +27,7 @@
import java.util.Locale;
/**
- * Builder for a JIRA query using the JIRA query language.
- * Only a limited set of JQL is supported.
+ * Builder for a JIRA query using the JIRA query language. Only a limited set of JQL is supported.
*
* @author ton.swieb@finalist.com
* @version $Id$
@@ -38,6 +37,7 @@
implements JiraQueryBuilder
{
private String filter = "";
+
private boolean urlEncode = true;
/**
@@ -107,8 +107,8 @@
}
/**
- * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably
- * end up with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion
+ * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably end up
+ * with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion
*
* @param fixVersion a single fix version
* @return
@@ -120,8 +120,8 @@
}
/**
- * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably
- * end up with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion
+ * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably end up
+ * with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion
*
* @param fixVersionIds a comma-separated list of version ids.
* @return
@@ -134,6 +134,7 @@
/**
* Add a sequence of version IDs already in a list.
+ *
* @param fixVersionIds the version ids.
* @return
*/
@@ -208,7 +209,6 @@
return this;
}
-
public JiraQueryBuilder typeIds( String typeIds )
{
addCommaSeparatedValues( "type", typeIds );
@@ -233,7 +233,7 @@
}
/* --------------------------------------------------------------------- */
- /* Private methods */
+ /* Private methods */
/* --------------------------------------------------------------------- */
private void addCommaSeparatedValues( String key, String values )
@@ -275,7 +275,7 @@
trimAndQuoteValue( values.get( i ) );
query.append( ", " );
}
- trimAndQuoteValue( values.get ( values.size() - 1 ) );
+ trimAndQuoteValue( values.get( values.size() - 1 ) );
query.append( ")" );
}
}
diff --git a/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java b/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
index 57dc2ae..666a7e0 100644
--- a/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
+++ b/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java
@@ -37,16 +37,21 @@
implements JiraQueryBuilder
{
private String filter = "";
+
/** Log for debug output. */
private Log log;
+
private StringBuilder query = new StringBuilder();
/** Mapping containing all allowed JIRA priority values. */
private final Map<String, String> priorityMap = new HashMap<String, String>( 8 );
+
/** Mapping containing all allowed JIRA resolution values. */
private final Map<String, String> resolutionMap = new HashMap<String, String>( 8 );
+
/** Mapping containing all allowed JIRA status values. */
private final Map<String, String> statusMap = new HashMap<String, String>( 8 );
+
/** Mapping containing all allowed JIRA type values. */
private final Map<String, String> typeMap = new HashMap<String, String>( 8 );
@@ -320,16 +325,15 @@
else
{
// Error in the configuration
- getLog().error(
- "maven-changes-plugin: The configured value '" + lowerColumnName
- + "' for sortColumnNames is not correct." );
+ getLog().error( "maven-changes-plugin: The configured value '" + lowerColumnName
+ + "' for sortColumnNames is not correct." );
}
}
if ( validSortColumnNames == 0 )
{
// Error in the configuration
getLog().error( "maven-changes-plugin: None of the configured sortColumnNames '" + sortColumnNames
- + "' are correct." );
+ + "' are correct." );
}
}
return this;
diff --git a/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java b/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java
index 4609a9b..50292b8 100644
--- a/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java
+++ b/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java
@@ -52,23 +52,28 @@
import java.util.Map;
/**
- * Use the JIRA REST API to implement the download.
- *
- * This class assumes that the URL points to a copy of JIRA that implements the REST API.
- * A static function may be forthcoming in here to probe and see if a given URL supports it.
- *
+ * Use the JIRA REST API to implement the download. This class assumes that the URL points to a copy of JIRA that
+ * implements the REST API. A static function may be forthcoming in here to probe and see if a given URL supports it.
*/
-public class RestJiraDownloader extends AbstractJiraDownloader
+public class RestJiraDownloader
+ extends AbstractJiraDownloader
{
private List<Issue> issueList;
+
private JsonFactory jsonFactory;
+
private SimpleDateFormat dateFormat;
private List<String> resolvedFixVersionIds;
+
private List<String> resolvedStatusIds;
+
private List<String> resolvedComponentIds;
+
private List<String> resolvedTypeIds;
+
private List<String> resolvedResolutionIds;
+
private List<String> resolvedPriorityIds;
private String jiraProject;
@@ -79,10 +84,11 @@
public static class NoRest
extends Exception
{
- public NoRest( )
+ public NoRest()
{
// blank on purpose.
}
+
public NoRest( String message )
{
super( message );
@@ -91,15 +97,15 @@
public RestJiraDownloader()
{
- jsonFactory = new MappingJsonFactory( );
- //2012-07-17T06:26:47.723-0500
+ jsonFactory = new MappingJsonFactory();
+ // 2012-07-17T06:26:47.723-0500
dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" );
- resolvedFixVersionIds = new ArrayList<String>( );
- resolvedStatusIds = new ArrayList<String>( );
- resolvedComponentIds = new ArrayList<String>( );
- resolvedTypeIds = new ArrayList<String>( );
- resolvedResolutionIds = new ArrayList<String>( );
- resolvedPriorityIds = new ArrayList<String>( );
+ resolvedFixVersionIds = new ArrayList<String>();
+ resolvedStatusIds = new ArrayList<String>();
+ resolvedComponentIds = new ArrayList<String>();
+ resolvedTypeIds = new ArrayList<String>();
+ resolvedResolutionIds = new ArrayList<String>();
+ resolvedPriorityIds = new ArrayList<String>();
}
public void doExecute()
@@ -114,7 +120,7 @@
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
try
{
- Thread.currentThread().setContextClassLoader( WebClient.class.getClassLoader( ) );
+ Thread.currentThread().setContextClassLoader( WebClient.class.getClassLoader() );
WebClient client = setupWebClient( jiraUrl );
// We use version 2 of the REST API, that first appeared in JIRA 5
@@ -134,10 +140,10 @@
resolveIds( client, jiraProject );
- String jqlQuery = new JqlQueryBuilder( log ).urlEncode( false ).project( jiraProject ).fixVersion(
- getFixFor() ).fixVersionIds( resolvedFixVersionIds ).statusIds( resolvedStatusIds ).priorityIds(
- resolvedPriorityIds ).resolutionIds( resolvedResolutionIds ).components( resolvedComponentIds ).typeIds(
- resolvedTypeIds ).sortColumnNames( sortColumnNames ).build();
+ // CHECKSTYLE_OFF: LineLength
+ String jqlQuery =
+ new JqlQueryBuilder( log ).urlEncode( false ).project( jiraProject ).fixVersion( getFixFor() ).fixVersionIds( resolvedFixVersionIds ).statusIds( resolvedStatusIds ).priorityIds( resolvedPriorityIds ).resolutionIds( resolvedResolutionIds ).components( resolvedComponentIds ).typeIds( resolvedTypeIds ).sortColumnNames( sortColumnNames ).build();
+ // CHECKSTYLE_ON: LineLength
StringWriter searchParamStringWriter = new StringWriter();
JsonGenerator gen = jsonFactory.createGenerator( searchParamStringWriter );
@@ -188,7 +194,7 @@
JsonNode messages = errorTree.get( "errorMessages" );
if ( messages != null )
{
- for ( int mx = 0; mx < messages.size(); mx ++ )
+ for ( int mx = 0; mx < messages.size(); mx++ )
{
getLog().error( messages.get( mx ).asText() );
}
@@ -208,7 +214,7 @@
private void resolveIds( WebClient client, String jiraProject )
throws IOException, MojoExecutionException, MojoFailureException
{
- resolveList( resolvedComponentIds, client, "components", component, "/rest/api/2/project/{key}/components",
+ resolveList( resolvedComponentIds, client, "components", component, "/rest/api/2/project/{key}/components",
jiraProject );
resolveList( resolvedFixVersionIds, client, "fixVersions", fixVersionIds, "/rest/api/2/project/{key}/versions",
jiraProject );
@@ -220,7 +226,7 @@
private void resolveList( List<String> targetList, WebClient client, String what, String input,
String listRestUrlPattern, String... listUrlArgs )
- throws IOException, MojoExecutionException, MojoFailureException
+ throws IOException, MojoExecutionException, MojoFailureException
{
if ( input == null || input.length() == 0 )
{
@@ -254,7 +260,7 @@
private String resolveOneItem( JsonNode items, String what, String nameOrId )
throws IOException, MojoExecutionException, MojoFailureException
{
- for ( int cx = 0; cx < items.size(); cx ++ )
+ for ( int cx = 0; cx < items.size(); cx++ )
{
JsonNode item = items.get( cx );
if ( nameOrId.equals( item.get( "id" ).asText() ) )
@@ -271,13 +277,13 @@
private MediaType getResponseMediaType( Response response )
{
- String header = (String) response.getMetadata().getFirst( HttpHeaders.CONTENT_TYPE ) ;
+ String header = (String) response.getMetadata().getFirst( HttpHeaders.CONTENT_TYPE );
return header == null ? null : MediaType.valueOf( header );
}
private void buildIssues( JsonNode issuesNode, String jiraUrl, String jiraProject )
{
- issueList = new ArrayList<Issue>( );
+ issueList = new ArrayList<Issue>();
for ( int ix = 0; ix < issuesNode.size(); ix++ )
{
JsonNode issueNode = issuesNode.get( ix );
@@ -355,10 +361,10 @@
private void processVersions( Issue issue, JsonNode val )
{
- StringBuilder sb = new StringBuilder( );
+ StringBuilder sb = new StringBuilder();
if ( val != null )
{
- for ( int vx = 0; vx < val.size(); vx ++ )
+ for ( int vx = 0; vx < val.size(); vx++ )
{
sb.append( val.get( vx ).get( "name" ).asText() );
sb.append( ", " );
@@ -527,7 +533,7 @@
{
client.replacePath( "/rest/auth/1/session" );
client.type( MediaType.APPLICATION_JSON_TYPE );
- StringWriter jsWriter = new StringWriter( );
+ StringWriter jsWriter = new StringWriter();
JsonGenerator gen = jsonFactory.createGenerator( jsWriter );
gen.writeStartObject();
gen.writeStringField( "username", jiraUser );
@@ -560,8 +566,8 @@
if ( getLog().isDebugEnabled() )
{
- clientConfiguration.getInInterceptors().add( new LoggingInInterceptor( ) );
- clientConfiguration.getOutInterceptors().add( new LoggingOutInterceptor( ) );
+ clientConfiguration.getInInterceptors().add( new LoggingInInterceptor() );
+ clientConfiguration.getOutInterceptors().add( new LoggingOutInterceptor() );
}
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
@@ -605,7 +611,8 @@
return client;
}
- public List<Issue> getIssueList() throws MojoExecutionException
+ public List<Issue> getIssueList()
+ throws MojoExecutionException
{
return issueList;
}
diff --git a/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java b/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
index 0342118..a1681dd 100644
--- a/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
+++ b/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
@@ -29,6 +29,7 @@
public class UrlBuilder
{
private static final String AMPERSAND = "&";
+
private static final String QUESTION_MARK = "?";
private StringBuilder query = new StringBuilder();
diff --git a/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java b/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java
index 15c2be5..47583ec 100644
--- a/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java
+++ b/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java
@@ -48,9 +48,8 @@
private List<String> paths = null;
/**
- * Used to map the path that a template was found on
- * so that we can properly check the modification
- * times of the files.
+ * Used to map the path that a template was found on so that we can properly check the modification times of the
+ * files.
*/
private Hashtable<String, String> templatePaths = new Hashtable<String, String>();
@@ -64,11 +63,11 @@
+ "resources" + separator;
rsvc.getLog().info( "path :" + path );
-
+
paths = new ArrayList<String>();
paths.add( path );
-
+
for ( String path1 : paths )
{
rsvc.getLog().info( "ProjectResourceLoader : adding path '" + path1 + "'" );
@@ -77,13 +76,11 @@
}
/**
- * Get an InputStream so that the Runtime can build a
- * template with it.
+ * Get an InputStream so that the Runtime can build a template with it.
*
* @param templateName name of template to get
* @return InputStream containing the template
- * @throws ResourceNotFoundException if template not found
- * in the file template path.
+ * @throws ResourceNotFoundException if template not found in the file template path.
*/
public synchronized InputStream getResourceStream( String templateName )
throws ResourceNotFoundException
@@ -94,8 +91,7 @@
if ( templateName == null || templateName.length() == 0 )
{
/*
- * If we don't get a properly formed templateName then
- * there's not much we can do. So we'll forget about
+ * If we don't get a properly formed templateName then there's not much we can do. So we'll forget about
* trying to search any more paths for the template.
*/
throw new ResourceNotFoundException( "Need to specify a file name or file path!" );
@@ -113,13 +109,13 @@
}
/*
- * if a / leads off, then just nip that :)
+ * if a / leads off, then just nip that :)
*/
if ( template.startsWith( "/" ) )
{
template = template.substring( 1 );
}
-
+
// MCHANGES-118 adding the basedir path
paths.add( (String) rsvc.getApplicationAttribute( "baseDirectory" ) );
@@ -130,9 +126,7 @@
if ( inputStream != null )
{
/*
- * Store the path that this template came
- * from so that we can check its modification
- * time.
+ * Store the path that this template came from so that we can check its modification time.
*/
templatePaths.put( templateName, path );
@@ -141,9 +135,7 @@
}
/*
- * We have now searched all the paths for
- * templates and we didn't find anything so
- * throw an exception.
+ * We have now searched all the paths for templates and we didn't find anything so throw an exception.
*/
String msg = "ProjectResourceLoader Error: cannot find resource " + template;
@@ -155,14 +147,13 @@
*
* @param path a normalized path
* @return InputStream input stream that will be parsed
- *
*/
private InputStream findTemplate( String path, String template )
{
try
{
File file = new File( path, template );
-
+
if ( file.canRead() )
{
return new BufferedInputStream( new FileInputStream( file.getAbsolutePath() ) );
@@ -175,26 +166,22 @@
catch ( FileNotFoundException fnfe )
{
/*
- * log and convert to a general Velocity ResourceNotFoundException
+ * log and convert to a general Velocity ResourceNotFoundException
*/
return null;
}
}
/**
- * How to keep track of all the modified times
- * across the paths. Note that a file might have
- * appeared in a directory which is earlier in the
- * path; so we should search the path and see if
- * the file we find that way is the same as the one
- * that we have cached.
+ * How to keep track of all the modified times across the paths. Note that a file might have appeared in a directory
+ * which is earlier in the path; so we should search the path and see if the file we find that way is the same as
+ * the one that we have cached.
*/
public boolean isSourceModified( Resource resource )
{
/*
- * we assume that the file needs to be reloaded;
- * if we find the original file and it's unchanged,
- * then we'll flip this.
+ * we assume that the file needs to be reloaded; if we find the original file and it's unchanged, then we'll
+ * flip this.
*/
boolean modified = true;
@@ -215,21 +202,16 @@
if ( currentFile == null || !file.exists() )
{
/*
- * noop: if the file is missing now (either the cached
- * file is gone, or the file can no longer be found)
- * then we leave modified alone (it's set to true); a
- * reload attempt will be done, which will either use
- * a new template or fail with an appropriate message
- * about how the file couldn't be found.
+ * noop: if the file is missing now (either the cached file is gone, or the file can no longer be found)
+ * then we leave modified alone (it's set to true); a reload attempt will be done, which will either use a
+ * new template or fail with an appropriate message about how the file couldn't be found.
*/
}
else if ( currentFile.equals( file ) && file.canRead() )
{
/*
- * if only if currentFile is the same as file and
- * file.lastModified() is the same as
- * resource.getLastModified(), then we should use the
- * cached version.
+ * if only if currentFile is the same as file and file.lastModified() is the same as
+ * resource.getLastModified(), then we should use the cached version.
*/
modified = ( file.lastModified() != resource.getLastModified() );
}
diff --git a/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java b/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
index 49ecda0..a23662d 100644
--- a/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
+++ b/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java
@@ -49,10 +49,13 @@
{
/** The Maven project. */
private MavenProject project;
+
/** The Trac query for searching for tickets. */
private String query;
+
/** The password for authentication into a private Trac installation. */
private String tracPassword;
+
/** The username for authentication into a private Trac installation. */
private String tracUser;
@@ -93,7 +96,8 @@
return issue;
}
- public List<Issue> getIssueList() throws MalformedURLException, XmlRpcException
+ public List<Issue> getIssueList()
+ throws MalformedURLException, XmlRpcException
{
// Create and configure an XML-RPC client
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
@@ -123,7 +127,7 @@
qstr = query;
}
- Object[] params = new Object[] {qstr};
+ Object[] params = new Object[] { qstr };
Object[] queryResult;
ArrayList<Issue> issueList = new ArrayList<Issue>();
try
@@ -132,7 +136,7 @@
for ( Object aQueryResult : queryResult )
{
- params = new Object[]{aQueryResult};
+ params = new Object[] { aQueryResult };
Object[] ticketGetResult;
ticketGetResult = (Object[]) client.execute( "ticket.get", params );
issueList.add( createIssue( ticketGetResult ) );
diff --git a/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java b/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java
index 8f0688b..59c8fc4 100644
--- a/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java
+++ b/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java
@@ -31,7 +31,9 @@
extends AbstractIssueManagementSystem
{
private static final String DEFAULT_ADD_TYPE = "New Feature";
+
private static final String DEFAULT_FIX_TYPE = "Bug";
+
private static final String DEFAULT_UPDATE_TYPE = "Improvement";
public TracIssueManagmentSystem()
diff --git a/src/main/java/org/apache/maven/plugin/trac/TracMojo.java b/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
index 1bcbd94..8a93fb5 100644
--- a/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
+++ b/src/main/java/org/apache/maven/plugin/trac/TracMojo.java
@@ -28,6 +28,7 @@
import org.apache.maven.plugin.changes.AbstractChangesReport;
import org.apache.maven.plugin.changes.ProjectUtils;
+import org.apache.maven.plugin.issues.Issue;
import org.apache.maven.plugin.issues.IssuesReportGenerator;
import org.apache.maven.plugin.issues.IssuesReportHelper;
import org.apache.maven.plugins.annotations.Mojo;
@@ -36,8 +37,7 @@
import org.apache.xmlrpc.XmlRpcException;
/**
- * Goal which downloads issues from the Issue Tracking System and generates a
- * report.
+ * Goal which downloads issues from the Issue Tracking System and generates a report.
*
* @author Noriko Kinugasa
* @version $Id$
@@ -89,15 +89,12 @@
}
/**
- * Sets the column names that you want to show in the report. The columns
- * will appear in the report in the same order as you specify them here.
- * Multiple values can be separated by commas.
+ * Sets the column names that you want to show in the report. The columns will appear in the report in the same
+ * order as you specify them here. Multiple values can be separated by commas.
* <p>
- * Valid columns are: <code>Assignee</code>, <code>Component</code>,
- * <code>Created</code>, <code>Fix Version</code>, <code>Id</code>,
- * <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>,
- * <code>Status</code>, <code>Summary</code>, <code>Type</code> and
- * <code>Updated</code>.
+ * Valid columns are: <code>Assignee</code>, <code>Component</code>, <code>Created</code>, <code>Fix Version</code>,
+ * <code>Id</code>, <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>, <code>Status</code>,
+ * <code>Summary</code>, <code>Type</code> and <code>Updated</code>.
* </p>
*
* @since 2.2
@@ -112,21 +109,19 @@
private String query;
/**
- * Defines the Trac password for authentication into a private Trac
- * installation.
+ * Defines the Trac password for authentication into a private Trac installation.
*/
@Parameter( defaultValue = "" )
private String tracPassword;
/**
- * Defines the Trac username for authentication into a private Trac
- * installation.
+ * Defines the Trac username for authentication into a private Trac installation.
*/
@Parameter( defaultValue = "" )
private String tracUser;
/* --------------------------------------------------------------------- */
- /* Public methods */
+ /* Public methods */
/* --------------------------------------------------------------------- */
/**
@@ -147,13 +142,13 @@
throws MavenReportException
{
// Validate parameters
- List<Integer> columnIds = IssuesReportHelper.getColumnIds( columnNames, TRAC_COLUMNS, DEPRECATED_TRAC_COLUMNS,
- getLog() );
+ List<Integer> columnIds =
+ IssuesReportHelper.getColumnIds( columnNames, TRAC_COLUMNS, DEPRECATED_TRAC_COLUMNS, getLog() );
if ( columnIds.size() == 0 )
{
// This can happen if the user has configured column names and they are all invalid
- throw new MavenReportException(
- "maven-changes-plugin: None of the configured columnNames '" + columnNames + "' are valid." );
+ throw new MavenReportException( "maven-changes-plugin: None of the configured columnNames '" + columnNames
+ + "' are valid." );
}
try
@@ -162,7 +157,7 @@
TracDownloader issueDownloader = new TracDownloader();
configureIssueDownloader( issueDownloader );
- List issueList = issueDownloader.getIssueList();
+ List<Issue> issueList = issueDownloader.getIssueList();
// Generate the report
IssuesReportGenerator report = new IssuesReportGenerator( IssuesReportHelper.toIntArray( columnIds ) );
@@ -209,7 +204,7 @@
}
/* --------------------------------------------------------------------- */
- /* Private methods */
+ /* Private methods */
/* --------------------------------------------------------------------- */
private ResourceBundle getBundle( Locale locale )
diff --git a/src/main/mdo/changes.mdo b/src/main/mdo/changes.mdo
index 15e8063..f9b2487 100644
--- a/src/main/mdo/changes.mdo
+++ b/src/main/mdo/changes.mdo
@@ -152,12 +152,11 @@
<codeSegment>
<version>1.0.0</version>
<code><![CDATA[
- public java.util.List getActions(String type)
+ public java.util.List<Action> getActions(String type)
{
- java.util.List actions = new java.util.ArrayList();
- for (java.util.Iterator iterator = getActions().iterator(); iterator.hasNext(); )
+ java.util.List<Action> actions = new java.util.ArrayList<Action>();
+ for (Action action : getActions())
{
- Action action = (Action) iterator.next();
if ( action.getType() != null && action.getType().equalsIgnoreCase( type ) )
{
actions.add( action );
@@ -170,7 +169,7 @@
<codeSegment>
<version>1.0.0</version>
<code><![CDATA[
- private final java.util.List components = new java.util.ArrayList();
+ private final java.util.List<Component> components = new java.util.ArrayList<Component>();
public void addComponent(String name, Release release)
{
@@ -181,7 +180,7 @@
components.add(component);
}
- public java.util.List getComponents()
+ public java.util.List<Component> getComponents()
{
return components;
}
diff --git a/src/test/java/org/apache/maven/plugin/changes/ChangesCheckMojoTestCase.java b/src/test/java/org/apache/maven/plugin/changes/ChangesCheckMojoTestCase.java
index f26a4ea..b0ec627 100644
--- a/src/test/java/org/apache/maven/plugin/changes/ChangesCheckMojoTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/changes/ChangesCheckMojoTestCase.java
@@ -57,55 +57,57 @@
assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern ) );
}
- public void testIsValidateWithLocale() throws Exception {
- String pattern, locale = null;
+ public void testIsValidateWithLocale()
+ throws Exception
+ {
+ String pattern, locale = null;
- // null locale
- pattern = "yyyy-MM-dd";
- assertFalse(ChangesCheckMojo.isValidDate(null, pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("", pattern, locale));
- assertTrue(ChangesCheckMojo.isValidDate("2010-12-06", pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("pending", pattern, locale));
+ // null locale
+ pattern = "yyyy-MM-dd";
+ assertFalse( ChangesCheckMojo.isValidDate( null, pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "", pattern, locale ) );
+ assertTrue( ChangesCheckMojo.isValidDate( "2010-12-06", pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern, locale ) );
- // unknown locale specified, should use default locale
- locale = "ab_CD";
- assertFalse(ChangesCheckMojo.isValidDate(null, pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("", pattern, locale));
- assertTrue(ChangesCheckMojo.isValidDate("2010-12-06", pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("pending", pattern, locale));
+ // unknown locale specified, should use default locale
+ locale = "ab_CD";
+ assertFalse( ChangesCheckMojo.isValidDate( null, pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "", pattern, locale ) );
+ assertTrue( ChangesCheckMojo.isValidDate( "2010-12-06", pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern, locale ) );
- // pattern with months as number
- pattern = "yyyy-MM-dd";
+ // pattern with months as number
+ pattern = "yyyy-MM-dd";
- // Czech locale
- locale = "cs_CZ";
- assertFalse(ChangesCheckMojo.isValidDate(null, pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("", pattern, locale));
- assertTrue(ChangesCheckMojo.isValidDate("2010-12-06", pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("pending", pattern, locale));
+ // Czech locale
+ locale = "cs_CZ";
+ assertFalse( ChangesCheckMojo.isValidDate( null, pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "", pattern, locale ) );
+ assertTrue( ChangesCheckMojo.isValidDate( "2010-12-06", pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern, locale ) );
- // English locale
- locale = "en_US";
- assertFalse(ChangesCheckMojo.isValidDate(null, pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("", pattern, locale));
- assertTrue(ChangesCheckMojo.isValidDate("2010-12-06", pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("pending", pattern, locale));
+ // English locale
+ locale = "en_US";
+ assertFalse( ChangesCheckMojo.isValidDate( null, pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "", pattern, locale ) );
+ assertTrue( ChangesCheckMojo.isValidDate( "2010-12-06", pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern, locale ) );
- // pattern with months as text
- pattern = "dd MMM yyyy";
+ // pattern with months as text
+ pattern = "dd MMM yyyy";
- // Czech locale
- locale = "cs_CZ";
- assertFalse(ChangesCheckMojo.isValidDate(null, pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("", pattern, locale));
- assertTrue(ChangesCheckMojo.isValidDate("06 XII 2010", pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("pending", pattern, locale));
+ // Czech locale
+ locale = "cs_CZ";
+ assertFalse( ChangesCheckMojo.isValidDate( null, pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "", pattern, locale ) );
+ assertTrue( ChangesCheckMojo.isValidDate( "06 XII 2010", pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern, locale ) );
- // English locale
- locale = "en_US";
- assertFalse(ChangesCheckMojo.isValidDate(null, pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("", pattern, locale));
- assertTrue(ChangesCheckMojo.isValidDate("06 Dec 2010", pattern, locale));
- assertFalse(ChangesCheckMojo.isValidDate("pending", pattern, locale));
- }
+ // English locale
+ locale = "en_US";
+ assertFalse( ChangesCheckMojo.isValidDate( null, pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "", pattern, locale ) );
+ assertTrue( ChangesCheckMojo.isValidDate( "06 Dec 2010", pattern, locale ) );
+ assertFalse( ChangesCheckMojo.isValidDate( "pending", pattern, locale ) );
+ }
}
diff --git a/src/test/java/org/apache/maven/plugin/changes/ChangesValidatorMojoTest.java b/src/test/java/org/apache/maven/plugin/changes/ChangesValidatorMojoTest.java
index ab178bf..252f57a 100644
--- a/src/test/java/org/apache/maven/plugin/changes/ChangesValidatorMojoTest.java
+++ b/src/test/java/org/apache/maven/plugin/changes/ChangesValidatorMojoTest.java
@@ -24,8 +24,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-
-
/**
* @author Olivier Lamy
* @since 29 juil. 2008
@@ -43,8 +41,8 @@
super.setUp();
File pom = new File( getBasedir(), "/src/test/unit/plugin-config.xml" );
mojo = (ChangesValidatorMojo) lookupMojo( "changes-validate", pom );
- }
-
+ }
+
public void testValidationSuccess()
throws Exception
{
@@ -72,7 +70,7 @@
// we except exception here
}
}
-
+
public void testValidationFailedWithNoMojoFailure()
throws Exception
{
diff --git a/src/test/java/org/apache/maven/plugin/changes/ChangesXMLTest.java b/src/test/java/org/apache/maven/plugin/changes/ChangesXMLTest.java
index 978ddbc..eb3ce5a 100644
--- a/src/test/java/org/apache/maven/plugin/changes/ChangesXMLTest.java
+++ b/src/test/java/org/apache/maven/plugin/changes/ChangesXMLTest.java
@@ -140,9 +140,11 @@
List releases = changesXML.getReleaseList();
assertEquals( 2, releases.size() );
- for ( Object release1 : releases ) {
+ for ( Object release1 : releases )
+ {
Release release = (Release) release1;
- if ( "1.0".equals( release.getVersion() ) ) {
+ if ( "1.0".equals( release.getVersion() ) )
+ {
Action action = release.getActions().get( 0 );
assertEquals( 2, action.getFixedIssues().size() );
assertEquals( "JIRA-XXX", action.getFixedIssues().get( 0 ).getIssue() );
diff --git a/src/test/java/org/apache/maven/plugin/changes/FeedGeneratorTest.java b/src/test/java/org/apache/maven/plugin/changes/FeedGeneratorTest.java
index 3c12f7c..19be34b 100644
--- a/src/test/java/org/apache/maven/plugin/changes/FeedGeneratorTest.java
+++ b/src/test/java/org/apache/maven/plugin/changes/FeedGeneratorTest.java
@@ -32,7 +32,6 @@
import org.apache.maven.plugins.changes.model.Release;
/**
- *
* @author ltheussl
*/
public class FeedGeneratorTest
@@ -92,7 +91,7 @@
releases.add( release );
- for ( String type: generator.getSupportedFeedTypes() )
+ for ( String type : generator.getSupportedFeedTypes() )
{
Writer writer = new StringWriter( 512 );
generator.export( releases, type, writer );
diff --git a/src/test/java/org/apache/maven/plugin/changes/IssueAdapterTest.java b/src/test/java/org/apache/maven/plugin/changes/IssueAdapterTest.java
index d539f44..c224769 100644
--- a/src/test/java/org/apache/maven/plugin/changes/IssueAdapterTest.java
+++ b/src/test/java/org/apache/maven/plugin/changes/IssueAdapterTest.java
@@ -59,7 +59,7 @@
public void testCustomIssueTypeMappingOveridesDefaultMapping()
{
IssueManagementSystem ims = new JIRAIssueManagmentSystem();
-
+
ims.getIssueTypeMap().clear();
IssueAdapter adapter = new IssueAdapter( ims );
@@ -83,10 +83,10 @@
public void testCustomIssueTypeMapping()
{
IssueManagementSystem ims = new JIRAIssueManagmentSystem();
- ims.getIssueTypeMap().put( "Story", IssueType.ADD);
- ims.getIssueTypeMap().put( "Epic", IssueType.ADD);
- ims.getIssueTypeMap().put( "Defect", IssueType.FIX);
- ims.getIssueTypeMap().put( "Error", IssueType.FIX);
+ ims.getIssueTypeMap().put( "Story", IssueType.ADD );
+ ims.getIssueTypeMap().put( "Epic", IssueType.ADD );
+ ims.getIssueTypeMap().put( "Defect", IssueType.FIX );
+ ims.getIssueTypeMap().put( "Error", IssueType.FIX );
IssueAdapter adapter = new IssueAdapter( ims );
Issue issue = createIssue( "TST-1", "Story" );
diff --git a/src/test/java/org/apache/maven/plugin/changes/ReleaseUtilsTestCase.java b/src/test/java/org/apache/maven/plugin/changes/ReleaseUtilsTestCase.java
index b74afb0..f2f673d 100644
--- a/src/test/java/org/apache/maven/plugin/changes/ReleaseUtilsTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/changes/ReleaseUtilsTestCase.java
@@ -67,8 +67,8 @@
firstReleases.add( release );
mergedReleases = releaseUtils.mergeReleases( firstReleases, secondReleases );
- assertEquals( "Two releases in first, one release in second with one version being the same",
- 2, mergedReleases.size() );
+ assertEquals( "Two releases in first, one release in second with one version being the same", 2,
+ mergedReleases.size() );
release = new Release();
release.setVersion( "1.2" );
diff --git a/src/test/java/org/apache/maven/plugin/issues/IssueUtilsTestCase.java b/src/test/java/org/apache/maven/plugin/issues/IssueUtilsTestCase.java
index 544126b..431ae8c 100644
--- a/src/test/java/org/apache/maven/plugin/issues/IssueUtilsTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/issues/IssueUtilsTestCase.java
@@ -71,7 +71,7 @@
try
{
IssueUtils.filterIssuesWithVersionPrefix( issueList, "yourPrefix-" );
- fail("No issues should be found.");
+ fail( "No issues should be found." );
}
catch ( MojoExecutionException e )
{
diff --git a/src/test/java/org/apache/maven/plugin/jira/JiraHelperTestCase.java b/src/test/java/org/apache/maven/plugin/jira/JiraHelperTestCase.java
index 37bb0d0..38f1046 100644
--- a/src/test/java/org/apache/maven/plugin/jira/JiraHelperTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/jira/JiraHelperTestCase.java
@@ -35,7 +35,7 @@
{
public void testGetJiraUrlAndProjectId()
{
- Map<String,String> map;
+ Map<String, String> map;
map = JiraHelper.getJiraUrlAndProjectId( "http://jira.codehaus.org/browse/DOXIA" );
assertEquals( "http://jira.codehaus.org", map.get( "url" ) );
@@ -45,7 +45,8 @@
assertEquals( "http://jira.codehaus.org", map.get( "url" ) );
// MCHANGES-222
- map = JiraHelper.getJiraUrlAndProjectId( "http://jira.codehaus.org/secure/IssueNavigator.jspa?pid=11761&reset=true" );
+ map =
+ JiraHelper.getJiraUrlAndProjectId( "http://jira.codehaus.org/secure/IssueNavigator.jspa?pid=11761&reset=true" );
assertEquals( "http://jira.codehaus.org", map.get( "url" ) );
map = JiraHelper.getJiraUrlAndProjectId( "http://jira.codehaus.org/browse/MSHARED/component/13380" );
assertEquals( "http://jira.codehaus.org", map.get( "url" ) );
diff --git a/src/test/java/org/apache/maven/plugin/jira/JiraMojoTest.java b/src/test/java/org/apache/maven/plugin/jira/JiraMojoTest.java
index c992054..c2fbbf3 100644
--- a/src/test/java/org/apache/maven/plugin/jira/JiraMojoTest.java
+++ b/src/test/java/org/apache/maven/plugin/jira/JiraMojoTest.java
@@ -28,7 +28,8 @@
* @since 2.8
*/
-public class JiraMojoTest extends AbstractMojoTestCase
+public class JiraMojoTest
+ extends AbstractMojoTestCase
{
private final JiraMojo mojo = new JiraMojo();
@@ -37,7 +38,8 @@
*
* @throws Exception If any errors occur during the test run.
*/
- public void testCanGenerateReportSkipped() throws Exception
+ public void testCanGenerateReportSkipped()
+ throws Exception
{
setVariableValueToObject( mojo, "skip", Boolean.TRUE );
assertFalse( mojo.canGenerateReport() );
diff --git a/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java b/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java
index cb2affe..7f154ca 100644
--- a/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java
@@ -33,15 +33,15 @@
extends AbstractMojoTestCase
{
/*
- * Something in Doxia escapes all non-Ascii even when the charset is UTF-8.
- * This test will fail if that ever changes.
+ * Something in Doxia escapes all non-Ascii even when the charset is UTF-8. This test will fail if that ever
+ * changes.
*/
private final static String TEST_TURTLES = "海龟一路下跌。";
public void testUnicodeReport()
throws Exception
{
-
+
File pom = new File( getBasedir(), "/src/test/unit/jira-plugin-config.xml" );
assertNotNull( pom );
assertTrue( pom.exists() );
@@ -52,14 +52,13 @@
MockJiraDownloader mockDownloader = new MockJiraDownloader();
mockDownloader.setJiraXml( jiraXml );
mojo.setMockDownloader( mockDownloader );
- File outputDir = new File ( "target/jira-test-output" );
+ File outputDir = new File( "target/jira-test-output" );
outputDir.mkdirs();
mojo.setReportOutputDirectory( outputDir );
mojo.execute();
- String reportHtml = FileUtils.readFileToString( new File( outputDir, "jira-report.html" ),
- "utf-8" );
+ String reportHtml = FileUtils.readFileToString( new File( outputDir, "jira-report.html" ), "utf-8" );
int turtleIndex = reportHtml.indexOf( TEST_TURTLES );
- assertTrue ( turtleIndex >= 0 );
+ assertTrue( turtleIndex >= 0 );
}
}
diff --git a/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestProjectStub.java b/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestProjectStub.java
index b2418a1..7ec0d2d 100644
--- a/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestProjectStub.java
+++ b/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestProjectStub.java
@@ -38,8 +38,8 @@
@Override
public List<ArtifactRepository> getRemoteArtifactRepositories()
{
- ArtifactRepository repository = new DefaultArtifactRepository( "central", "http://repo1.maven.org/maven2",
- new DefaultRepositoryLayout() );
+ ArtifactRepository repository =
+ new DefaultArtifactRepository( "central", "http://repo1.maven.org/maven2", new DefaultRepositoryLayout() );
return Collections.singletonList( repository );
}
diff --git a/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTestCase.java b/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTestCase.java
index 177ac4c..6588b8a 100644
--- a/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTestCase.java
@@ -49,163 +49,116 @@
{
String expected = URLEncoder.encode( "project = DOXIA", ENCODING );
- String actual = createBuilder()
- .project( "DOXIA" )
- .build();
+ String actual = createBuilder().project( "DOXIA" ).build();
assertEquals( expected, actual );
}
public void testFixVersion()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "fixVersion = \"1.0\"",
- ENCODING );
+ String expected = URLEncoder.encode( "fixVersion = \"1.0\"", ENCODING );
- String actual = createBuilder()
- .fixVersion( "1.0" )
- .build();
+ String actual = createBuilder().fixVersion( "1.0" ).build();
assertEquals( expected, actual );
}
public void testFixVersionCombinedWithOtherParameters()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "project = DOXIA AND fixVersion = \"1.0\"",
- ENCODING );
+ String expected = URLEncoder.encode( "project = DOXIA AND fixVersion = \"1.0\"", ENCODING );
- String actual = createBuilder()
- .project( "DOXIA" )
- .fixVersion( "1.0" )
- .build();
+ String actual = createBuilder().project( "DOXIA" ).fixVersion( "1.0" ).build();
assertEquals( expected, actual );
}
public void testSingleParameterSingleValue()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "priority in (Blocker)",
- ENCODING );
+ String expected = URLEncoder.encode( "priority in (Blocker)", ENCODING );
- String actual = createBuilder()
- .priorityIds( "Blocker" )
- .build();
+ String actual = createBuilder().priorityIds( "Blocker" ).build();
assertEquals( expected, actual );
- actual = createBuilder()
- .priorityIds( " Blocker " )
- .build();
+ actual = createBuilder().priorityIds( " Blocker " ).build();
assertEquals( expected, actual );
}
public void testSingleParameterMultipleValues()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "priority in (Blocker, Critical, Major)",
- ENCODING );
+ String expected = URLEncoder.encode( "priority in (Blocker, Critical, Major)", ENCODING );
- String actual = createBuilder()
- .priorityIds( "Blocker,Critical,Major" )
- .build();
+ String actual = createBuilder().priorityIds( "Blocker,Critical,Major" ).build();
assertEquals( expected, actual );
- actual = createBuilder()
- .priorityIds( " Blocker , Critical, Major" )
- .build();
+ actual = createBuilder().priorityIds( " Blocker , Critical, Major" ).build();
assertEquals( expected, actual );
}
public void testMultipleParameterCombinedWithAND()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "priority in (Blocker) AND status in (Resolved)",
- ENCODING );
+ String expected = URLEncoder.encode( "priority in (Blocker) AND status in (Resolved)", ENCODING );
- String actual = createBuilder()
- .priorityIds( "Blocker" )
- .statusIds( "Resolved" )
- .build();
+ String actual = createBuilder().priorityIds( "Blocker" ).statusIds( "Resolved" ).build();
assertEquals( expected, actual );
}
public void testValueWithSpacesAreQuoted()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "status in (\"In Progress\")",
- ENCODING );
+ String expected = URLEncoder.encode( "status in (\"In Progress\")", ENCODING );
- String actual = createBuilder()
- .statusIds( "In Progress" )
- .build();
+ String actual = createBuilder().statusIds( "In Progress" ).build();
assertEquals( expected, actual );
}
public void testSortSingleRowAscending()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC",
- ENCODING );
+ String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC", ENCODING );
- String actual = createBuilder()
- .project( "DOXIA" )
- .sortColumnNames( "key" )
- .build();
+ String actual = createBuilder().project( "DOXIA" ).sortColumnNames( "key" ).build();
assertEquals( expected, actual );
- actual = createBuilder()
- .project( "DOXIA" )
- .sortColumnNames( "key ASC" )
- .build();
+ actual = createBuilder().project( "DOXIA" ).sortColumnNames( "key ASC" ).build();
assertEquals( expected, actual );
- actual = createBuilder()
- .project( "DOXIA" )
- .sortColumnNames( " key ASC " )
- .build();
+ actual = createBuilder().project( "DOXIA" ).sortColumnNames( " key ASC " ).build();
assertEquals( expected, actual );
}
public void testSortSingleDescending()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "project = DOXIA ORDER BY key DESC",
- ENCODING );
+ String expected = URLEncoder.encode( "project = DOXIA ORDER BY key DESC", ENCODING );
- String actual = createBuilder()
- .project( "DOXIA" )
- .sortColumnNames( "key DESC" )
- .build();
+ String actual = createBuilder().project( "DOXIA" ).sortColumnNames( "key DESC" ).build();
assertEquals( expected, actual );
- actual = createBuilder()
- .project( "DOXIA" )
- .sortColumnNames( " key DESC " )
- .build();
+ actual = createBuilder().project( "DOXIA" ).sortColumnNames( " key DESC " ).build();
assertEquals( expected, actual );
}
public void testSortMultipleColumns()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee DESC, reporter ASC",
- ENCODING );
+ String expected =
+ URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee DESC, reporter ASC", ENCODING );
- String actual = createBuilder()
- .project( "DOXIA" )
- .sortColumnNames( "key ASC,assignee DESC, reporter ASC" )
- .build();
+ String actual =
+ createBuilder().project( "DOXIA" ).sortColumnNames( "key ASC,assignee DESC, reporter ASC" ).build();
assertEquals( expected, actual );
}
public void testOrderByIsLastElement()
throws UnsupportedEncodingException
{
- String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee DESC, reporter ASC",
- ENCODING );
+ String expected =
+ URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee DESC, reporter ASC", ENCODING );
- String actual = createBuilder()
- .sortColumnNames( "key ASC,assignee DESC, reporter ASC" )
- .project( "DOXIA" )
- .build();
+ String actual =
+ createBuilder().sortColumnNames( "key ASC,assignee DESC, reporter ASC" ).project( "DOXIA" ).build();
assertEquals( expected, actual );
}
diff --git a/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTestCase.java b/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTestCase.java
index f3258ee..e257785 100644
--- a/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTestCase.java
+++ b/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTestCase.java
@@ -34,36 +34,30 @@
public void testUrlWithoutParameters()
{
String expected = "http://www.jira.com/context";
- String actual = new UrlBuilder( "http://www.jira.com", "context" )
- .build();
+ String actual = new UrlBuilder( "http://www.jira.com", "context" ).build();
assertEquals( expected, actual );
}
public void testUrlWithSingleParameter()
{
String expected = "http://www.jira.com/context?key1=value1";
- String actual = new UrlBuilder( "http://www.jira.com", "context" )
- .addParameter( "key1", "value1" )
- .build();
+ String actual = new UrlBuilder( "http://www.jira.com", "context" ).addParameter( "key1", "value1" ).build();
assertEquals( expected, actual );
}
public void testUrlWithMultipleParameters()
{
String expected = "http://www.jira.com/context?key1=value1&key2=value2";
- String actual = new UrlBuilder( "http://www.jira.com", "context" )
- .addParameter( "key1", "value1" )
- .addParameter( "key2", "value2" )
- .build();
+ String actual =
+ new UrlBuilder( "http://www.jira.com",
+ "context" ).addParameter( "key1", "value1" ).addParameter( "key2", "value2" ).build();
assertEquals( expected, actual );
}
public void testUrlWithIntParameter()
{
String expected = "http://www.jira.com/context?key1=1";
- String actual = new UrlBuilder( "http://www.jira.com", "context" )
- .addParameter( "key1", 1 )
- .build();
+ String actual = new UrlBuilder( "http://www.jira.com", "context" ).addParameter( "key1", 1 ).build();
assertEquals( expected, actual );
}
}