From d89e2a2226c02e56eddbdb1bf3617cd5612caee7 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Fri, 15 Sep 2023 11:32:38 +0200 Subject: [PATCH 1/2] refacto - upgrade licences --- .../java/JavaCheckRegistrar.java | 15 ++++----- .../greencodeinitiative/java/JavaPlugin.java | 15 ++++----- .../java/JavaRulesDefinition.java | 15 ++++----- .../java/checks/ArrayCopyCheck.java | 17 ++++++++++ .../checks/AvoidConcatenateStringsInLoop.java | 17 ++++++++++ .../java/checks/AvoidFullSQLRequest.java | 17 ++++++++++ .../AvoidGettingSizeCollectionInLoop.java | 17 ++++++++++ .../checks/AvoidMultipleIfElseStatement.java | 17 ++++++++++ .../checks/AvoidRegexPatternNotStatic.java | 17 ++++++++++ .../java/checks/AvoidSQLRequestInLoop.java | 17 ++++++++++ .../checks/AvoidSetConstantInBatchUpdate.java | 17 ++++++++++ .../AvoidSpringRepositoryCallInLoopCheck.java | 17 ++++++++++ .../checks/AvoidStatementForDMLQueries.java | 17 ++++++++++ .../checks/AvoidUsageOfStaticCollections.java | 17 ++++++++++ .../AvoidUsingGlobalVariablesCheck.java | 17 ++++++++++ ...FreeResourcesOfAutoCloseableInterface.java | 17 ++++++++++ .../java/checks/IncrementCheck.java | 17 ++++++++++ .../InitializeBufferWithAppropriateSize.java | 17 ++++++++++ .../NoFunctionCallWhenDeclaringForLoop.java | 17 ++++++++++ .../checks/OptimizeReadFileExceptions.java | 17 ++++++++++ .../UnnecessarilyAssignValuesToVariables.java | 17 ++++++++++ .../java/checks/UseCorrectForLoop.java | 17 ++++++++++ .../checks/enums/ConstOrLiteralDeclare.java | 17 ++++++++++ .../java/utils/PrinterVisitor.java | 15 ++++----- .../java/utils/StringUtils.java | 15 ++++----- .../src/test/files/ArrayCopyCheck.java | 17 ++++++++++ .../files/AvoidConcatenateStringsInLoop.java | 17 ++++++++++ .../test/files/AvoidFullSQLRequestCheck.java | 17 ++++++++++ ...ingSizeCollectionInForEachLoopIgnored.java | 17 ++++++++++ ...voidGettingSizeCollectionInForLoopBad.java | 17 ++++++++++ ...oidGettingSizeCollectionInForLoopGood.java | 17 ++++++++++ ...GettingSizeCollectionInForLoopIgnored.java | 17 ++++++++++ ...idGettingSizeCollectionInWhileLoopBad.java | 17 ++++++++++ ...dGettingSizeCollectionInWhileLoopGood.java | 17 ++++++++++ ...ttingSizeCollectionInWhileLoopIgnored.java | 17 ++++++++++ .../files/AvoidMultipleIfElseStatement.java | 17 ++++++++++ .../AvoidMultipleIfElseStatementNoIssue.java | 17 ++++++++++ .../files/AvoidRegexPatternNotStatic.java | 17 ++++++++++ .../files/AvoidSQLRequestInLoopCheck.java | 17 ++++++++++ .../AvoidSetConstantInBatchUpdateCheck.java | 17 ++++++++++ .../AvoidSpringRepositoryCallInLoopCheck.java | 17 ++++++++++ .../files/AvoidStatementForDMLQueries.java | 17 ++++++++++ .../files/AvoidUsageOfStaticCollections.java | 17 ++++++++++ .../files/AvoidUsingGlobalVariablesCheck.java | 17 ++++++++++ ...FreeResourcesOfAutoCloseableInterface.java | 17 ++++++++++ .../files/GoodUsageOfStaticCollections.java | 17 ++++++++++ .../files/GoodWayConcatenateStringsLoop.java | 17 ++++++++++ .../src/test/files/IncrementCheck.java | 17 ++++++++++ .../InitializeBufferWithAppropriateSize.java | 17 ++++++++++ .../NoFunctionCallWhenDeclaringForLoop.java | 17 ++++++++++ .../files/OptimizeReadFileExceptionCheck.java | 17 ++++++++++ .../OptimizeReadFileExceptionCheck2.java | 17 ++++++++++ .../OptimizeReadFileExceptionCheck3.java | 17 ++++++++++ .../OptimizeReadFileExceptionCheck4.java | 17 ++++++++++ .../OptimizeReadFileExceptionCheck5.java | 17 ++++++++++ ...arilyAssignValuesToVariablesTestCheck.java | 17 ++++++++++ ...esToVariablesTestCheckWithEmptyReturn.java | 17 ++++++++++ .../test/files/UseCorrectForLoopCheck.java | 17 ++++++++++ .../src/test/files/ValidRegexPattern.java | 17 ++++++++++ .../src/test/files/ValidRegexPattern2.java | 17 ++++++++++ .../src/test/files/ValidRegexPattern3.java | 17 ++++++++++ .../java/JavaCheckRegistrarTest.java | 15 ++++----- .../java/JavaPluginTest.java | 15 ++++----- .../java/JavaRulesDefinitionTest.java | 15 ++++----- .../java/checks/ArrayCopyCheckTest.java | 17 ++++++++++ .../AvoidConcatenateStringsInLoopTest.java | 17 ++++++++++ .../checks/AvoidFullSQLRequestCheckTest.java | 17 ++++++++++ .../AvoidGettingSizeCollectionInLoopTest.java | 17 ++++++++++ .../AvoidMultipleIfElseStatementTest.java | 17 ++++++++++ .../AvoidRegexPatternNotStaticTest.java | 17 ++++++++++ .../AvoidSQLRequestInLoopCheckTest.java | 17 ++++++++++ .../AvoidSetConstantInBatchInsertTest.java | 17 ++++++++++ ...idSpringRepositoryCallInLoopCheckTest.java | 17 ++++++++++ .../AvoidStatementForDMLQueriesTest.java | 17 ++++++++++ .../AvoidUsageOfStaticCollectionsTests.java | 17 ++++++++++ ...oidUsingGlobalVariablesCheckCheckTest.java | 17 ++++++++++ ...ResourcesOfAutoCloseableInterfaceTest.java | 17 ++++++++++ .../java/checks/IncrementCheckTest.java | 17 ++++++++++ ...itializeBufferWithAppropriateSizeTest.java | 17 ++++++++++ ...oFunctionCallWhenDeclaringForLoopTest.java | 17 ++++++++++ .../OptimizeReadFileExceptionCheckTest.java | 17 ++++++++++ ...ecessarilyAssignValuesToVariablesTest.java | 17 ++++++++++ .../java/checks/UseCorrectLoopCheckTest.java | 17 ++++++++++ .../java/utils/FilesUtils.java | 15 ++++----- .../java/utils/StringUtilsTest.java | 15 ++++----- pom.xml | 31 +++++++++++++++++++ 86 files changed, 1386 insertions(+), 70 deletions(-) diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaCheckRegistrar.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaCheckRegistrar.java index 5ca219399..b66e81cfa 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaCheckRegistrar.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaCheckRegistrar.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaPlugin.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaPlugin.java index 3ccc016e8..ff070c1b1 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaPlugin.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaPlugin.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaRulesDefinition.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaRulesDefinition.java index e8f7cccd3..958edc829 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaRulesDefinition.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/JavaRulesDefinition.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/ArrayCopyCheck.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/ArrayCopyCheck.java index 080fc83d1..b594af9d4 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/ArrayCopyCheck.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/ArrayCopyCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.ArrayList; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java index 90d68b852..99b732c50 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequest.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequest.java index e8dd5d28b..88ff715c4 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequest.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.List; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoop.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoop.java index 7112bb685..c81d79534 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoop.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatement.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatement.java index 4cf870ea2..383365309 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatement.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatement.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.HashMap; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStatic.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStatic.java index a4e8e2f7e..2561a6c0f 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStatic.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStatic.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collections; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoop.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoop.java index 297895e08..7c4ff5623 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoop.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchUpdate.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchUpdate.java index 06e63179b..4fe31abda 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchUpdate.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchUpdate.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.sql.PreparedStatement; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheck.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheck.java index 6cf843392..e95d75e98 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheck.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueries.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueries.java index f273ae707..04e7b619e 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueries.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueries.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collections; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollections.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollections.java index c6eba94b7..18a7fb7f9 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollections.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollections.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collections; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheck.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheck.java index bdc4dee1b..98bb254b4 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheck.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterface.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterface.java index fb41ba0f7..47cbc2eb1 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterface.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterface.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.ArrayList; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/IncrementCheck.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/IncrementCheck.java index 7b480b1c7..00c3094dd 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/IncrementCheck.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/IncrementCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collections; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSize.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSize.java index bb3cc4dd6..44caa8722 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSize.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSize.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collections; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoop.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoop.java index 1c7c47347..d4088bd22 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoop.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.ArrayList; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptions.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptions.java index 9766d2009..2362404be 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptions.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptions.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariables.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariables.java index 8c6dde8f0..f5544d2e5 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariables.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariables.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.sonar.check.Rule; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UseCorrectForLoop.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UseCorrectForLoop.java index 6da7c13c1..05e46a4ab 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UseCorrectForLoop.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/UseCorrectForLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/enums/ConstOrLiteralDeclare.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/enums/ConstOrLiteralDeclare.java index f6ece9e7b..db01a76bc 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/enums/ConstOrLiteralDeclare.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/checks/enums/ConstOrLiteralDeclare.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks.enums; import java.math.BigDecimal; diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/PrinterVisitor.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/PrinterVisitor.java index 7e796b1a3..2b709d790 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/PrinterVisitor.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/PrinterVisitor.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/StringUtils.java b/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/StringUtils.java index bc6ec9d89..b9b81c526 100644 --- a/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/StringUtils.java +++ b/java-plugin/src/main/java/fr/greencodeinitiative/java/utils/StringUtils.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/test/files/ArrayCopyCheck.java b/java-plugin/src/test/files/ArrayCopyCheck.java index d18890515..09c780eaa 100644 --- a/java-plugin/src/test/files/ArrayCopyCheck.java +++ b/java-plugin/src/test/files/ArrayCopyCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ import java.util.Arrays; import java.util.Collection; import java.util.Collections; diff --git a/java-plugin/src/test/files/AvoidConcatenateStringsInLoop.java b/java-plugin/src/test/files/AvoidConcatenateStringsInLoop.java index b6b36b2f1..4e2a5877a 100644 --- a/java-plugin/src/test/files/AvoidConcatenateStringsInLoop.java +++ b/java-plugin/src/test/files/AvoidConcatenateStringsInLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.utils; public class AvoidConcatenateStringsInLoop { diff --git a/java-plugin/src/test/files/AvoidFullSQLRequestCheck.java b/java-plugin/src/test/files/AvoidFullSQLRequestCheck.java index 4a0994727..b388252af 100644 --- a/java-plugin/src/test/files/AvoidFullSQLRequestCheck.java +++ b/java-plugin/src/test/files/AvoidFullSQLRequestCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.regex.Pattern; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForEachLoopIgnored.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForEachLoopIgnored.java index 18d38b49b..46963cd7f 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForEachLoopIgnored.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForEachLoopIgnored.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopBad.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopBad.java index dec9e0f8a..3c74c86dc 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopBad.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopBad.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopGood.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopGood.java index 840ace8cc..5f2bcd2e7 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopGood.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopGood.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopIgnored.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopIgnored.java index 719f620c2..544e08e7d 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopIgnored.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInForLoopIgnored.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopBad.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopBad.java index 32c74e128..f47570c9b 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopBad.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopBad.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopGood.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopGood.java index 7329fba97..57668687e 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopGood.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopGood.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopIgnored.java b/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopIgnored.java index ca913f17d..10c752f40 100644 --- a/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopIgnored.java +++ b/java-plugin/src/test/files/AvoidGettingSizeCollectionInWhileLoopIgnored.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Collection; diff --git a/java-plugin/src/test/files/AvoidMultipleIfElseStatement.java b/java-plugin/src/test/files/AvoidMultipleIfElseStatement.java index 1b3b9fc96..435218fa6 100644 --- a/java-plugin/src/test/files/AvoidMultipleIfElseStatement.java +++ b/java-plugin/src/test/files/AvoidMultipleIfElseStatement.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; class AvoidMultipleIfElseStatementCheck { diff --git a/java-plugin/src/test/files/AvoidMultipleIfElseStatementNoIssue.java b/java-plugin/src/test/files/AvoidMultipleIfElseStatementNoIssue.java index d3a57b7a6..a56e9e599 100644 --- a/java-plugin/src/test/files/AvoidMultipleIfElseStatementNoIssue.java +++ b/java-plugin/src/test/files/AvoidMultipleIfElseStatementNoIssue.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; class AvoidMultipleIfElseStatementCheckNoIssue { diff --git a/java-plugin/src/test/files/AvoidRegexPatternNotStatic.java b/java-plugin/src/test/files/AvoidRegexPatternNotStatic.java index 0474e4520..b5e19c6e3 100644 --- a/java-plugin/src/test/files/AvoidRegexPatternNotStatic.java +++ b/java-plugin/src/test/files/AvoidRegexPatternNotStatic.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.regex.Pattern; diff --git a/java-plugin/src/test/files/AvoidSQLRequestInLoopCheck.java b/java-plugin/src/test/files/AvoidSQLRequestInLoopCheck.java index 4981d0b4c..753a717a6 100644 --- a/java-plugin/src/test/files/AvoidSQLRequestInLoopCheck.java +++ b/java-plugin/src/test/files/AvoidSQLRequestInLoopCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.sql.Connection; diff --git a/java-plugin/src/test/files/AvoidSetConstantInBatchUpdateCheck.java b/java-plugin/src/test/files/AvoidSetConstantInBatchUpdateCheck.java index 122a48b4d..03f5e86ab 100644 --- a/java-plugin/src/test/files/AvoidSetConstantInBatchUpdateCheck.java +++ b/java-plugin/src/test/files/AvoidSetConstantInBatchUpdateCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.math.BigDecimal; diff --git a/java-plugin/src/test/files/AvoidSpringRepositoryCallInLoopCheck.java b/java-plugin/src/test/files/AvoidSpringRepositoryCallInLoopCheck.java index c4aec153c..d2ae74e8a 100644 --- a/java-plugin/src/test/files/AvoidSpringRepositoryCallInLoopCheck.java +++ b/java-plugin/src/test/files/AvoidSpringRepositoryCallInLoopCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.springframework.beans.factory.annotation.Autowired; diff --git a/java-plugin/src/test/files/AvoidStatementForDMLQueries.java b/java-plugin/src/test/files/AvoidStatementForDMLQueries.java index 70ba4ed5e..5059b0933 100644 --- a/java-plugin/src/test/files/AvoidStatementForDMLQueries.java +++ b/java-plugin/src/test/files/AvoidStatementForDMLQueries.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.sql.Connection; diff --git a/java-plugin/src/test/files/AvoidUsageOfStaticCollections.java b/java-plugin/src/test/files/AvoidUsageOfStaticCollections.java index ac1b9f0dc..353099720 100644 --- a/java-plugin/src/test/files/AvoidUsageOfStaticCollections.java +++ b/java-plugin/src/test/files/AvoidUsageOfStaticCollections.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.*; diff --git a/java-plugin/src/test/files/AvoidUsingGlobalVariablesCheck.java b/java-plugin/src/test/files/AvoidUsingGlobalVariablesCheck.java index 362510eff..557d6fc92 100644 --- a/java-plugin/src/test/files/AvoidUsingGlobalVariablesCheck.java +++ b/java-plugin/src/test/files/AvoidUsingGlobalVariablesCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ public class Openclass { public static double price = 15.24; // Noncompliant {{Avoid using global variables}} public static long pages = 1053; // Noncompliant {{Avoid using global variables}} diff --git a/java-plugin/src/test/files/FreeResourcesOfAutoCloseableInterface.java b/java-plugin/src/test/files/FreeResourcesOfAutoCloseableInterface.java index e2ca15225..e1eaab59e 100644 --- a/java-plugin/src/test/files/FreeResourcesOfAutoCloseableInterface.java +++ b/java-plugin/src/test/files/FreeResourcesOfAutoCloseableInterface.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.io.*; diff --git a/java-plugin/src/test/files/GoodUsageOfStaticCollections.java b/java-plugin/src/test/files/GoodUsageOfStaticCollections.java index 8f8e55c71..6d2d3c202 100644 --- a/java-plugin/src/test/files/GoodUsageOfStaticCollections.java +++ b/java-plugin/src/test/files/GoodUsageOfStaticCollections.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.*; diff --git a/java-plugin/src/test/files/GoodWayConcatenateStringsLoop.java b/java-plugin/src/test/files/GoodWayConcatenateStringsLoop.java index b4218d0d7..c11c1ab6a 100644 --- a/java-plugin/src/test/files/GoodWayConcatenateStringsLoop.java +++ b/java-plugin/src/test/files/GoodWayConcatenateStringsLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.utils; public class GoodWayConcatenateStringsLoop { diff --git a/java-plugin/src/test/files/IncrementCheck.java b/java-plugin/src/test/files/IncrementCheck.java index 6a6d1b536..54b20bf90 100644 --- a/java-plugin/src/test/files/IncrementCheck.java +++ b/java-plugin/src/test/files/IncrementCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ class MyClass { MyClass(MyClass mc) { } diff --git a/java-plugin/src/test/files/InitializeBufferWithAppropriateSize.java b/java-plugin/src/test/files/InitializeBufferWithAppropriateSize.java index 1b391c106..b5852a195 100644 --- a/java-plugin/src/test/files/InitializeBufferWithAppropriateSize.java +++ b/java-plugin/src/test/files/InitializeBufferWithAppropriateSize.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.sql.Connection; diff --git a/java-plugin/src/test/files/NoFunctionCallWhenDeclaringForLoop.java b/java-plugin/src/test/files/NoFunctionCallWhenDeclaringForLoop.java index 8b92a39a8..da72a3efd 100644 --- a/java-plugin/src/test/files/NoFunctionCallWhenDeclaringForLoop.java +++ b/java-plugin/src/test/files/NoFunctionCallWhenDeclaringForLoop.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ class NoFunctionCallWhenDeclaringForLoop { NoFunctionCallWhenDeclaringForLoop(NoFunctionCallWhenDeclaringForLoop mc) { } diff --git a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck.java b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck.java index 6e7a6e29c..e9fd260cb 100644 --- a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck.java +++ b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck2.java b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck2.java index 2e1054925..689dc1878 100644 --- a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck2.java +++ b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck2.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck3.java b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck3.java index e76f64a01..92dc15019 100644 --- a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck3.java +++ b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck3.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck4.java b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck4.java index 89ca97340..5914e0fa5 100644 --- a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck4.java +++ b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck4.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck5.java b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck5.java index b4c3388dd..6d8b553e2 100644 --- a/java-plugin/src/test/files/OptimizeReadFileExceptionCheck5.java +++ b/java-plugin/src/test/files/OptimizeReadFileExceptionCheck5.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheck.java b/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheck.java index b61a58ec7..17eb069a5 100644 --- a/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheck.java +++ b/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; class UnnecessarilyAssignValuesToVariablesTestCheck { diff --git a/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheckWithEmptyReturn.java b/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheckWithEmptyReturn.java index f732e4945..f70c4c410 100644 --- a/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheckWithEmptyReturn.java +++ b/java-plugin/src/test/files/UnnecessarilyAssignValuesToVariablesTestCheckWithEmptyReturn.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; class UnnecessarilyAssignValuesToVariablesTestCheck { diff --git a/java-plugin/src/test/files/UseCorrectForLoopCheck.java b/java-plugin/src/test/files/UseCorrectForLoopCheck.java index dfdde5d16..350ed6ebb 100644 --- a/java-plugin/src/test/files/UseCorrectForLoopCheck.java +++ b/java-plugin/src/test/files/UseCorrectForLoopCheck.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.Arrays; diff --git a/java-plugin/src/test/files/ValidRegexPattern.java b/java-plugin/src/test/files/ValidRegexPattern.java index 5ed3652f4..aacb701e5 100644 --- a/java-plugin/src/test/files/ValidRegexPattern.java +++ b/java-plugin/src/test/files/ValidRegexPattern.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.regex.Pattern; diff --git a/java-plugin/src/test/files/ValidRegexPattern2.java b/java-plugin/src/test/files/ValidRegexPattern2.java index d6d9efd71..a674b9bc4 100644 --- a/java-plugin/src/test/files/ValidRegexPattern2.java +++ b/java-plugin/src/test/files/ValidRegexPattern2.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.regex.Pattern; diff --git a/java-plugin/src/test/files/ValidRegexPattern3.java b/java-plugin/src/test/files/ValidRegexPattern3.java index e19073454..086769384 100644 --- a/java-plugin/src/test/files/ValidRegexPattern3.java +++ b/java-plugin/src/test/files/ValidRegexPattern3.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import java.util.regex.Pattern; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaCheckRegistrarTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaCheckRegistrarTest.java index 29cc52ae2..db1383ae5 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaCheckRegistrarTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaCheckRegistrarTest.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaPluginTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaPluginTest.java index 3d09e5b0e..0f2167d37 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaPluginTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaPluginTest.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaRulesDefinitionTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaRulesDefinitionTest.java index bb6f796d3..2c6551436 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaRulesDefinitionTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/JavaRulesDefinitionTest.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/ArrayCopyCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/ArrayCopyCheckTest.java index e83a49e2f..5f0b12767 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/ArrayCopyCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/ArrayCopyCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoopTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoopTest.java index d5e3e6fcb..00027474c 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoopTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidConcatenateStringsInLoopTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequestCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequestCheckTest.java index 516f31fec..25ead7c4d 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequestCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequestCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoopTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoopTest.java index 4a0bad7f8..8083c1db6 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoopTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoopTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatementTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatementTest.java index 84a7e5f32..568757e7c 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatementTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatementTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStaticTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStaticTest.java index a3c8ba912..5350cc127 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStaticTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStaticTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoopCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoopCheckTest.java index 54f5f4a53..5abed41fd 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoopCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSQLRequestInLoopCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchInsertTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchInsertTest.java index 73a7e58d3..8c138fde7 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchInsertTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSetConstantInBatchInsertTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheckTest.java index ce5dfc36e..2ea1887bd 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInLoopCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import fr.greencodeinitiative.java.utils.FilesUtils; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueriesTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueriesTest.java index 1a8803440..40c5a51b6 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueriesTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidStatementForDMLQueriesTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollectionsTests.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollectionsTests.java index e72d271de..a9b8a2d84 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollectionsTests.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsageOfStaticCollectionsTests.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheckCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheckCheckTest.java index c8dbeb26a..f9e270e6c 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheckCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/AvoidUsingGlobalVariablesCheckCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterfaceTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterfaceTest.java index 2736a12e3..9a9ca4929 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterfaceTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/FreeResourcesOfAutoCloseableInterfaceTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/IncrementCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/IncrementCheckTest.java index 4044341cd..e9d5b98ef 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/IncrementCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/IncrementCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSizeTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSizeTest.java index 5096eee2f..deef83e80 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSizeTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/InitializeBufferWithAppropriateSizeTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoopTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoopTest.java index f2876bb1d..ef3c983fe 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoopTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/NoFunctionCallWhenDeclaringForLoopTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptionCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptionCheckTest.java index 5dffac408..b3ef8c89e 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptionCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/OptimizeReadFileExceptionCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariablesTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariablesTest.java index efcb2aa1b..09336e24a 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariablesTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UnnecessarilyAssignValuesToVariablesTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UseCorrectLoopCheckTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UseCorrectLoopCheckTest.java index f6add5776..815d097a1 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UseCorrectLoopCheckTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/checks/UseCorrectLoopCheckTest.java @@ -1,3 +1,20 @@ +/* + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package fr.greencodeinitiative.java.checks; import org.junit.jupiter.api.Test; diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/FilesUtils.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/FilesUtils.java index 121607764..ed06d4cef 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/FilesUtils.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/FilesUtils.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/StringUtilsTest.java b/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/StringUtilsTest.java index 25b5b6791..9e6d9328a 100644 --- a/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/StringUtilsTest.java +++ b/java-plugin/src/test/java/fr/greencodeinitiative/java/utils/StringUtilsTest.java @@ -1,15 +1,16 @@ /* - * Copyright (C) 2023 Green Code Initiative + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) * - * This program 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. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . diff --git a/pom.xml b/pom.xml index 45989d064..f30d9ec81 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ ecoCode Sonar Plugins Project Provides rules to reduce the environmental footprint of your programs + 2023 https://github.com/green-code-initiative/ecocode green-code-initiative @@ -261,6 +262,36 @@ + + + com.mycila + license-maven-plugin + 4.1 + + + Green Code Initiative + https://www.ecocode.io + + + +
com/mycila/maven/plugin/license/templates/GPL-3.txt
+ + **/*.java + +
+
+
+ + + validate + + check + + validate + + +
+
From a12180a0c8a991dd4e61da2a5262260ed7291f37 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Fri, 15 Sep 2023 11:40:39 +0200 Subject: [PATCH 2/2] refacto - upgrade licences : update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5417e622f..e29995a9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#216](https://github.com/green-code-initiative/ecoCode/issues/216) Upgrade rule EC2 for Java : Multiple if-else statement improvment - [#106](https://github.com/green-code-initiative/ecoCode/issues/106) Upgrade RULES.md : rule EC67 not relevant neither for Python nor Rust +- [#225](https://github.com/green-code-initiative/ecoCode/pull/225) Upgrade licence system and licence headers of Java files ### Deleted