diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-04 10:42:21 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-04 10:42:21 +0100 |
commit | a14a0644c2a27ddec22f23925578a40aa6fa8302 (patch) | |
tree | aa5c078cc8ec7c4e2020960ad9a343fb7e79a16c /sonar-deprecated/src | |
parent | 0f44a42b85093a3dcef64b52f6e15337b119ec88 (diff) | |
download | sonarqube-a14a0644c2a27ddec22f23925578a40aa6fa8302.tar.gz sonarqube-a14a0644c2a27ddec22f23925578a40aa6fa8302.zip |
Upgrade copyright headers
Diffstat (limited to 'sonar-deprecated/src')
65 files changed, 406 insertions, 406 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractPurge.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractPurge.java index f4218432165..2be04e25f1f 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractPurge.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractPurge.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java index 0bd135f6225..2973ea05320 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/GeneratesViolations.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/GeneratesViolations.java index 9d6739b8aeb..cd20e179946 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/batch/GeneratesViolations.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/GeneratesViolations.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/Purge.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/Purge.java index b3562281dff..803fbcdb98c 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/batch/Purge.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/Purge.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/PurgeContext.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/PurgeContext.java index 92a1f1f2e8e..2423f51b8e6 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/batch/PurgeContext.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/PurgeContext.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/SquidSearch.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/SquidSearch.java index 12902792d60..71c871818f1 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/batch/SquidSearch.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/SquidSearch.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/AnnotationCheckerFactory.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/AnnotationCheckerFactory.java index 9f8574d9e83..78b36dfa0a8 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/AnnotationCheckerFactory.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/AnnotationCheckerFactory.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/CheckerFactory.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/CheckerFactory.java index de0a12a738c..1c28fca8493 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/CheckerFactory.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/CheckerFactory.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java index 5885b2f5035..242693eb485 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/UnvalidCheckerException.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/UnvalidCheckerException.java index 0c98a1fece3..b89ec23ebc6 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/UnvalidCheckerException.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/UnvalidCheckerException.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactory.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactory.java index e5084965d42..ee849c50180 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactory.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactory.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/Check.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/Check.java index b33c3a11ddc..45e5b5e9f08 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/Check.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/Check.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfile.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfile.java index 2a47f800bdc..58268e5167b 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfile.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfile.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileProvider.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileProvider.java index 0482cf447fd..7f893ff5b7b 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileProvider.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileProvider.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshaller.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshaller.java index 4e7d359643a..3502c5ed307 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshaller.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshaller.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactory.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactory.java index 08d21bb6fe3..74de09d275b 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactory.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactory.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplate.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplate.java index e54554b84cc..55a5e11dd96 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplate.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplate.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplateProperty.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplateProperty.java index ac1ebf6795a..6c87a39200b 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplateProperty.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/BundleCheckTemplateProperty.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplate.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplate.java index a6df4a7e73f..313e64a4c80 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplate.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplate.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateFactory.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateFactory.java index d72dc1db31c..7f1aa486db3 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateFactory.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateFactory.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateProperty.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateProperty.java index 34dce342635..b94082d9c7c 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateProperty.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateProperty.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepositories.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepositories.java index 6a159a9bd27..4cc5029413d 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepositories.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepositories.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepository.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepository.java index eade8969a01..3ce30317cb2 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepository.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/CheckTemplateRepository.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplate.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplate.java index 76f6fb6ca4e..e1fa871fdd2 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplate.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplate.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplateProperty.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplateProperty.java index 142942b8ced..06f9e2eb648 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplateProperty.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/DefaultCheckTemplateProperty.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/XmlCheckTemplateFactory.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/XmlCheckTemplateFactory.java index b08b584c3c5..3ffaed0f003 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/XmlCheckTemplateFactory.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/templates/XmlCheckTemplateFactory.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java b/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java index 6c8ab6284f9..73d34649a63 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractImportableRulesRepository.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractImportableRulesRepository.java index 9926a33081e..99264e2a141 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractImportableRulesRepository.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractImportableRulesRepository.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractRulesRepository.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractRulesRepository.java index ec69f047174..5f7e1c3c99b 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractRulesRepository.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/AbstractRulesRepository.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationExportable.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationExportable.java index 3a853a6ab3f..c87b0cb88d8 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationExportable.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationExportable.java @@ -1,29 +1,29 @@ -/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules;
-
-import org.sonar.api.profiles.RulesProfile;
-
-@Deprecated
-public interface ConfigurationExportable {
-
- String exportConfiguration(RulesProfile profile);
-
-}
+/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.rules; + +import org.sonar.api.profiles.RulesProfile; + +@Deprecated +public interface ConfigurationExportable { + + String exportConfiguration(RulesProfile profile); + +} diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationImportable.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationImportable.java index c16337875e3..3c32c98f31c 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationImportable.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/ConfigurationImportable.java @@ -1,30 +1,30 @@ -/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules;
-
-import java.util.List;
-import org.sonar.api.rules.Rule;
-
-@Deprecated
-public interface ConfigurationImportable {
-
- List<ActiveRule> importConfiguration(String configuration, List<Rule> rules);
-
-}
+/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.rules; + +import java.util.List; +import org.sonar.api.rules.Rule; + +@Deprecated +public interface ConfigurationImportable { + + List<ActiveRule> importConfiguration(String configuration, List<Rule> rules); + +} diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/DefaultRulesManager.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/DefaultRulesManager.java index 37345cead6a..8ed1a70e75c 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/DefaultRulesManager.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/DefaultRulesManager.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/RulePriorityMapper.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/RulePriorityMapper.java index c8a382ecd89..cbae894a3b0 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/RulePriorityMapper.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/RulePriorityMapper.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesManager.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesManager.java index 2cf6a872307..7d852b446f0 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesManager.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesManager.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesRepository.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesRepository.java index 8156cac9723..2a09816b6c2 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesRepository.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/RulesRepository.java @@ -1,58 +1,58 @@ -/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules;
-
-import org.sonar.api.BatchExtension;
-import org.sonar.api.ServerExtension;
-import org.sonar.api.profiles.RulesProfile;
-import org.sonar.api.resources.Language;
-
-import java.util.List;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-public interface RulesRepository<LANG extends Language> extends BatchExtension, ServerExtension {
-
- /**
- * @return the language the repository is associated
- */
- LANG getLanguage();
-
- /**
- * @return the list of rules of the repository
- */
- List<Rule> getInitialReferential();
-
- /**
- * The method to parse the base referential of rules and return a list of rules
- *
- * @param fileContent the initial referential
- * @return a list of rules
- */
- List<Rule> parseReferential(String fileContent);
-
- /**
- * @return a list of profiles that are provided with the referential
- */
- List<RulesProfile> getProvidedProfiles();
-
-}
+/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.rules; + +import org.sonar.api.BatchExtension; +import org.sonar.api.ServerExtension; +import org.sonar.api.profiles.RulesProfile; +import org.sonar.api.resources.Language; + +import java.util.List; + +/** + * @deprecated since 2.3 + */ +@Deprecated +public interface RulesRepository<LANG extends Language> extends BatchExtension, ServerExtension { + + /** + * @return the language the repository is associated + */ + LANG getLanguage(); + + /** + * @return the list of rules of the repository + */ + List<Rule> getInitialReferential(); + + /** + * The method to parse the base referential of rules and return a list of rules + * + * @param fileContent the initial referential + * @return a list of rules + */ + List<Rule> parseReferential(String fileContent); + + /** + * @return a list of profiles that are provided with the referential + */ + List<RulesProfile> getProvidedProfiles(); + +} diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardProfileXmlParser.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardProfileXmlParser.java index 272b9642889..e2098c4c872 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardProfileXmlParser.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardProfileXmlParser.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardRulesXmlParser.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardRulesXmlParser.java index 82889c80c66..cf3b1798408 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardRulesXmlParser.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/StandardRulesXmlParser.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java index cd40e8a1f0e..7e3cfbadf7d 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java index 8e6dbec7670..657d616e5c4 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java @@ -1,47 +1,47 @@ -/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-
-@Deprecated
-@XStreamAlias("property")
-public class Property {
-
- @XStreamAsAttribute
- private String name;
-
- @XStreamAsAttribute
- private String value;
-
- public Property(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
+/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.rules.xml; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; + +@Deprecated +@XStreamAlias("property") +public class Property { + + @XStreamAsAttribute + private String name; + + @XStreamAsAttribute + private String value; + + public Property(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } }
\ No newline at end of file diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java index e424d1466a6..a299af9b7c1 100644 --- a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java +++ b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java @@ -1,82 +1,82 @@ -/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-import com.thoughtworks.xstream.annotations.XStreamImplicit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Deprecated
-@XStreamAlias("rule")
-public class Rule implements Comparable<String> {
-
- @XStreamAsAttribute
- private String key;
-
- @XStreamAsAttribute
- private String priority;
-
- @XStreamImplicit
- private List<Property> properties;
-
- public Rule(String ref) {
- this(ref, null);
- }
-
- public Rule(String ref, String priority) {
- this.key = ref;
- this.priority = priority;
- }
-
- public String getKey() {
- return key;
- }
-
- public void setProperties(List<Property> properties) {
- this.properties = properties;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public int compareTo(String o) {
- return o.compareTo(key);
- }
-
- public String getPriority() {
- return priority;
- }
-
- public void setPriority(String priority) {
- this.priority = priority;
- }
-
- public void addProperty(Property property) {
- if (properties == null) {
- properties = new ArrayList<Property>();
- }
- properties.add(property);
- }
-
+/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.api.rules.xml; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamAsAttribute; +import com.thoughtworks.xstream.annotations.XStreamImplicit; + +import java.util.ArrayList; +import java.util.List; + +@Deprecated +@XStreamAlias("rule") +public class Rule implements Comparable<String> { + + @XStreamAsAttribute + private String key; + + @XStreamAsAttribute + private String priority; + + @XStreamImplicit + private List<Property> properties; + + public Rule(String ref) { + this(ref, null); + } + + public Rule(String ref, String priority) { + this.key = ref; + this.priority = priority; + } + + public String getKey() { + return key; + } + + public void setProperties(List<Property> properties) { + this.properties = properties; + } + + public List<Property> getProperties() { + return properties; + } + + public int compareTo(String o) { + return o.compareTo(key); + } + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public void addProperty(Property property) { + if (properties == null) { + properties = new ArrayList<Property>(); + } + properties.add(property); + } + }
\ No newline at end of file diff --git a/sonar-deprecated/src/main/java/org/sonar/core/purge/AbstractPurge.java b/sonar-deprecated/src/main/java/org/sonar/core/purge/AbstractPurge.java index 8edba7288f5..365e6d888e5 100644 --- a/sonar-deprecated/src/main/java/org/sonar/core/purge/AbstractPurge.java +++ b/sonar-deprecated/src/main/java/org/sonar/core/purge/AbstractPurge.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/batch/AbstractViolationsStaxParserTest.java b/sonar-deprecated/src/test/java/org/sonar/api/batch/AbstractViolationsStaxParserTest.java index d1f91f1b4d3..437cc5d7b5e 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/batch/AbstractViolationsStaxParserTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/batch/AbstractViolationsStaxParserTest.java @@ -1,103 +1,103 @@ -/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-
-package org.sonar.api.batch;
-
-import static junit.framework.Assert.assertNull;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.mockito.Mockito.mock;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.codehaus.staxmate.in.SMInputCursor;
-import org.hibernate.lob.ReaderInputStream;
-import org.junit.Test;
-import org.sonar.api.resources.JavaFile;
-import org.sonar.api.resources.Resource;
-import org.sonar.api.rules.RulesManager;
-
-public class AbstractViolationsStaxParserTest {
-
- @Test
- public void testParseLineIndex() {
-
- assertThat(AbstractViolationsStaxParser.parseLineIndex("4"), is(4));
- assertNull(AbstractViolationsStaxParser.parseLineIndex("toto"));
- assertNull(AbstractViolationsStaxParser.parseLineIndex(""));
- assertNull(AbstractViolationsStaxParser.parseLineIndex(null));
- assertNull(AbstractViolationsStaxParser.parseLineIndex("-1"));
- }
-
- @Test
- public void testDoNotSaveViolationsOnUnexistedResource() throws XMLStreamException {
- SensorContext context = mock(SensorContext.class);
- MyViolationParser violationParser = new MyViolationParser(context, null);
- violationParser.setDoSaveViolationsOnUnexistedResource(false);
- violationParser.parse(new ReaderInputStream(new StringReader("<root><file/></root>")));
- }
-
- @Test(expected = CursorForViolationsMethodHasBeenCalled.class)
- public void testDoSaveViolationsOnUnexistedResource() throws XMLStreamException {
- SensorContext context = mock(SensorContext.class);
- MyViolationParser violationParser = new MyViolationParser(context, null);
- violationParser.parse(new ReaderInputStream(new StringReader("<root><file/></root>")));
- }
-
- private class MyViolationParser extends AbstractViolationsStaxParser {
-
- protected MyViolationParser(SensorContext context, RulesManager rulesManager) {
- super(context, rulesManager);
- }
-
- protected SMInputCursor cursorForResources(SMInputCursor rootCursor) throws XMLStreamException {
- return rootCursor.descendantElementCursor("file");
- }
-
- protected SMInputCursor cursorForViolations(SMInputCursor resourcesCursor) throws XMLStreamException {
- throw new CursorForViolationsMethodHasBeenCalled();
- }
-
- protected Resource toResource(SMInputCursor resourceCursor) throws XMLStreamException {
- return new JavaFile("org.sonar.MyClass");
- }
-
- protected String messageFor(SMInputCursor violationCursor) throws XMLStreamException {
- return null;
- }
-
- protected String ruleKey(SMInputCursor violationCursor) throws XMLStreamException {
- return null;
- }
-
- protected String keyForPlugin() {
- return null;
- }
-
- protected String lineNumberForViolation(SMInputCursor violationCursor) throws XMLStreamException {
- return null;
- }
- }
-
- private class CursorForViolationsMethodHasBeenCalled extends RuntimeException {
- }
-}
+/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ + +package org.sonar.api.batch; + +import static junit.framework.Assert.assertNull; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.mockito.Mockito.mock; + +import java.io.StringReader; + +import javax.xml.stream.XMLStreamException; + +import org.codehaus.staxmate.in.SMInputCursor; +import org.hibernate.lob.ReaderInputStream; +import org.junit.Test; +import org.sonar.api.resources.JavaFile; +import org.sonar.api.resources.Resource; +import org.sonar.api.rules.RulesManager; + +public class AbstractViolationsStaxParserTest { + + @Test + public void testParseLineIndex() { + + assertThat(AbstractViolationsStaxParser.parseLineIndex("4"), is(4)); + assertNull(AbstractViolationsStaxParser.parseLineIndex("toto")); + assertNull(AbstractViolationsStaxParser.parseLineIndex("")); + assertNull(AbstractViolationsStaxParser.parseLineIndex(null)); + assertNull(AbstractViolationsStaxParser.parseLineIndex("-1")); + } + + @Test + public void testDoNotSaveViolationsOnUnexistedResource() throws XMLStreamException { + SensorContext context = mock(SensorContext.class); + MyViolationParser violationParser = new MyViolationParser(context, null); + violationParser.setDoSaveViolationsOnUnexistedResource(false); + violationParser.parse(new ReaderInputStream(new StringReader("<root><file/></root>"))); + } + + @Test(expected = CursorForViolationsMethodHasBeenCalled.class) + public void testDoSaveViolationsOnUnexistedResource() throws XMLStreamException { + SensorContext context = mock(SensorContext.class); + MyViolationParser violationParser = new MyViolationParser(context, null); + violationParser.parse(new ReaderInputStream(new StringReader("<root><file/></root>"))); + } + + private class MyViolationParser extends AbstractViolationsStaxParser { + + protected MyViolationParser(SensorContext context, RulesManager rulesManager) { + super(context, rulesManager); + } + + protected SMInputCursor cursorForResources(SMInputCursor rootCursor) throws XMLStreamException { + return rootCursor.descendantElementCursor("file"); + } + + protected SMInputCursor cursorForViolations(SMInputCursor resourcesCursor) throws XMLStreamException { + throw new CursorForViolationsMethodHasBeenCalled(); + } + + protected Resource toResource(SMInputCursor resourceCursor) throws XMLStreamException { + return new JavaFile("org.sonar.MyClass"); + } + + protected String messageFor(SMInputCursor violationCursor) throws XMLStreamException { + return null; + } + + protected String ruleKey(SMInputCursor violationCursor) throws XMLStreamException { + return null; + } + + protected String keyForPlugin() { + return null; + } + + protected String lineNumberForViolation(SMInputCursor violationCursor) throws XMLStreamException { + return null; + } + } + + private class CursorForViolationsMethodHasBeenCalled extends RuntimeException { + } +} diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/AnnotationCheckerFactoryTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/AnnotationCheckerFactoryTest.java index 8e89d46dd43..64d858e3e57 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/AnnotationCheckerFactoryTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/AnnotationCheckerFactoryTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckWithUnsupportedPropertyType.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckWithUnsupportedPropertyType.java index 601ea23b8fd..2c5f3621ae9 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckWithUnsupportedPropertyType.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckWithUnsupportedPropertyType.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithIntegerProperty.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithIntegerProperty.java index 1c0f3983a60..fc178a97333 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithIntegerProperty.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithIntegerProperty.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithPrimitiveProperties.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithPrimitiveProperties.java index 26b12313de2..a1532925339 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithPrimitiveProperties.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithPrimitiveProperties.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithStringProperty.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithStringProperty.java index b219eee33fa..bed430862f6 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithStringProperty.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithStringProperty.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithoutProperties.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithoutProperties.java index a3a72999cfd..a670c06be9d 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithoutProperties.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/checkers/CheckerWithoutProperties.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactoryTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactoryTest.java index 83d16557ed7..a41a970edd5 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactoryTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/AnnotationCheckProfileFactoryTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileTest.java index 20d7ffc6910..09ae338d880 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshallerTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshallerTest.java index bf6c488d237..2c33c609db6 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshallerTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckProfileXmlMarshallerTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckTest.java index 3d59ff3cb52..cd7f527310b 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/CheckTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckOne.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckOne.java index aafd4f1f522..5a5ba20e23f 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckOne.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckOne.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckTwo.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckTwo.java index 3348f093f3c..a20e9de2cd3 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckTwo.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/profiles/FakeCheckTwo.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/AnnotatedCheckWithBundles.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/AnnotatedCheckWithBundles.java index 5618932fda5..234567e9926 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/AnnotatedCheckWithBundles.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/AnnotatedCheckWithBundles.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/DetailedAnnotatedCheck.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/DetailedAnnotatedCheck.java index 7e461ea1248..1b88b783d4a 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/DetailedAnnotatedCheck.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/DetailedAnnotatedCheck.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithAlternativeBundle.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithAlternativeBundle.java index 50dc9a78df2..8bf94a7fcf0 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithAlternativeBundle.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithAlternativeBundle.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithoutDefaultLocale.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithoutDefaultLocale.java index 7828d928cb1..02535aa7663 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithoutDefaultLocale.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/I18nCheckWithoutDefaultLocale.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/SimpleAnnotatedCheck.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/SimpleAnnotatedCheck.java index 67e99868bbb..2c8069efae4 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/SimpleAnnotatedCheck.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/samples/SimpleAnnotatedCheck.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactoryTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactoryTest.java index 5f8f5de48d6..bae346a718f 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactoryTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/AnnotationCheckTemplateFactoryTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/BundleCheckTemplateTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/BundleCheckTemplateTest.java index 905ba0399b8..d1ce879c470 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/BundleCheckTemplateTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/BundleCheckTemplateTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/CheckTemplateRepositoriesTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/CheckTemplateRepositoriesTest.java index 691a2084eaf..0b032d77797 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/CheckTemplateRepositoriesTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/CheckTemplateRepositoriesTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/DefaultCheckTemplateTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/DefaultCheckTemplateTest.java index e83896a6197..ad15e02eec5 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/DefaultCheckTemplateTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/templates/DefaultCheckTemplateTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardProfileXmlParserTest.java b/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardProfileXmlParserTest.java index 586961d0dca..1820670b7f3 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardProfileXmlParserTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardProfileXmlParserTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardRulesXmlParserTest.java b/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardRulesXmlParserTest.java index 25a408ce089..ab367b42532 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardRulesXmlParserTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/rules/StandardRulesXmlParserTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or |