Source Code Cross Referenced for InputSimple.java in  » Code-Analyzer » checkstyle » com » puppycrawl » tools » checkstyle » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » checkstyle » com.puppycrawl.tools.checkstyle 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        ////////////////////////////////////////////////////////////////////////////////
002:        // Test case file for checkstyle.
003:        // Created: Feb-2001
004:        // Ignore error
005:        ////////////////////////////////////////////////////////////////////////////////
006:        package com.puppycrawl.tools.checkstyle;
007:
008:        import java.io.*;
009:
010:        /**
011:         * Contains simple mistakes:
012:         * - Long lines
013:         * - Tabs
014:         * - Format of variables and parameters
015:         * - Order of modifiers
016:         * @author Oliver Burn
017:         **/
018:        final class InputSimple {
019:            // Long line ----------------------------------------------------------------
020:            // Contains a tab ->	<-
021:            // Contains trailing whitespace ->
022:
023:            // Name format tests
024:            //
025:            /** Invalid format **/
026:            public static final int badConstant = 2;
027:            /** Valid format **/
028:            public static final int MAX_ROWS = 2;
029:
030:            /** Invalid format **/
031:            private static int badStatic = 2;
032:            /** Valid format **/
033:            private static int sNumCreated = 0;
034:
035:            /** Invalid format **/
036:            private int badMember = 2;
037:            /** Valid format **/
038:            private int mNumCreated1 = 0;
039:            /** Valid format **/
040:            protected int mNumCreated2 = 0;
041:
042:            /** commas are wrong **/
043:            private int[] mInts = new int[] { 1, 2, 3, 4 };
044:
045:            //
046:            // Accessor tests
047:            //
048:            /** should be private **/
049:            public static int sTest1;
050:            /** should be private **/
051:            protected static int sTest3;
052:            /** should be private **/
053:            static int sTest2;
054:
055:            /** should be private **/
056:            int mTest1;
057:            /** should be private **/
058:            public int mTest2;
059:
060:            //
061:            // Parameter name format tests
062:            //
063:
064:            /**
065:             * @return hack
066:             * @param badFormat1 bad format
067:             * @param badFormat2 bad format
068:             * @param badFormat3 bad format
069:             * @throws java.lang.Exception abc
070:             **/
071:            int test1(int badFormat1, int badFormat2, final int badFormat3)
072:                    throws java.lang.Exception {
073:                return 0;
074:            }
075:
076:            /** method that is 20 lines long **/
077:            private void longMethod() {
078:                // a line
079:                // a line
080:                // a line
081:                // a line
082:                // a line
083:                // a line
084:                // a line
085:                // a line
086:                // a line
087:                // a line
088:                // a line
089:                // a line
090:                // a line
091:                // a line
092:                // a line
093:                // a line
094:                // a line
095:                // a line
096:            }
097:
098:            /** constructor that is 10 lines long **/
099:            private InputSimple() {
100:                // a line
101:                // a line
102:                // a line
103:                // a line
104:                // a line
105:                // a line
106:                // a line
107:                // a line
108:            }
109:
110:            /** test local variables */
111:            private void localVariables() {
112:                // normal decl
113:                int abc = 0;
114:                int ABC = 0;
115:
116:                // final decls
117:                final int cde = 0;
118:                final int CDE = 0;
119:
120:                // decl in for loop init statement
121:                for (int k = 0; k < 1; k++) {
122:                    String innerBlockVariable = "";
123:                }
124:                for (int I = 0; I < 1; I++) {
125:                    String InnerBlockVariable = "";
126:                }
127:            }
128:
129:            /** test method pattern */
130:            void ALL_UPPERCASE_METHOD() {
131:            }
132:
133:            /** test illegal constant **/
134:            private static final int BAD__NAME = 3;
135:
136:            // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$"
137:            // long line that has a tab ->	<- and would be OK if tab counted as 1 char
138:            // tabs that count as one char because of their position ->	<-   ->	<-, OK
139:
140:            /** some lines to test the error column after tabs */
141:            void errorColumnAfterTabs() {
142:                // with tab-width 8 all statements below start at the same column,
143:                // with different combinations of ' ' and '\t' before the statement
144:                int tab0 = 1;
145:                int tab1 = 1;
146:                int tab2 = 1;
147:                int tab3 = 1;
148:                int tab4 = 1;
149:                int tab5 = 1;
150:            }
151:
152:            // FIXME:
153:            /* FIXME: a
154:             * FIXME:
155:             * TODO
156:             */
157:            /* NOTHING */
158:            /* YES *//* FIXME: x *//* YES!! */
159:
160:            /** test long comments **/
161:            void veryLong() {
162:                /*
163:                  blah blah blah blah
164:                  blah blah blah blah
165:                  blah blah blah blah
166:                  blah blah blah blah
167:                  blah blah blah blah
168:                  blah blah blah blah
169:                  blah blah blah blah
170:                  blah blah blah blah
171:                  blah blah blah blah
172:                  blah blah blah blah
173:                  blah blah blah blah
174:                  blah blah blah blah
175:                  blah blah blah blah
176:                  blah blah blah blah
177:                  blah blah blah blah
178:                  enough talk */
179:            }
180:
181:            /**
182:             * @see to lazy to document all args. Testing excessive # args
183:             **/
184:            void toManyArgs(int aArg1, int aArg2, int aArg3, int aArg4,
185:                    int aArg5, int aArg6, int aArg7, int aArg8, int aArg9) {
186:            }
187:        }
188:
189:        /** Test class for variable naming in for each clauses. */
190:        class InputSimple2 {
191:            /** Some more Javadoc. */
192:            public void doSomething() {
193:                //"O" should be named "o"
194:                for (Object O : new java.util.ArrayList()) {
195:
196:                }
197:            }
198:        }
199:
200:        /** Test enum for member naming check */
201:        enum MyEnum1 {
202:            /** ABC constant */
203:            ABC,
204:
205:            /** XYZ constant */
206:            XYZ;
207:
208:            /** Should be mSomeMemeber */
209:            private int someMember;
210:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.