Context.java

Index Score
org.apache.catalina
Apache Tomcat

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
DECL_COMMENTSComments in declarations
DOC_COMMENTNumber of javadoc comment lines
COMMENTSComment lines
FUNCTIONSNumber of function declarations
JAVA0110JAVA0110 Incorrect javadoc: no @return tag
JAVA0141JAVA0141 Unnecessary modifier for method in interface
PARAMSNumber of formal parameter declarations
WHITESPACENumber of whitespace lines
LINESNumber of lines in the source file
SIZESize of the file in bytes
CYCLOMATICCyclomatic complexity
JAVA0034JAVA0034 Missing braces in if statement
INTERFACE_COMPLEXITYInterface complexity
UNIQUE_OPERANDSNumber of unique operands
JAVA0117JAVA0117 Missing javadoc: method 'method'
PROGRAM_VOLUMEHalstead program volume
JAVA0136JAVA0136 N methods defined in class (maximum: M)
PROGRAM_VOCABHalstead program vocabulary
EXEC_COMMENTSComments in executable code
JAVA0126JAVA0126 Method declares unchecked exception in throws
LINE_COMMENTNumber of line comments
COMPARISONSNumber of comparison operators
BLOCKSNumber of blocks
RETURNSNumber of return points from functions
LOOPSNumber of loops
EXITSProcedure exits
LOCLines of code
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0145JAVA0145 Tab character used in source file
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina; import javax.servlet.ServletContext; import org.apache.tomcat.util.http.mapper.Mapper; import org.apache.catalina.deploy.ApplicationParameter; import org.apache.catalina.deploy.ErrorPage; import org.apache.catalina.deploy.FilterDef; import org.apache.catalina.deploy.FilterMap; import org.apache.catalina.deploy.LoginConfig; import org.apache.catalina.deploy.NamingResources; import org.apache.catalina.deploy.SecurityConstraint; import org.apache.catalina.util.CharsetMapper; /** * A <b>Context</b> is a Container that represents a servlet context, and * therefore an individual web application, in the Catalina servlet engine. * It is therefore useful in almost every deployment of Catalina (even if a * Connector attached to a web server (such as Apache) uses the web server's * facilities to identify the appropriate Wrapper to handle this request. * It also provides a convenient mechanism to use Interceptors that see * every request processed by this particular web application. * <p> * The parent Container attached to a Context is generally a Host, but may * be some other implementation, or may be omitted if it is not necessary. * <p> * The child containers attached to a Context are generally implementations * of Wrapper (representing individual servlet definitions). * <p> * * @author Craig R. McClanahan * @version $Revision: 467222 $ $Date: 2006-10-23 23:17:11 -0400 (Mon, 23 Oct 2006) $ */ public interface Context extends Container { // ----------------------------------------------------- Manifest Constants /** * The LifecycleEvent type sent when a context is reloaded. */ public static final String RELOAD_EVENT = "reload"; // ------------------------------------------------------------- Properties /** * Return the set of initialized application event listener objects, * in the order they were specified in the web application deployment * descriptor, for this application. * * @exception IllegalStateException if this method is called before * this application has started, or after it has been stopped */ public Object[] getApplicationEventListeners(); /** * Store the set of initialized application event listener objects, * in the order they were specified in the web application deployment * descriptor, for this application. * * @param listeners The set of instantiated listener objects. */ public void setApplicationEventListeners(Object listeners[]); /** * Return the set of initialized application lifecycle listener objects, * in the order they were specified in the web application deployment * descriptor, for this application. * * @exception IllegalStateException if this method is called before * this application has started, or after it has been stopped */ public Object[] getApplicationLifecycleListeners(); /** * Store the set of initialized application lifecycle listener objects, * in the order they were specified in the web application deployment * descriptor, for this application. * * @param listeners The set of instantiated listener objects. */ public void setApplicationLifecycleListeners(Object listeners[]); /** * Return the application available flag for this Context. */ public boolean getAvailable(); /** * Set the application available flag for this Context. * * @param available The new application available flag */ public void setAvailable(boolean available); /** * Return the Locale to character set mapper for this Context. */ public CharsetMapper getCharsetMapper(); /** * Set the Locale to character set mapper for this Context. * * @param mapper The new mapper */ public void setCharsetMapper(CharsetMapper mapper); /** * Return the path to a file to save this Context information. */ public String getConfigFile(); /** * Set the path to a file to save this Context information. * * @param configFile The path to a file to save this Context information. */ public void setConfigFile(String configFile); /** * Return the "correctly configured" flag for this Context. */ public boolean getConfigured(); /** * Set the "correctly configured" flag for this Context. This can be * set to false by startup listeners that detect a fatal configuration * error to avoid the application from being made available. * * @param configured The new correctly configured flag */ public void setConfigured(boolean configured); /** * Return the "use cookies for session ids" flag. */ public boolean getCookies(); /** * Set the "use cookies for session ids" flag. * * @param cookies The new flag */ public void setCookies(boolean cookies); /** * Return the "allow crossing servlet contexts" flag. */ public boolean getCrossContext(); /** * Return the alternate Deployment Descriptor name. */ public String getAltDDName(); /** * Set an alternate Deployment Descriptor name. */ public void setAltDDName(String altDDName) ; /** * Set the "allow crossing servlet contexts" flag. * * @param crossContext The new cross contexts flag */ public void setCrossContext(boolean crossContext); /** * Return the display name of this web application. */ public String getDisplayName(); /** * Set the display name of this web application. * * @param displayName The new display name */ public void setDisplayName(String displayName); /** * Return the distributable flag for this web application. */ public boolean getDistributable(); /** * Set the distributable flag for this web application. * * @param distributable The new distributable flag */ public void setDistributable(boolean distributable); /** * Return the document root for this Context. This can be an absolute * pathname, a relative pathname, or a URL. */ public String getDocBase(); /** * Set the document root for this Context. This can be an absolute * pathname, a relative pathname, or a URL. * * @param docBase The new document root */ public void setDocBase(String docBase); /** * Return the URL encoded context path, using UTF-8. */ public String getEncodedPath(); /** * Return the boolean on the annotations parsing. */ public boolean getIgnoreAnnotations(); /** * Set the boolean on the annotations parsing for this web * application. * * @param ignoreAnnotations The boolean on the annotations parsing */ public void setIgnoreAnnotations(boolean ignoreAnnotations); /** * Return the login configuration descriptor for this web application. */ public LoginConfig getLoginConfig(); /** * Set the login configuration descriptor for this web application. * * @param config The new login configuration */ public void setLoginConfig(LoginConfig config); /** * Get the request dispatcher mapper. */ public Mapper getMapper(); /** * Return the naming resources associated with this web application. */ public NamingResources getNamingResources(); /** * Set the naming resources for this web application. * * @param namingResources The new naming resources */ public void setNamingResources(NamingResources namingResources); /** * Return the context path for this web application. */ public String getPath(); /** * Set the context path for this web application. * * @param path The new context path */ public void setPath(String path); /** * Return the public identifier of the deployment descriptor DTD that is * currently being parsed. */ public String getPublicId(); /** * Set the public identifier of the deployment descriptor DTD that is * currently being parsed. * * @param publicId The public identifier */ public void setPublicId(String publicId); /** * Return the reloadable flag for this web application. */ public boolean getReloadable(); /** * Set the reloadable flag for this web application. * * @param reloadable The new reloadable flag */ public void setReloadable(boolean reloadable); /** * Return the override flag for this web application. */ public boolean getOverride(); /** * Set the override flag for this web application. * * @param override The new override flag */ public void setOverride(boolean override); /** * Return the privileged flag for this web application. */ public boolean getPrivileged(); /** * Set the privileged flag for this web application. * * @param privileged The new privileged flag */ public void setPrivileged(boolean privileged); /** * Return the servlet context for which this Context is a facade. */ public ServletContext getServletContext(); /** * Return the default session timeout (in minutes) for this * web application. */ public int getSessionTimeout(); /** * Set the default session timeout (in minutes) for this * web application. * * @param timeout The new default session timeout */ public void setSessionTimeout(int timeout); /** * Return the value of the swallowOutput flag. */ public boolean getSwallowOutput(); /** * Set the value of the swallowOutput flag. If set to true, the system.out * and system.err will be redirected to the logger during a servlet * execution. * * @param swallowOutput The new value */ public void setSwallowOutput(boolean swallowOutput); /** * Return the Java class name of the Wrapper implementation used * for servlets registered in this Context. */ public String getWrapperClass(); /** * Set the Java class name of the Wrapper implementation used * for servlets registered in this Context. * * @param wrapperClass The new wrapper class */ public void setWrapperClass(String wrapperClass); // --------------------------------------------------------- Public Methods /** * Add a new Listener class name to the set of Listeners * configured for this application. * * @param listener Java class name of a listener class */ public void addApplicationListener(String listener); /** * Add a new application parameter for this application. * * @param parameter The new application parameter */ public void addApplicationParameter(ApplicationParameter parameter); /** * Add a security constraint to the set for this web application. */ public void addConstraint(SecurityConstraint constraint); /** * Add an error page for the specified error or Java exception. * * @param errorPage The error page definition to be added */ public void addErrorPage(ErrorPage errorPage); /** * Add a filter definition to this Context. * * @param filterDef The filter definition to be added */ public void addFilterDef(FilterDef filterDef); /** * Add a filter mapping to this Context. * * @param filterMap The filter mapping to be added */ public void addFilterMap(FilterMap filterMap); /** * Add the classname of an InstanceListener to be added to each * Wrapper appended to this Context. * * @param listener Java class name of an InstanceListener class */ public void addInstanceListener(String listener); /** * Add the given URL pattern as a jsp-property-group. This maps * resources that match the given pattern so they will be passed * to the JSP container. Though there are other elements in the * property group, we only care about the URL pattern here. The * JSP container will parse the rest. * * @param pattern URL pattern to be mapped */ public void addJspMapping(String pattern); /** * Add a Locale Encoding Mapping (see Sec 5.4 of Servlet spec 2.4) * * @param locale locale to map an encoding for * @param encoding encoding to be used for a give locale */ public void addLocaleEncodingMappingParameter(String locale, String encoding); /** * Add a new MIME mapping, replacing any existing mapping for * the specified extension. * * @param extension Filename extension being mapped * @param mimeType Corresponding MIME type */ public void addMimeMapping(String extension, String mimeType); /** * Add a new context initialization parameter, replacing any existing * value for the specified name. * * @param name Name of the new parameter * @param value Value of the new parameter */ public void addParameter(String name, String value); /** * Add a security role reference for this web application. * * @param role Security role used in the application * @param link Actual security role to check for */ public void addRoleMapping(String role, String link); /** * Add a new security role for this web application. * * @param role New security role */ public void addSecurityRole(String role); /** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute */ public void addServletMapping(String pattern, String name); /** * Add a JSP tag library for the specified URI. * * @param uri URI, relative to the web.xml file, of this tag library * @param location Location of the tag library descriptor */ public void addTaglib(String uri, String location); /** * Add a resource which will be watched for reloading by the host auto * deployer. Note: this will not be used in embedded mode. * * @param name Path to the resource, relative to docBase */ public void addWatchedResource(String name); /** * Add a new welcome file to the set recognized by this Context. * * @param name New welcome file name */ public void addWelcomeFile(String name); /** * Add the classname of a LifecycleListener to be added to each * Wrapper appended to this Context. * * @param listener Java class name of a LifecycleListener class */ public void addWrapperLifecycle(String listener); /** * Add the classname of a ContainerListener to be added to each * Wrapper appended to this Context. * * @param listener Java class name of a ContainerListener class */ public void addWrapperListener(String listener); /** * Factory method to create and return a new Wrapper instance, of * the Java implementation class appropriate for this Context * implementation. The constructor of the instantiated Wrapper * will have been called, but no properties will have been set. */ public Wrapper createWrapper(); /** * Return the set of application listener class names configured * for this application. */ public String[] findApplicationListeners(); /** * Return the set of application parameters for this application. */ public ApplicationParameter[] findApplicationParameters(); /** * Return the set of security constraints for this web application. * If there are none, a zero-length array is returned. */ public SecurityConstraint[] findConstraints(); /** * Return the error page entry for the specified HTTP error code, * if any; otherwise return <code>null</code>. * * @param errorCode Error code to look up */ public ErrorPage findErrorPage(int errorCode); /** * Return the error page entry for the specified Java exception type, * if any; otherwise return <code>null</code>. * * @param exceptionType Exception type to look up */ public ErrorPage findErrorPage(String exceptionType); /** * Return the set of defined error pages for all specified error codes * and exception types. */ public ErrorPage[] findErrorPages(); /** * Return the filter definition for the specified filter name, if any; * otherwise return <code>null</code>. * * @param filterName Filter name to look up */ public FilterDef findFilterDef(String filterName); /** * Return the set of defined filters for this Context. */ public FilterDef[] findFilterDefs(); /** * Return the set of filter mappings for this Context. */ public FilterMap[] findFilterMaps(); /** * Return the set of InstanceListener classes that will be added to * newly created Wrappers automatically. */ public String[] findInstanceListeners(); /** * Return the MIME type to which the specified extension is mapped, * if any; otherwise return <code>null</code>. * * @param extension Extension to map to a MIME type */ public String findMimeMapping(String extension); /** * Return the extensions for which MIME mappings are defined. If there * are none, a zero-length array is returned. */ public String[] findMimeMappings(); /** * Return the value for the specified context initialization * parameter name, if any; otherwise return <code>null</code>. * * @param name Name of the parameter to return */ public String findParameter(String name); /** * Return the names of all defined context initialization parameters * for this Context. If no parameters are defined, a zero-length * array is returned. */ public String[] findParameters(); /** * For the given security role (as used by an application), return the * corresponding role name (as defined by the underlying Realm) if there * is one. Otherwise, return the specified role unchanged. * * @param role Security role to map */ public String findRoleMapping(String role); /** * Return <code>true</code> if the specified security role is defined * for this application; otherwise return <code>false</code>. * * @param role Security role to verify */ public boolean findSecurityRole(String role); /** * Return the security roles defined for this application. If none * have been defined, a zero-length array is returned. */ public String[] findSecurityRoles(); /** * Return the servlet name mapped by the specified pattern (if any); * otherwise return <code>null</code>. * * @param pattern Pattern for which a mapping is requested */ public String findServletMapping(String pattern); /** * Return the patterns of all defined servlet mappings for this * Context. If no mappings are defined, a zero-length array is returned. */ public String[] findServletMappings(); /** * Return the context-relative URI of the error page for the specified * HTTP status code, if any; otherwise return <code>null</code>. * * @param status HTTP status code to look up */ public String findStatusPage(int status); /** * Return the set of HTTP status codes for which error pages have * been specified. If none are specified, a zero-length array * is returned. */ public int[] findStatusPages(); /** * Return the tag library descriptor location for the specified taglib * URI, if any; otherwise, return <code>null</code>. * * @param uri URI, relative to the web.xml file */ public String findTaglib(String uri); /** * Return the URIs of all tag libraries for which a tag library * descriptor location has been specified. If none are specified, * a zero-length array is returned. */ public String[] findTaglibs(); /** * Return the set of watched resources for this Context. If none are * defined, a zero length array will be returned. */ public String[] findWatchedResources(); /** * Return <code>true</code> if the specified welcome file is defined * for this Context; otherwise return <code>false</code>. * * @param name Welcome file to verify */ public boolean findWelcomeFile(String name); /** * Return the set of welcome files defined for this Context. If none are * defined, a zero-length array is returned. */ public String[] findWelcomeFiles(); /** * Return the set of LifecycleListener classes that will be added to * newly created Wrappers automatically. */ public String[] findWrapperLifecycles(); /** * Return the set of ContainerListener classes that will be added to * newly created Wrappers automatically. */ public String[] findWrapperListeners(); /** * Reload this web application, if reloading is supported. * * @exception IllegalStateException if the <code>reloadable</code> * property is set to <code>false</code>. */ public void reload(); /** * Remove the specified application listener class from the set of * listeners for this application. * * @param listener Java class name of the listener to be removed */ public void removeApplicationListener(String listener); /** * Remove the application parameter with the specified name from * the set for this application. * * @param name Name of the application parameter to remove */ public void removeApplicationParameter(String name); /** * Remove the specified security constraint from this web application. * * @param constraint Constraint to be removed */ public void removeConstraint(SecurityConstraint constraint); /** * Remove the error page for the specified error code or * Java language exception, if it exists; otherwise, no action is taken. * * @param errorPage The error page definition to be removed */ public void removeErrorPage(ErrorPage errorPage); /** * Remove the specified filter definition from this Context, if it exists; * otherwise, no action is taken. * * @param filterDef Filter definition to be removed */ public void removeFilterDef(FilterDef filterDef); /** * Remove a filter mapping from this Context. * * @param filterMap The filter mapping to be removed */ public void removeFilterMap(FilterMap filterMap); /** * Remove a class name from the set of InstanceListener classes that * will be added to newly created Wrappers. * * @param listener Class name of an InstanceListener class to be removed */ public void removeInstanceListener(String listener); /** * Remove the MIME mapping for the specified extension, if it exists; * otherwise, no action is taken. * * @param extension Extension to remove the mapping for */ public void removeMimeMapping(String extension); /** * Remove the context initialization parameter with the specified * name, if it exists; otherwise, no action is taken. * * @param name Name of the parameter to remove */ public void removeParameter(String name); /** * Remove any security role reference for the specified name * * @param role Security role (as used in the application) to remove */ public void removeRoleMapping(String role); /** * Remove any security role with the specified name. * * @param role Security role to remove */ public void removeSecurityRole(String role); /** * Remove any servlet mapping for the specified pattern, if it exists; * otherwise, no action is taken. * * @param pattern URL pattern of the mapping to remove */ public void removeServletMapping(String pattern); /** * Remove the tag library location forthe specified tag library URI. * * @param uri URI, relative to the web.xml file */ public void removeTaglib(String uri); /** * Remove the specified watched resource name from the list associated * with this Context. * * @param name Name of the watched resource to be removed */ public void removeWatchedResource(String name); /** * Remove the specified welcome file name from the list recognized * by this Context. * * @param name Name of the welcome file to be removed */ public void removeWelcomeFile(String name); /** * Remove a class name from the set of LifecycleListener classes that * will be added to newly created Wrappers. * * @param listener Class name of a LifecycleListener class to be removed */ public void removeWrapperLifecycle(String listener); /** * Remove a class name from the set of ContainerListener classes that * will be added to newly created Wrappers. * * @param listener Class name of a ContainerListener class to be removed */ public void removeWrapperListener(String listener); /** * Get the server.xml <context> attribute's xmlNamespaceAware. * @return true if namespace awarenes is enabled. * */ public boolean getXmlNamespaceAware(); /** * Get the server.xml <context> attribute's xmlValidation. * @return true if validation is enabled. * */ public boolean getXmlValidation(); /** * Set the validation feature of the XML parser used when * parsing xml instances. * @param xmlValidation true to enable xml instance validation */ public void setXmlValidation(boolean xmlValidation); /** * Set the namespace aware feature of the XML parser used when * parsing xml instances. * @param xmlNamespaceAware true to enable namespace awareness */ public void setXmlNamespaceAware(boolean xmlNamespaceAware); /** * Get the server.xml <context> attribute's xmlValidation. * @return true if validation is enabled. */ /** * Set the validation feature of the XML parser used when * parsing tlds files. * @param tldValidation true to enable xml instance validation */ public void setTldValidation(boolean tldValidation); /** * Get the server.xml <context> attribute's webXmlValidation. * @return true if validation is enabled. * */ public boolean getTldValidation(); /** * Get the server.xml <host> attribute's xmlNamespaceAware. * @return true if namespace awarenes is enabled. */ public boolean getTldNamespaceAware(); /** * Set the namespace aware feature of the XML parser used when * parsing xml instances. * @param tldNamespaceAware true to enable namespace awareness */ public void setTldNamespaceAware(boolean tldNamespaceAware); }

The table below shows all metrics for Context.java.

MetricValueDescription
BLOCKS 0.00Number of blocks
BLOCK_COMMENT16.00Number of block comment lines
COMMENTS657.00Comment lines
COMMENT_DENSITY 4.83Comment density
COMPARISONS 0.00Number of comparison operators
CYCLOMATIC123.00Cyclomatic complexity
DECL_COMMENTS130.00Comments in declarations
DOC_COMMENT638.00Number of javadoc comment lines
ELOC136.00Effective lines of code
EXEC_COMMENTS 0.00Comments in executable code
EXITS 0.00Procedure exits
FUNCTIONS123.00Number of function declarations
HALSTEAD_DIFFICULTY15.80Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY80.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 0.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 1.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 0.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 0.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 0.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 0.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 0.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 1.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 2.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA011055.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 0.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 0.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 0.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 0.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 1.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141123.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 0.00JAVA0144 Line exceeds maximum M characters
JAVA0145 0.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 0.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 0.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 0.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 0.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES1062.00Number of lines in the source file
LINE_COMMENT 3.00Number of line comments
LOC137.00Lines of code
LOGICAL_LINES135.00Number of statements
LOOPS 0.00Number of loops
NEST_DEPTH 0.00Maximum nesting depth
OPERANDS365.00Number of operands
OPERATORS713.00Number of operators
PARAMS80.00Number of formal parameter declarations
PROGRAM_LENGTH1078.00Halstead program length
PROGRAM_VOCAB251.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS 0.00Number of return points from functions
SIZE28648.00Size of the file in bytes
UNIQUE_OPERANDS231.00Number of unique operands
UNIQUE_OPERATORS20.00Number of unique operators
WHITESPACE268.00Number of whitespace lines