|
| 1 | +/* |
| 2 | + * ecoCode - Java language - Provides rules to reduce the environmental footprint of your Java programs |
| 3 | + * Copyright © 2023 Green Code Initiative (https://www.ecocode.io) |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + */ |
1 | 18 | package fr.greencodeinitiative.java.checks; |
2 | 19 |
|
3 | 20 | import org.sonar.check.Rule; |
|
6 | 23 | import org.sonar.plugins.java.api.tree.MemberSelectExpressionTree; |
7 | 24 | import org.sonar.plugins.java.api.tree.MethodInvocationTree; |
8 | 25 | import org.sonar.plugins.java.api.tree.Tree; |
9 | | -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; |
10 | | - |
11 | 26 | import javax.annotation.Nonnull; |
12 | 27 | import java.util.Collections; |
13 | 28 | import java.util.List; |
14 | 29 | import java.util.Objects; |
15 | 30 |
|
16 | | -@Rule(key = "XXX") |
17 | | -@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "XXX") |
| 31 | +@Rule(key = "EC1369") |
18 | 32 | public class UseOptionalOrElseGetVsOrElse extends IssuableSubscriptionVisitor { |
19 | 33 |
|
20 | 34 | private static final String MESSAGE_RULE = "Use optional orElseGet instead of orElse."; |
|
0 commit comments