Source Code Cross Referenced for InputHiddenField.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:        package com.puppycrawl.tools.checkstyle;
002:
003:        ////////////////////////////////////////////////////////////////////////////////
004:        // Test case file for checkstyle.
005:        // Created: 2002
006:        ////////////////////////////////////////////////////////////////////////////////
007:
008:        /**
009:         * Test case for hidden fields
010:         * @author Rick Giles
011:         **/
012:        class InputHiddenField {
013:            private int hidden = 0;
014:
015:            public InputHiddenField() {
016:                int hidden = 0; //shadows field
017:            }
018:
019:            public InputHiddenField(int hidden) //parameter shadows field
020:            {
021:            }
022:
023:            public void shadow() {
024:                int hidden = 0; //shadows field
025:            }
026:
027:            public void shadowFor() {
028:                for (int hidden = 0; hidden < 1; hidden++) { //shadows field
029:                }
030:            }
031:
032:            public void shadowParam(int hidden) //parameter shadows field
033:            {
034:            }
035:
036:            public class Inner {
037:                private int innerHidden = 0;
038:
039:                public Inner() {
040:                    int innerHidden = 0; //shadows field
041:                }
042:
043:                public Inner(int innerHidden) //shadows field
044:                {
045:                }
046:
047:                private void innerShadow() {
048:                    int innerHidden = 0; //shadows inner field
049:                    int hidden = 0; //shadows outer field
050:                }
051:
052:                private void innerShadowFor() {
053:                    for (int innerHidden = 0; innerHidden < 1; innerHidden++) {
054:                    }
055:                    //shadows outer field
056:                    for (int hidden = 0; hidden < 1; hidden++) {
057:                    }
058:                }
059:
060:                private void shadowParam(int innerHidden, //parameter shadows inner field
061:                        int hidden //parameter shadows outer field
062:                ) {
063:                }
064:
065:                {
066:                    int innerHidden = 0;//shadows inner field
067:                    int hidden = 0; //shadows outer field
068:                }
069:            }
070:
071:            {
072:                int hidden = 0;//shadows field
073:            }
074:        }
075:
076:        interface NothingHidden {
077:            public static int notHidden = 0;
078:
079:            // not an error
080:            public void noShadow(int notHidden);
081:        }
082:
083:        /** tests ignoring the parameter of a property setter method */
084:        class PropertySetter {
085:            private int prop;
086:
087:            /** setter */
088:            public void setProp(int prop) {
089:                this .prop = prop;
090:            }
091:
092:            /** error - incorrect method name */
093:            public void setprop(int prop) {
094:                this .prop = prop;
095:            }
096:
097:            /** error - more than one parameter */
098:            public void setProp(int prop, int extra) {
099:                this .prop = prop;
100:            }
101:        }
102:
103:        /** tests a non-void method */
104:        class PropertySetter2 {
105:            private int prop;
106:
107:            /** error - not a void method */
108:            public int setProp(int prop) {
109:                this .prop = prop;
110:                return 0;
111:            }
112:        }
113:
114:        /** tests for static fields */
115:        class StaticFields {
116:            private static int hidden;
117:
118:            public static void staticMethod() {
119:                int hidden;
120:            }
121:
122:            public void method() {
123:                int hidden;
124:            }
125:
126:            static {
127:                int hidden;
128:            }
129:
130:            {
131:                int hidden;
132:            }
133:        }
134:
135:        /** tests static methods & initializers */
136:        class StaticMethods {
137:            private int notHidden;
138:
139:            public static void method() {
140:                // local variables of static methods don't hide instance fields.
141:                int notHidden;
142:            }
143:
144:            static {
145:                // local variables of static initializers don't hide instance fields.
146:                int notHidden;
147:            }
148:
149:            private int x;
150:            private static int y;
151:
152:            static class Inner {
153:                void useX(int x) {
154:                    x++;
155:                }
156:
157:                void useY(int y) {
158:                    y++;
159:                }
160:            }
161:        }
162:
163:        enum HiddenEnum {
164:            A(129), B(283), C(1212) {
165:                /**
166:                 * Should not be flagged as error as we don't check
167:                 * hidden class level fields
168:                 */
169:                int hidden;
170:
171:                public void doSomething() {
172:                    //Should be flagged as hiding enum constant member
173:                    int hidden = 0;
174:                }
175:            };
176:
177:            int hidden;
178:            static int hiddenStatic;
179:
180:            /**
181:             * ctor parameter hides member
182:             */
183:            HiddenEnum(int hidden) {
184:            }
185:
186:            public void doSomething() {
187:                //Should be flagged as hiding static member
188:                int hidden = 0;
189:            }
190:
191:            public static void doSomethingStatic() {
192:                //Should be flagged as hiding static member
193:                int hiddenStatic = 0;
194:            }
195:        }
196:
197:        // we should ignore this if user wants (ignoreAbstractMethods is true)
198:        abstract class InputHiddenFieldBug1084512 {
199:            String x;
200:
201:            public abstract void methodA(String x);
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.