Fix for rfe #843551 (Additional log call for Check API class)

This commit is contained in:
Oleg Sukhodolsky 2004-01-05 12:36:41 +00:00
parent d2fb67faae
commit 3396d43ff2
4 changed files with 42 additions and 13 deletions

View File

@ -82,6 +82,9 @@
<li class="body">Added NPathComplexity check from Simon
Harris (request 750757)</li>
<li class="body">Added several more log() method to
AbtractViolationReporter. (request 843551)</li>
</ul>
<p class="body">

View File

@ -116,6 +116,18 @@ public abstract class AbstractViolationReporter
log(aLineNo, aColNo, aKey, EMPTY_OBJECT_ARRAY);
}
/**
* Helper method to log a LocalizedMessage.
*
* @param aAST a node to get line and column numbers associated
* with the message
* @param aKey key to locale message format
*/
protected final void log(DetailAST aAST, String aKey)
{
log(aAST.getLineNo(), aAST.getColumnNo(), aKey);
}
/**
* Helper method to log a LocalizedMessage.
*
@ -130,6 +142,18 @@ public abstract class AbstractViolationReporter
log(aLineNo, aColNo, aKey, new Object[] {aArg0});
}
/**
* Helper method to log a LocalizedMessage.
*
* @param aAST a node to get line and column numbers associated
* with the message
* @param aKey key to locale message format
* @param aArg0 an <code>Object</code> value
*/
protected final void log(DetailAST aAST, String aKey, Object aArg0)
{
log(aAST.getLineNo(), aAST.getColumnNo(), aKey, aArg0);
}
/**
* Helper method to log a LocalizedMessage.
*
@ -145,6 +169,20 @@ public abstract class AbstractViolationReporter
log(aLineNo, aColNo, aKey, new Object[] {aArg0, aArg1});
}
/**
* Helper method to log a LocalizedMessage.
*
* @param aAST a node to get line and column numbers associated
* with the message
* @param aKey key to locale message format
* @param aArg0 an <code>Object</code> value
* @param aArg1 an <code>Object</code> value
*/
protected final void log(DetailAST aAST, String aKey,
Object aArg0, Object aArg1)
{
log(aAST.getLineNo(), aAST.getColumnNo(), aKey, aArg0, aArg1);
}
/**
* Returns the message bundle name resourcebundle that contains the messages

View File

@ -185,14 +185,4 @@ public class DeclarationOrderCheck extends Check
default:
}
}
/**
* Our own logging method
* @param aAST The AST to log
* @param aError The type of error to log
*/
private void log(DetailAST aAST, String aError)
{
log(aAST.getLineNo(), aAST.getColumnNo(), aError);
}
}

View File

@ -194,9 +194,7 @@ public abstract class AbstractComplexityCheck
private void leaveMethodDef(DetailAST aAST)
{
if (mCurrentValue > mMax) {
log(aAST.getLineNo(),
aAST.getColumnNo(),
getMessageID(),
log(aAST, getMessageID(),
new Integer(mCurrentValue),
new Integer(mMax));
}