com.jimischopp.checkstyle
Class ResourceUseFreedInFinallyCheck

java.lang.Object
  extended by com.puppycrawl.tools.checkstyle.api.AutomaticBean
      extended by com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
          extended by com.puppycrawl.tools.checkstyle.api.Check
              extended by com.jimischopp.checkstyle.AbstractBaseChecker
                  extended by com.jimischopp.checkstyle.ResourceUseFreedInFinallyCheck
All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable, com.puppycrawl.tools.checkstyle.api.Contextualizable

public class ResourceUseFreedInFinallyCheck
extends AbstractBaseChecker

Ensures that the GcQsQuerySystem objects are being used correctly. It checks for 4 things: 1) setConnection must be called before excute() 2) execute() must be called at least once 3) getResultSet() or getResults() must be called at least once 4) closeStatements() must be the last call on the object

Copyright 2003, James Schopp

Since:
Oct 27, 2003
Author:
James Schopp
See Also:
Check

Field Summary
 java.lang.String METH_CLOSESTATEMENTS
           
 java.lang.String METH_EXECUTE
           
 java.lang.String METH_GETRESULTSET1
           
 java.lang.String METH_GETRESULTSET2
           
 java.lang.String METH_SETCONNECTION
           
 
Constructor Summary
ResourceUseFreedInFinallyCheck()
           
 
Method Summary
 int[] getAcceptableTokens()
           
 int[] getDefaultTokens()
           
 int[] getRequiredTokens()
           
 void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
           
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check
beginTree, destroy, finishTree, getClassLoader, getFileContents, getLines, getTokenNames, init, leaveToken, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
getId, getSeverity, getSeverityLevel, setId, setSeverity
 
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METH_SETCONNECTION

public final java.lang.String METH_SETCONNECTION
See Also:
Constant Field Values

METH_EXECUTE

public final java.lang.String METH_EXECUTE
See Also:
Constant Field Values

METH_GETRESULTSET1

public final java.lang.String METH_GETRESULTSET1
See Also:
Constant Field Values

METH_GETRESULTSET2

public final java.lang.String METH_GETRESULTSET2
See Also:
Constant Field Values

METH_CLOSESTATEMENTS

public final java.lang.String METH_CLOSESTATEMENTS
See Also:
Constant Field Values
Constructor Detail

ResourceUseFreedInFinallyCheck

public ResourceUseFreedInFinallyCheck()
Method Detail

getDefaultTokens

public int[] getDefaultTokens()
Specified by:
getDefaultTokens in class com.puppycrawl.tools.checkstyle.api.Check

getAcceptableTokens

public int[] getAcceptableTokens()
Overrides:
getAcceptableTokens in class com.puppycrawl.tools.checkstyle.api.Check

getRequiredTokens

public int[] getRequiredTokens()
Overrides:
getRequiredTokens in class com.puppycrawl.tools.checkstyle.api.Check

visitToken

public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
Overrides:
visitToken in class com.puppycrawl.tools.checkstyle.api.Check