2 * Sonar, entreprise quality control tool.
\r
3 * Copyright (C) 2007-2008 Hortis-GRC SA
\r
4 * mailto:be_agile HAT hortis DOT ch
\r
6 * Sonar is free software; you can redistribute it and/or
\r
7 * modify it under the terms of the GNU Lesser General Public
\r
8 * License as published by the Free Software Foundation; either
\r
9 * version 3 of the License, or (at your option) any later version.
\r
11 * Sonar is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
14 * Lesser General Public License for more details.
\r
16 * You should have received a copy of the GNU Lesser General Public
\r
17 * License along with Sonar; if not, write to the Free Software
\r
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
\r
20 package org.sonar.samples.duplicated_lines_within_same_class;
\r
22 public class DuplicatedLinesInSameClass {
\r
24 public DuplicatedLinesInSameClass() {
\r
27 public void duplicatedMethodInSameClass1() {
\r
29 for (int i=0; i<10; i++){
\r
30 temp += "say something"+i;
\r
32 for (int i=0; i<20; i++){
\r
33 temp += "say nothing"+i;
\r
35 for (int i=0; i<30; i++){
\r
36 temp += "always say nothing"+i;
\r
38 for (int i=0; i<40; i++){
\r
39 temp += "really nothing to say "+i;
\r
41 for (int i=0; i<50; i++){
\r
42 temp += "really really nothing to say "+i;
\r
44 for (int i=0; i<60; i++){
\r
47 for (int i=0; i<70; i++){
\r
48 temp += "you say something? "+i;
\r
50 for (int i=0; i<80; i++){
\r
51 temp += "ah no..."+i;
\r
53 for (int i=0; i<90; i++){
\r
58 public void duplicatedMethodInSameClass2() {
\r
60 for (int i=0; i<10; i++){
\r
61 temp += "say something"+i;
\r
63 for (int i=0; i<20; i++){
\r
64 temp += "say nothing"+i;
\r
66 for (int i=0; i<30; i++){
\r
67 temp += "always say nothing"+i;
\r
69 for (int i=0; i<40; i++){
\r
70 temp += "really nothing to say "+i;
\r
72 for (int i=0; i<50; i++){
\r
73 temp += "really really nothing to say "+i;
\r
75 for (int i=0; i<60; i++){
\r
78 for (int i=0; i<70; i++){
\r
79 temp += "you say something? "+i;
\r
81 for (int i=0; i<80; i++){
\r
82 temp += "ah no..."+i;
\r
84 for (int i=0; i<90; i++){
\r