|
16 | 16 |
|
17 | 17 | package com.google.errorprone.matchers;
|
18 | 18 |
|
19 |
| -import static com.google.common.truth.Truth.assertThat; |
20 | 19 | import static com.google.errorprone.BugPattern.SeverityLevel.WARNING;
|
21 | 20 | import static com.google.errorprone.util.ASTHelpers.getSymbol;
|
22 | 21 |
|
23 | 22 | import com.google.errorprone.BugPattern;
|
24 | 23 | import com.google.errorprone.CompilationTestHelper;
|
25 | 24 | import com.google.errorprone.VisitorState;
|
26 |
| -import com.google.errorprone.annotations.CompileTimeConstant; |
27 | 25 | import com.google.errorprone.bugpatterns.BugChecker;
|
28 | 26 | import com.google.errorprone.bugpatterns.BugChecker.VariableTreeMatcher;
|
29 | 27 | import com.sun.source.tree.VariableTree;
|
30 |
| -import java.lang.annotation.ElementType; |
31 |
| -import java.lang.annotation.Target; |
32 | 28 | import javax.lang.model.element.ElementKind;
|
33 | 29 | import org.junit.Test;
|
34 | 30 | import org.junit.runner.RunWith;
|
@@ -170,16 +166,6 @@ public void finalCompileTimeConstantConstructorParameters() {
|
170 | 166 | .doTest();
|
171 | 167 | }
|
172 | 168 |
|
173 |
| - // TODO(xtof): We'd like to eventually support other cases, but I first need |
174 |
| - // to determine with confidence that the checker can ensure all initializations |
175 |
| - // and assignments to such variables are compile-time-constant. |
176 |
| - // For now, the annotation's target is restricted to ElementType.PARAMETER. |
177 |
| - @Test |
178 |
| - public void compileTimeConstantAnnotationOnlyAllowedOnParameterOrField() { |
179 |
| - assertThat(CompileTimeConstant.class.getAnnotation(Target.class).value()) |
180 |
| - .isEqualTo(new ElementType[] {ElementType.PARAMETER, ElementType.FIELD}); |
181 |
| - } |
182 |
| - |
183 | 169 | @Test
|
184 | 170 | public void conditionalExpression() {
|
185 | 171 | testHelper
|
|
0 commit comments