Fix for rfe #843551 (Additional log call for Check API class)
This commit is contained in:
parent
d2fb67faae
commit
3396d43ff2
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue