001: /*
002: * InputInalidMethodIndent.java
003: *
004: * Created on November 11, 2002, 10:14 PM
005: */
006:
007: package com.puppycrawl.tools.checkstyle.indentation;
008:
009: import java.util.Arrays;
010:
011: /**
012: *
013: * @author jrichard
014: */
015: public class InputInvalidMethodIndent {
016:
017: /** Creates a new instance of InputInalidMethodIndent */
018: public InputInvalidMethodIndent() {
019: }
020:
021: // ctor with rcurly on next line
022: public InputInvalidMethodIndent(int dummy) {
023: }
024:
025: // method with rcurly on same line
026: public void method() {
027: }
028:
029: // method with rcurly on next line
030: public void method2() {
031: }
032:
033: // method with a bunch of params
034: public int method2(int x, int y, int w, int h) {
035: return 1;
036: }
037:
038: // params on multiple lines
039: public void method2(int x, int y, int w, int h, int x1, int y1,
040: int w1, int h1) {
041: }
042:
043: // params on multiple lines
044: public void method3(int x, int y, int w, int h, int x1, int y1,
045: int w1, int h1) {
046: System.getProperty("foo");
047: }
048:
049: // params on multiple lines
050: public void method4(int x, int y, int w, int h, int x1, int y1,
051: int w1, int h1) {
052: boolean test = true;
053: if (test) {
054: System.getProperty("foo");
055: }
056: }
057:
058: public final void method5() {
059: boolean test = true;
060: if (test) {
061: System.getProperty("foo");
062: }
063: }
064:
065: public final void method6() {
066: boolean test = true;
067: if (test) {
068: System.getProperty("foo");
069: }
070: }
071:
072: public InputInvalidMethodIndent(int dummy, int dummy2) {
073: System.getProperty("foo");
074: }
075:
076: void method6a() {
077: boolean test = true;
078: if (test) {
079: System.getProperty("foo");
080: }
081:
082: System.out.println("methods are: "
083: + Arrays.asList(new String[] { "method" }).toString());
084:
085: System.out.println("methods are: "
086: + Arrays.asList(new String[] { "method" }).toString());
087:
088: System.out.println("methods are: "
089: + Arrays.asList(new String[] { "method" }).toString());
090:
091: System.out.println("methods are: "
092: + Arrays.asList(new String[] { "method" }).toString());
093:
094: String blah = (String) System.getProperty(new String("type"));
095:
096: String blah1 = (String) System.getProperty(new String("type"));
097:
098: System.out.println("methods are: "
099: + Arrays.asList(new String[] { "method" }).toString());
100: }
101:
102: private void myfunc2(int a, int b, int c, int d, int e, int f, int g) {
103: }
104:
105: private int myfunc3(int a, int b, int c, int d) {
106: return 1;
107: }
108:
109: private void myMethod() {
110: myfunc2(3, 4, 5, 6, 7, 8, 9);
111:
112: myfunc2(3, 4, method2(3, 4, 5, 6) + 5, 6, 7, 8, 9);
113:
114: // TODO: this is not illegal, but probably should be
115: // myfunc3(11, 11, Integer.
116: // getInteger("mytest").intValue(),
117: // 11);
118:
119: System.out.toString().equals("blah");
120:
121: }
122:
123: private void myFunc() throws Exception {
124: }
125:
126: void method7() {
127: // return incorrectly indented
128: return;
129: }
130:
131: void method8() {
132: // thow invorrectly indented
133: throw new RuntimeException("");
134: }
135:
136: public int[] method9() {
137: return null;
138: }
139: }
|