KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hammurapi > inspectors > testcases > violations > NamingStandardRuleViolationTestCase


1 /*
2  * Hammurapi
3  * Automated Java code review system.
4  * Copyright (C) 2004 Hammurapi Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * URL: http://www.hammurapi.org
21  * e-Mail: support@hammurapi.biz
22 */

23 package org.hammurapi.inspectors.testcases.violations;
24
25 /**
26  * NamingStandardRule
27  * @author Pavel Vlasov
28  * @version $Revision: 1.1 $
29  */

30 public class NamingStandardRuleViolationTestCase {
31
32     private static org.apache.log4j.Logger logger =
33         org.apache.log4j.Logger.getRootLogger();
34
35     private class InnerClass1 {
36
37         // --- VIOLATION ---
38
private static final int attrFirst = INT_12;
39
40         boolean attrBoolean;
41     }
42
43     //--- VIOLATION ---
44
private class innerClass2 {
45         private static final int ATTRFIRST = INT_12;
46         boolean attrBoolean;
47     }
48
49     //--- VIOLATION ---
50
private class Inner_Class {
51
52         // --- VIOLATION ---
53
private static final int attrFirst = INT_12;
54
55         boolean attrBoolean;
56     }
57
58     private static final int INT_12 = 12;
59     private static final String JavaDoc ANATTRIBUTE = "ASDF";
60     public final String JavaDoc /** Java doc automaticaly generated by Hammurapi */
61     anAttribute = ANATTRIBUTE;
62     protected java.util.Date JavaDoc /** Java doc automaticaly generated by Hammurapi */
63     fromDate;
64
65     //--- VIOLATION ---
66
private static final String JavaDoc ANAtTRIBUTE2 = ANATTRIBUTE;
67
68     // --- VIOLATION ---
69
public final String JavaDoc /** Java doc automaticaly generated by Hammurapi */
70     AnAttribute2 = ANATTRIBUTE;
71
72     // --- VIOLATION ---
73
protected java.util.Date JavaDoc /** Java doc automaticaly generated by Hammurapi */
74     from_Date2;
75
76     void method1() {
77     }
78
79     //--- VIOLATION ---
80
void Method2() {
81     }
82
83     private static String JavaDoc methodToCall(final Integer JavaDoc parOne,
84         final String JavaDoc parTwo) {
85
86         // --- VIOLATION ---
87
String JavaDoc S = ANATTRIBUTE;
88
89         return S;
90     }
91
92     //--- VIOLATION ---
93
private static String JavaDoc methodToCall(final Long JavaDoc ParOne) {
94         String JavaDoc s = ANATTRIBUTE;
95         return s;
96     }
97
98     //--- VIOLATION ---
99
private static String JavaDoc methodToC_all(final Long JavaDoc parOne,
100         final String JavaDoc par_Two) {
101             
102         String JavaDoc s = ANATTRIBUTE;
103         return s;
104     }
105 }
106
107
Popular Tags