Source Code Cross Referenced for InputTags.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: 2001
004:        ////////////////////////////////////////////////////////////////////////////////
005:        package com.puppycrawl.tools.checkstyle;
006:
007:        import java.io.IOException;
008:
009:        // Tests for Javadoc tags.
010:        class InputTags1 {
011:            // Invalid - should be Javadoc
012:            private int mMissingJavadoc;
013:
014:            // Invalid - should be Javadoc
015:            void method1() {
016:            }
017:
018:            /** @param unused asd **/
019:            void method2() {
020:            }
021:
022:            /** missing return **/
023:            int method3() {
024:                return 3;
025:            }
026:
027:            /**
028:             * missing return
029:             * @param aOne ignored
030:             **/
031:            int method4(int aOne) {
032:                return aOne;
033:            }
034:
035:            /** missing throws **/
036:            void method5() throws Exception {
037:            }
038:
039:            /**
040:             * @see missing throws
041:             * @see need to see tags to avoid shortcut logic
042:             **/
043:            void method6() throws Exception {
044:            }
045:
046:            /** @throws WrongException error **/
047:            void method7() throws Exception, NullPointerException {
048:            }
049:
050:            /** missing param **/
051:            void method8(int aOne) {
052:            }
053:
054:            /**
055:             * @see missing param
056:             * @see need to see tags to avoid shortcut logic
057:             **/
058:            void method9(int aOne) {
059:            }
060:
061:            /** @param WrongParam error **/
062:            void method10(int aOne, int aTwo) {
063:            }
064:
065:            /**
066:             * @param Unneeded parameter
067:             * @return also unneeded
068:             **/
069:            void method11() {
070:            }
071:
072:            /**
073:             * @return first one
074:             * @return duplicate
075:             **/
076:            int method12() {
077:                return 0;
078:            }
079:
080:            /**
081:             * @param aOne
082:             * @param aTwo
083:             *
084:             *     This is a multiline piece of javadoc
085:             *     Unlike the previous one, it actually has content
086:             * @param aThree
087:             *
088:             *
089:             *     This also has content
090:             * @param aFour
091:
092:             *
093:             * @param aFive
094:             **/
095:            void method13(int aOne, int aTwo, int aThree, int aFour, int aFive) {
096:            }
097:
098:            /** @param aOne Perfectly legal **/
099:            void method14(int aOne) {
100:            }
101:
102:            /** @throws java.io.IOException
103:             *               just to see if this is also legal **/
104:            void method14() throws java.io.IOException {
105:            }
106:
107:            // Test static initialiser
108:            static {
109:                int x = 1; // should not require any javadoc
110:            }
111:
112:            // test initialiser
113:            {
114:                int z = 2; // should not require any javadoc
115:            }
116:
117:            /** handle where variable declaration over several lines **/
118:            private static final int ON_SECOND_LINE = 2;
119:
120:            /**
121:             * Documenting different causes for the same exception
122:             * in separate tags is OK (bug 540384).
123:             *
124:             * @throws java.io.IOException if A happens
125:             * @throws java.io.IOException if B happens
126:             **/
127:            void method15() throws java.io.IOException {
128:            }
129:
130:            /** {@inheritDoc} **/
131:            public String toString() {
132:                return super .toString();
133:            }
134:
135:            /** getting code coverage up **/
136:            static final int serialVersionUID = 666;
137:
138:            //**********************************************************************/
139:            // Method Name: method16
140:            /**
141:             * handle the case of an elaborate header surrounding javadoc comments
142:             *
143:             * @param aOne valid parameter content
144:             */
145:            //**********************************************************************/
146:            void method16(int aOne) {
147:            }
148:
149:            /**
150:             * @throws ThreadDeath although bad practice, should be silently ignored
151:             * @throws ArrayStoreException another r/t subclass
152:             * @throws IllegalMonitorStateException should be told to remove from throws
153:             */
154:            void method17() throws IllegalMonitorStateException {
155:            }
156:
157:            /**
158:             * declaring the imported version of an Exception and documenting
159:             * the full class name is OK (bug 658805).
160:             * @throws java.io.IOException if bad things happen.
161:             */
162:            void method18() throws IOException {
163:                throw new IOException("to make compiler happy");
164:            }
165:
166:            /**
167:             * reverse of bug 658805.
168:             * @throws IOException if bad things happen.
169:             */
170:            void method19() throws java.io.IOException {
171:                throw new IOException("to make compiler happy");
172:            }
173:
174:            /**
175:             * Bug 579190, "expected return tag when one is there".
176:             *
177:             * Linebreaks after return tag should be legal.
178:             *
179:             * @return
180:             *   the bug that states that linebreak should be legal
181:             */
182:            int method20() {
183:                return 579190;
184:            }
185:
186:            /**
187:             * Bug XXX, "two tags for the same exception"
188:             *
189:             * @exception java.io.IOException for some reasons
190:             * @exception IOException for another reason
191:             */
192:            void method21() throws IOException {
193:            }
194:
195:            /**
196:             * RFE 540383, "Unused throws tag for exception subclass"
197:             *
198:             * @exception IOException for some reasons
199:             * @exception java.io.FileNotFoundException for another reasons
200:             */
201:            void method22() throws IOException {
202:            }
203:
204:            /**
205:             * @exception WrongException exception w/o class info but matched by name
206:             */
207:            void method23() throws WrongException {
208:            }
209:
210:            /**
211:             * Bug 803577, "allowThrowsTagsForSubclasses/allowMissingThrowsTag interfere"
212:             *
213:             * no exception tag for IOException, but here is a tag for its subclass.
214:             * @exception java.io.FileNotFoundException for another reasons
215:             */
216:            void method24() throws IOException {
217:            }
218:
219:            /**
220:             * Bug 841942, "ArrayIndexOutOfBounds in JavadocStyle".
221:             * @param aParam there is no such param in the method.
222:             * The problem should be reported with correct line number.
223:             */
224:
225:            void method25() {
226:            }
227:
228:            /** {@inheritDoc} */
229:            int method26() {
230:                return 0;
231:            }
232:
233:            /** 
234:             * {@inheritDoc}
235:             * @return something very important.
236:             */
237:            int method27(int aParam) {
238:                return 0;
239:            }
240:
241:            /** 
242:             * @return something very important.
243:             * {@inheritDoc}
244:             */
245:            int method28(int aParam) {
246:                return 0;
247:            }
248:
249:            /**
250:             * {@inheritDoc}
251:             *
252:             * @return 1
253:             */
254:            public int foo(Object _arg) {
255:
256:                return 1;
257:            }
258:        }
259:
260:        enum InputTagsEnum {
261:            CONSTANT_A,
262:
263:            /**
264:             *
265:             */
266:            CONSTANT_B,
267:
268:            CONSTANT_C {
269:                /**
270:                 *
271:                 */
272:                public void someMethod() {
273:                }
274:
275:                public void someOtherMethod() {
276:
277:                }
278:            }
279:        }
280:
281:        @interface InputTagsAnnotation {
282:            String someField();
283:
284:            int A_CONSTANT = 0;
285:            /** Some javadoc. */
286:            int B_CONSTANT = 1;
287:
288:            /** @return This tag is not valid here */
289:            String someField2();
290:        }
291:
292:        /**
293:         * Some javadoc.
294:         */
295:        public class InputTags {
296:
297:            /**
298:             * Constructor.
299:             */
300:            public InputTags() {
301:            }
302:
303:            /**
304:             * Sample method.
305:             * @param arg1   first argument
306:             * @param arg2   second argument
307:             * @return java.lang.String      the result string
308:             * @throws java.lang.Exception   in case of problem
309:             */
310:            public final String myMethod(final String arg1, final Object arg2)
311:                    throws Exception {
312:                return null;
313:            }
314:        }
315:
316:        /**
317:         *  Added to make this file compilable.
318:         */
319:        class WrongException extends RuntimeException {
320:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.