[ http://jira.codehaus.org/browse/MCHANGELOG-48?page=comments#action_74047
]
Giorgio Urto commented on MCHANGELOG-48:
----------------------------------------
I have a look at the source code of the class ChangeLogReport.
I believe that the problem is located in the method getAbsolutePath when it
test if ( baseToken.equals( targetRoot ) )
/**
* calculates the path from a base directory to a target file
*
* @param base base directory to create the absolute path from
* @param target target file to create the absolute path to
*/
private String getAbsolutePath( final String base, final String target )
{
String absPath = "";
StringTokenizer baseTokens = new StringTokenizer( base.replaceAll(
"\\\\", "/" ), "/", true );
StringTokenizer targetTokens = new StringTokenizer( target.replaceAll(
"\\\\", "/" ), "/" );
String targetRoot = targetTokens.nextToken();
while ( baseTokens.hasMoreTokens() )
{
String baseToken = baseTokens.nextToken();
if ( baseToken.equals( targetRoot ) )
{
break;
}
absPath += baseToken;
}
Is this correct?
However a code like the following is better, because in each iteration, the
String is converted to a StringBuffer, appended to, and converted back to a
String. This can lead to a cost quadratic in the number of iterations, as the
growing string is recopied in each iteration.
Better performance can be obtained by using a StringBuffer explicitly. (this
comment is taken from FindBugs)
StringBuffer buf = new StringBuffer();
for (int i = 0; i < field.length; ++i) {
buf.append(field[i]);
}
String s = buf.toString();
Thank You
Giorgio
> The link generated in the report contain only one occurrence if a duplicated
> word is used in the scm repository url.
> --------------------------------------------------------------------------------------------------------------------
>
> Key: MCHANGELOG-48
> URL: http://jira.codehaus.org/browse/MCHANGELOG-48
> Project: Maven 2.x Changelog Plugin
> Issue Type: Bug
> Affects Versions: 2.0-beta-1
> Reporter: Giorgio Urto
> Priority: Minor
>
> We have chose this svn repository layout
> <product>
> <component 1>
> .....
> <component n>
> where <product> is a svn repository, and <component 1..n > are directory
> having each one it's trunk, tags and branch.
> If the product have only one component, we have product and component with
> equals names.
> es: http://mysubversion/workarea/lgrefapp/lgrefapp/trunk
> where:
> - workarea is the root directory of all the products
> - the first occurrence of lgrefapp is the product
> - the second occurrence of lgrefapp is the component
>
> The link generated by changelog report contains only one occurrence of
> lgrefapp
> es: http://mysubversion/workarea/lgrefapp/trunk/.....
> So the links are broken.
> Thank you
> Giorgio
> Here are my configurations:
> <scm>
> <url>http://mysubversion/viewvc/lgrefapp/lgrefapp/trunk</url>
>
> <connection>scm:svn:http://mysubversion/workarea/lgrefapp/lgrefapp/trunk</connection>
> <developerConnection>scm:svn:http://[EMAIL
> PROTECTED]/workarea/lgrefapp/lgrefapp/trunk</developerConnection>
> </scm>
> <!-- CHANGELOG PLUGIN -->
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-changelog-plugin</artifactId>
> <version>2.0-SNAPSHOT</version>
> <reportSets>
> <reportSet>
> <id>dual-report</id>
> <configuration>
> <type>range</type>
> <range>365</range>
> <!--<dateFormat>dd-MM-yyyy</dateFormat>-->
>
> </configuration>
> <reports>
> <report>changelog</report>
> <report>file-activity</report>
> <report>dev-activity</report>
> </reports>
> </reportSet>
> </reportSets>
> </plugin>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira