hide default constructor in FullIdent and make the class final.

Instances should only be created through the factory method
This commit is contained in:
Lars Kühne 2002-12-05 06:47:38 +00:00
parent ce9f55c439
commit 8970d00517
2 changed files with 7 additions and 5 deletions

View File

@ -31,10 +31,8 @@ package com.puppycrawl.tools.checkstyle.api;
*
* @author <a href="mailto:oliver@puppycrawl.com">Oliver Burn</a>
**/
public class FullIdent
public final class FullIdent
{
// TODO: We should hide public default constructor.
/** the string **/
private final StringBuffer mBuffer = new StringBuffer();
/** the line number **/
@ -42,6 +40,11 @@ public class FullIdent
/** the column number **/
private int mColNo;
/** hide default constructor */
private FullIdent()
{
}
/** @return the text **/
public String getText()
{
@ -112,7 +115,6 @@ public class FullIdent
*/
private static void extractFullIdent(FullIdent aFull, DetailAST aAST)
{
// A guard to be paranoid
if (aAST == null) {
return;
}

View File

@ -160,7 +160,7 @@ public class JavadocMethodCheck
/** @see com.puppycrawl.tools.checkstyle.api.Check */
public void beginTree()
{
mPackageFullIdent = new FullIdent();
mPackageFullIdent = FullIdent.createFullIdent(null);
mImports.clear();
}