Skip to content

Commit

Permalink
Partial fix for checkstyle#47 - Add missing @OverRide annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
mkordas committed Dec 14, 2014
1 parent 4ee80e7 commit 6a6af7e
Show file tree
Hide file tree
Showing 51 changed files with 153 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/puppycrawl/tools/checkstyle/Checker.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ protected void fireAuditFinished()
* @param aFileName
* the file to be audited
*/
@Override
public void fireFileStarted(String aFileName)
{
final String stripped = getStrippedFileName(aFileName);
Expand All @@ -488,6 +489,7 @@ public void fireFileStarted(String aFileName)
* @param aFileName
* the audited file
*/
@Override
public void fireFileFinished(String aFileName)
{
final String stripped = getStrippedFileName(aFileName);
Expand All @@ -503,6 +505,7 @@ public void fireFileFinished(String aFileName)
* @param aFileName the audited file
* @param aErrors the audit errors from the file
*/
@Override
public void fireErrors(String aFileName,
SortedSet<LocalizedMessage> aErrors)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ public DefaultConfiguration(String aName)
}

/** {@inheritDoc} */
@Override
public String[] getAttributeNames()
{
final Set<String> keySet = mAttributeMap.keySet();
return keySet.toArray(new String[keySet.size()]);
}

/** {@inheritDoc} */
@Override
public String getAttribute(String aName) throws CheckstyleException
{
if (!mAttributeMap.containsKey(aName)) {
Expand All @@ -78,13 +80,15 @@ public String getAttribute(String aName) throws CheckstyleException
}

/** {@inheritDoc} */
@Override
public Configuration[] getChildren()
{
return mChildren.toArray(
new Configuration[mChildren.size()]);
}

/** {@inheritDoc} */
@Override
public String getName()
{
return mName;
Expand Down Expand Up @@ -139,6 +143,7 @@ public void addMessage(String aKey, String aValue)
* for this configuration.
* @return unmodifiable map containing custom messages
*/
@Override
public ImmutableMap<String, String> getMessages()
{
return ImmutableMap.copyOf(mMessages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ public final class DefaultContext implements Context
private final Map<String, Object> mEntries = Maps.newHashMap();

/** {@inheritDoc} */
@Override
public Object get(String aKey)
{
return mEntries.get(aKey);
}

/** {@inheritDoc} */
@Override
public ImmutableCollection<String> getAttributeNames()
{
return ImmutableList.copyOf(mEntries.keySet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public DefaultLogger(OutputStream aInfoStream,
* @param aEvt {@inheritDoc}
* @see AuditListener
**/
@Override
public void addError(AuditEvent aEvt)
{
final SeverityLevel severityLevel = aEvt.getSeverityLevel();
Expand Down Expand Up @@ -118,6 +119,7 @@ public void addError(AuditEvent aEvt)
}

/** {@inheritDoc} */
@Override
public void addException(AuditEvent aEvt, Throwable aThrowable)
{
synchronized (mErrorWriter) {
Expand All @@ -127,22 +129,26 @@ public void addException(AuditEvent aEvt, Throwable aThrowable)
}

/** {@inheritDoc} */
@Override
public void auditStarted(AuditEvent aEvt)
{
mInfoWriter.println("Starting audit...");
}

/** {@inheritDoc} */
@Override
public void fileFinished(AuditEvent aEvt)
{
}

/** {@inheritDoc} */
@Override
public void fileStarted(AuditEvent aEvt)
{
}

/** {@inheritDoc} */
@Override
public void auditFinished(AuditEvent aEvt)
{
mInfoWriter.println("Audit done.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ private Object createObject(String aClassName)
* @return the <code>Object</code> created by aLoader.
* @throws CheckstyleException if an error occurs.
*/
@Override
public Object createModule(String aName)
throws CheckstyleException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public PropertiesExpander(Properties aProperties)
}

/** {@inheritDoc} */
@Override
public String resolve(String aPropertyName)
{
return mProperties.getProperty(aPropertyName);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ private void setOutputStream(OutputStream aOS)
}

/** {@inheritDoc} */
@Override
public void auditStarted(AuditEvent aEvt)
{
mWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
Expand All @@ -100,6 +101,7 @@ public void auditStarted(AuditEvent aEvt)
}

/** {@inheritDoc} */
@Override
public void auditFinished(AuditEvent aEvt)
{
mWriter.println("</checkstyle>");
Expand All @@ -112,18 +114,21 @@ public void auditFinished(AuditEvent aEvt)
}

/** {@inheritDoc} */
@Override
public void fileStarted(AuditEvent aEvt)
{
mWriter.println("<file name=\"" + encode(aEvt.getFileName()) + "\">");
}

/** {@inheritDoc} */
@Override
public void fileFinished(AuditEvent aEvt)
{
mWriter.println("</file>");
}

/** {@inheritDoc} */
@Override
public void addError(AuditEvent aEvt)
{
if (!SeverityLevel.IGNORE.equals(aEvt.getSeverityLevel())) {
Expand All @@ -144,6 +149,7 @@ public void addError(AuditEvent aEvt)
}

/** {@inheritDoc} */
@Override
public void addException(AuditEvent aEvt, Throwable aThrowable)
{
final StringWriter sw = new StringWriter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,25 @@ public abstract class AbstractFileSetCheck
protected abstract void processFiltered(File aFile, List<String> aLines);

/** {@inheritDoc} */
@Override
public void init()
{
}

/** {@inheritDoc} */
@Override
public void destroy()
{
}

/** {@inheritDoc} */
@Override
public void beginProcessing(String aCharset)
{
}

/** {@inheritDoc} */
@Override
public final TreeSet<LocalizedMessage> process(File aFile,
List<String> aLines)
{
Expand All @@ -76,11 +80,13 @@ public final TreeSet<LocalizedMessage> process(File aFile,
}

/** {@inheritDoc} */
@Override
public void finishProcessing()
{
}

/** {@inheritDoc} */
@Override
public final void setMessageDispatcher(MessageDispatcher aDispatcher)
{
mDispatcher = aDispatcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private static BeanUtilsBean createBeanUtilsBean()
* @throws CheckstyleException {@inheritDoc}
* @see Configurable
*/
@Override
public final void configure(Configuration aConfiguration)
throws CheckstyleException
{
Expand Down Expand Up @@ -191,6 +192,7 @@ public final void configure(Configuration aConfiguration)
* @throws CheckstyleException {@inheritDoc}
* @see Contextualizable
*/
@Override
public final void contextualize(Context aContext)
throws CheckstyleException
{
Expand Down Expand Up @@ -273,6 +275,7 @@ protected void setupChild(Configuration aChildConf)
private static class RelaxedStringArrayConverter implements Converter
{
/** {@inheritDoc} */
@Override
public Object convert(@SuppressWarnings("rawtypes") Class aType,
Object aValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,42 @@ public Comment(final String[] aText, final int aFirstCol,
}

/** {@inheritDoc} */
@Override
public final String[] getText()
{
return mText.clone();
}

/** {@inheritDoc} */
@Override
public final int getStartLineNo()
{
return mFirstLine;
}

/** {@inheritDoc} */
@Override
public final int getEndLineNo()
{
return mLastLine;
}

/** {@inheritDoc} */
@Override
public int getStartColNo()
{
return mFirstCol;
}

/** {@inheritDoc} */
@Override
public int getEndColNo()
{
return mLastCol;
}

/** {@inheritDoc} */
@Override
public boolean intersects(int aStartLineNo, int aStartColNo,
int aEndLineNo, int aEndColNo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void clear()
* Returns an iterator that goes from the oldest element to the newest.
* @return an iterator
*/
@Override
public Iterator<E> iterator()
{
return mEntries.iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ public FileContents(FileText aText)
}

/** {@inheritDoc} */
@Override
public void reportSingleLineComment(String aType, int aStartLineNo,
int aStartColNo)
{
reportCppComment(aStartLineNo, aStartColNo);
}

/** {@inheritDoc} */
@Override
public void reportBlockComment(String aType, int aStartLineNo,
int aStartColNo, int aEndLineNo, int aEndColNo)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public boolean equals(Object aObject)
}

/** {@inheritDoc} */
@Override
public boolean accept(AuditEvent aEvent)
{
for (Filter filter : mFilters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public int getColumn()
}

/** {@inheritDoc} */
@Override
public int compareTo(LineColumn aLineColumn)
{
return (this.getLine() != aLineColumn.getLine())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ public static void setLocale(Locale aLocale)
////////////////////////////////////////////////////////////////////////////

/** {@inheritDoc} */
@Override
public int compareTo(LocalizedMessage aOther)
{
if (getLineNo() == aOther.getLineNo()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public SeverityLevelCounter(SeverityLevel aLevel)
}

/** {@inheritDoc} */
@Override
public void addError(AuditEvent aEvt)
{
if (mLevel.equals(aEvt.getSeverityLevel())) {
Expand All @@ -53,6 +54,7 @@ public void addError(AuditEvent aEvt)
}

/** {@inheritDoc} */
@Override
public void addException(AuditEvent aEvt, Throwable aThrowable)
{
if (SeverityLevel.ERROR.equals(mLevel)) {
Expand All @@ -61,22 +63,26 @@ public void addException(AuditEvent aEvt, Throwable aThrowable)
}

/** {@inheritDoc} */
@Override
public void auditStarted(AuditEvent aEvt)
{
mCount = 0;
}

/** {@inheritDoc} */
@Override
public void fileStarted(AuditEvent aEvt)
{
}

/** {@inheritDoc} */
@Override
public void auditFinished(AuditEvent aEvt)
{
}

/** {@inheritDoc} */
@Override
public void fileFinished(AuditEvent aEvt)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public CSVFilter(String aPattern)
* @param aInt the Integer to check.
* @return true if aInt is an Integer that matches a CSV value.
*/
@Override
public boolean accept(int aInt)
{
for (IntFilter filter : getFilters()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public IntMatchFilter(int aMatchValue)
}

/** {@inheritDoc} */
@Override
public boolean accept(int aInt)
{
return mMatchValue == aInt;
Expand Down
Loading

0 comments on commit 6a6af7e

Please sign in to comment.