Reformatted to code style
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1517827 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java b/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java
index 20bd3fe..c57094a 100644
--- a/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java
+++ b/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java
@@ -235,19 +235,21 @@
*
* @since 2.3
*/
- @Parameter( property = "encodeFileUri", defaultValue = "false")
+ @Parameter( property = "encodeFileUri", defaultValue = "false" )
protected boolean encodeFileUri;
/**
* List of files to include. Specified as fileset patterns of files to include in the report
+ *
* @since 2.3
*/
@Parameter
private String[] includes;
/**
- * List of files to include. Specified as fileset patterns of files to omit in the report
- * @since 2.3
+ * List of files to include. Specified as fileset patterns of files to omit in the report
+ *
+ * @since 2.3
*/
@Parameter
private String[] excludes;
@@ -317,6 +319,7 @@
* value is a JIRA-style issue identification pattern.
* <p/>
* <strong>Note:</strong> Default value is [a-zA-Z]{2,}-\d+
+ *
* @since 2.2
*/
@Parameter( property = "issueIDRegexPattern", defaultValue = DEFAULT_ISSUE_ID_REGEX_PATTERN, required = true )
@@ -418,7 +421,9 @@
@Parameter
private Properties systemProperties;
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public void executeReport( Locale locale )
throws MavenReportException
{
@@ -436,12 +441,13 @@
{
String providerType = entry.getKey();
String providerImplementation = entry.getValue();
- getLog().info( "Change the default '" + providerType + "' provider implementation to '"
- + providerImplementation + "'." );
+ getLog().info(
+ "Change the default '" + providerType + "' provider implementation to '" + providerImplementation
+ + "'." );
manager.setScmProviderImplementation( providerType, providerImplementation );
}
}
-
+
initializeDefaultConfigurationParameters();
initializeDeveloperMaps();
@@ -527,7 +533,8 @@
getLog().info( "Using existing changelog.xml..." );
- changelogList = ChangeLog.loadChangedSets( ReaderFactory.newReader( outputXML, getOutputEncoding() ) );
+ changelogList =
+ ChangeLog.loadChangedSets( ReaderFactory.newReader( outputXML, getOutputEncoding() ) );
}
catch ( FileNotFoundException e )
{
@@ -606,7 +613,8 @@
//pw.flush();
//pw.close();
// MCHANGELOG-86
- Writer writer = WriterFactory.newWriter( new BufferedOutputStream( new FileOutputStream( outputXML ) ), getOutputEncoding() );
+ Writer writer = WriterFactory.newWriter( new BufferedOutputStream( new FileOutputStream( outputXML ) ),
+ getOutputEncoding() );
writer.write( changelogXml.toString() );
writer.flush();
writer.close();
@@ -715,7 +723,7 @@
{
throw new MavenReportException( "The type '" + type + "' isn't supported." );
}
- filter(changeSets);
+ filter( changeSets );
return changeSets;
}
@@ -732,82 +740,96 @@
/**
* filters out unwanted files from the changesets
*/
- private void filter(List<ChangeLogSet> changeSets)
+ private void filter( List<ChangeLogSet> changeSets )
{
- List<Pattern> include = compilePatterns(includes);
- List<Pattern> exclude = compilePatterns(excludes);
- if(includes==null && excludes==null)
+ List<Pattern> include = compilePatterns( includes );
+ List<Pattern> exclude = compilePatterns( excludes );
+ if ( includes == null && excludes == null )
+ {
return;
- for (ChangeLogSet changeLogSet : changeSets)
+ }
+ for ( ChangeLogSet changeLogSet : changeSets )
{
List<ChangeSet> set = changeLogSet.getChangeSets();
- filter(set, include, exclude);
+ filter( set, include, exclude );
}
}
- private List<Pattern> compilePatterns(String[] patternArray)
+ private List<Pattern> compilePatterns( String[] patternArray )
{
- if(patternArray==null)
+ if ( patternArray == null )
+ {
return new ArrayList<Pattern>();
- List<Pattern> patterns = new ArrayList<Pattern>(patternArray.length);
- for (String string : patternArray)
+ }
+ List<Pattern> patterns = new ArrayList<Pattern>( patternArray.length );
+ for ( String string : patternArray )
{
//replaces * with [/\]* (everything but file seperators)
//replaces ** with .*
//quotes the rest of the string
string = "\\Q" + string + "\\E";
- string = string.replace("**", "\\E.?REPLACEMENT?\\Q");
- string = string.replace("*", "\\E[^/\\\\]?REPLACEMENT?\\Q");
- string = string.replace("?REPLACEMENT?", "*");
- string = string.replace("\\Q\\E", "");
- patterns.add(Pattern.compile(string));
+ string = string.replace( "**", "\\E.?REPLACEMENT?\\Q" );
+ string = string.replace( "*", "\\E[^/\\\\]?REPLACEMENT?\\Q" );
+ string = string.replace( "?REPLACEMENT?", "*" );
+ string = string.replace( "\\Q\\E", "" );
+ patterns.add( Pattern.compile( string ) );
}
return patterns;
}
- private void filter(List<ChangeSet> sets, List<Pattern> includes, List<Pattern> excludes)
+ private void filter( List<ChangeSet> sets, List<Pattern> includes, List<Pattern> excludes )
{
Iterator<ChangeSet> it = sets.iterator();
- while (it.hasNext())
+ while ( it.hasNext() )
{
ChangeSet changeSet = it.next();
List<ChangeFile> files = changeSet.getFiles();
Iterator<ChangeFile> iterator = files.iterator();
- while (iterator.hasNext())
+ while ( iterator.hasNext() )
{
ChangeFile changeFile = iterator.next();
String name = changeFile.getName();
- if(!isIncluded(includes,name) || isExcluded(excludes, name))
+ if ( !isIncluded( includes, name ) || isExcluded( excludes, name ) )
{
iterator.remove();
}
}
- if(files.isEmpty())
+ if ( files.isEmpty() )
+ {
it.remove();
+ }
}
}
- private boolean isExcluded(List<Pattern> excludes, String name)
+ private boolean isExcluded( List<Pattern> excludes, String name )
{
- if(excludes==null || excludes.isEmpty())
- return false;
- for (Pattern pattern : excludes)
+ if ( excludes == null || excludes.isEmpty() )
{
- if(pattern.matcher(name).matches())
+ return false;
+ }
+ for ( Pattern pattern : excludes )
+ {
+ if ( pattern.matcher( name ).matches() )
+ {
return true;
+ }
}
return false;
}
- private boolean isIncluded(List<Pattern> includes, String name)
+ private boolean isIncluded( List<Pattern> includes, String name )
{
- if(includes==null || includes.isEmpty())
- return true;
- for (Pattern pattern : includes)
+ if ( includes == null || includes.isEmpty() )
{
- if(pattern.matcher(name).matches())
+ return true;
+ }
+ for ( Pattern pattern : includes )
+ {
+ if ( pattern.matcher( name ).matches() )
+ {
return true;
+ }
}
return false;
}
@@ -1020,9 +1042,8 @@
{
if ( dates == null )
{
- throw new MavenReportException(
- "The dates parameter is required when type=\"date\"."
- + " The value should be the absolute date for the start of the log." );
+ throw new MavenReportException( "The dates parameter is required when type=\"date\"."
+ + " The value should be the absolute date for the start of the log." );
}
}
else if ( "tag".equals( type ) )
@@ -1035,7 +1056,7 @@
else
{
throw new MavenReportException( "The type parameter has an invalid value: " + type
- + ". The value should be \"range\", \"date\", or \"tag\"." );
+ + ". The value should be \"range\", \"date\", or \"tag\"." );
}
}
@@ -1176,11 +1197,12 @@
else
{
sink.text( bundle.getString( "report.SetTagBetween" ) );
- sink.text( " '" + set.getStartVersion() + "' " + bundle.getString( "report.And" ) + " '"
- + set.getEndVersion() + "'" );
+ sink.text(
+ " '" + set.getStartVersion() + "' " + bundle.getString( "report.And" ) + " '" + set.getEndVersion()
+ + "'" );
}
}
- else if ( set.getStartDate() == null )
+ else if ( set.getStartDate() == null )
{
sink.text( bundle.getString( "report.SetRangeUnknown" ) );
}
@@ -1192,9 +1214,9 @@
else
{
sink.text( bundle.getString( "report.SetRangeBetween" ) );
- sink.text( " " + headingDateFormater.format( set.getStartDate() )
- + " " + bundle.getString( "report.And" ) + " "
- + headingDateFormater.format( set.getEndDate() ) );
+ sink.text(
+ " " + headingDateFormater.format( set.getStartDate() ) + " " + bundle.getString( "report.And" ) + " "
+ + headingDateFormater.format( set.getEndDate() ) );
}
sink.sectionTitle2_();
}
@@ -1334,8 +1356,8 @@
String line;
try
{
- if ( ( issueIDRegexPattern != null && issueIDRegexPattern.length() > 0 )
- && ( issueLinkUrl != null && issueLinkUrl.length() > 0 ) )
+ if ( ( issueIDRegexPattern != null && issueIDRegexPattern.length() > 0 ) && ( issueLinkUrl != null
+ && issueLinkUrl.length() > 0 ) )
{
Pattern pattern = Pattern.compile( issueIDRegexPattern );
@@ -1441,7 +1463,7 @@
* link to the team members report, or alternatively, if the supplied
* author is unknown, outputs the author's name as plain text.
*
- * @param sink Sink to use for outputting
+ * @param sink Sink to use for outputting
* @param author The author's name.
*/
protected void sinkAuthorDetails( Sink sink, String author )
@@ -1576,13 +1598,13 @@
if ( !linkFile.equals( scmUrl ) )
{
String linkName = name;
- if(encodeFileUri)
+ if ( encodeFileUri )
{
try
{
- linkName = URLEncoder.encode(linkName, "UTF-8");
+ linkName = URLEncoder.encode( linkName, "UTF-8" );
}
- catch (UnsupportedEncodingException e)
+ catch ( UnsupportedEncodingException e )
{
// UTF-8 is always supported
}
@@ -1604,7 +1626,7 @@
// Use the given URL to create links to the files
- if ( revision != null && linkFile.indexOf( REV_TOKEN ) > 0 )
+ if ( revision != null && linkFile.indexOf( REV_TOKEN ) > 0 )
{
linkFile = linkFile.replaceAll( REV_TOKEN, revision );
}
@@ -1753,13 +1775,17 @@
return absPath + newTarget;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected MavenProject getProject()
{
return project;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected String getOutputDirectory()
{
if ( !outputDirectory.isAbsolute() )
@@ -1780,25 +1806,33 @@
return ( outputEncoding != null ) ? outputEncoding : ReaderFactory.UTF_8;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected Renderer getSiteRenderer()
{
return siteRenderer;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public String getDescription( Locale locale )
{
return getBundle( locale ).getString( "report.changelog.description" );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public String getName( Locale locale )
{
return getBundle( locale ).getString( "report.changelog.name" );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public String getOutputName()
{
return "changelog";
@@ -1813,7 +1847,9 @@
return ResourceBundle.getBundle( "scm-activity", locale, this.getClass().getClassLoader() );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public boolean canGenerateReport()
{
if ( offline && !outputXML.exists() )