#103 Most recent tags in tag table may have invalid link

Latest CVS
John McCabe

With the -tags option, if the table shows tags that are included in the list of modifications for the most recent month, the link is invalid. For example, let's say the most recent month generated is May 2011. If I have a tag that was generated in May 2011 and I click on it the link takes me to:


However StatCVS doesn't create an HTML file of that name specifically for the most recent month; instead the most recent month's information is held in commitlog.html.

The code that's relevant to this is all in CommitLogPageMaker.java. Internally there are 2 getFileName() methods; on is private to the class (with no parameters) and the other is a private static method with a year and month parameter.

The tag anchor links are generated by calling the CommitLogPageMaker.getURL() static method, which calls the static getFileName(year, date) method so returns e.g. 2011-05.html for the most recent tags. However that is the wrong file name for the first log.

CommitLogPageMaker internally uses this.firstLogPage to differentiate between a page name of the form <year>-<month>.html or commitlog.html (in private String CommitLogPageMaker.getFileName()).

The CommitLogPageMaker class is only instantiated in CommitLogPageGroupMaker.getPages(). This method defines "boolean firstPage = true;" before entering a loop that repeatedly instantiates the CommitLogPageMaker class. On the first instantiation firstPage is true but following that firstPage is always set to false and, when the scope of this method is left, firstPage no longer exists.

As such I can't see that there would be any side-effects from removing firstPage from CommitLogGroupMaker.getPages() and removing the use of firstLogPage in CommitLogPageMaker.


  • John McCabe
    John McCabe

    Suggested changes to the two classes mentioned in the problem description.