blob: 712722b123aff86276fa0d8717b3be9375e7781c [file] [log] [blame]
Eugene Susla05ef53e2019-10-07 12:04:04 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.codegentest;
17
18import android.annotation.NonNull;
19
20import com.android.internal.util.DataClass;
21
22/**
23 * Test for some false positive pitfalls for
24 * {@link android.processor.staledataclass.StaleDataclassProcessor}
25 *
26 * Relies on the detector being run, failing the build should any of things here falsely
27 * register as stale.
28 */
29@DataClass(genConstructor = false, genBuilder = false)
30public class StaleDataclassDetectorFalsePositivesTest {
31
32 /** Interfaces should be ignored */
33 public interface SomeListener {
34 void onEvent();
35 }
36
37 /** Enums should be ignored */
38 private enum SomeEnum { ONE, TWO }
39
40 /** Annotations should be ignored */
41 public @interface SomeAnnotation {}
42
43 /* Static initializers should be ignored */
44 static {}
45
46 /* Initializers should be ignored */
47 {}
48
49 /** Unrelated methods should be noted, without triggering staleness false positives */
50 public @NonNull String someMethod(int param) { return null; }
51
52
53
Eugene Suslaf7450422019-11-18 16:09:52 -080054 // Code below generated by codegen v1.0.14.
Eugene Susla05ef53e2019-10-07 12:04:04 -070055 //
56 // DO NOT MODIFY!
57 // CHECKSTYLE:OFF Generated code
58 //
59 // To regenerate run:
60 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/StaleDataclassDetectorFalsePositivesTest.java
Eugene Suslaf821caa2019-10-04 14:51:29 -070061 //
62 // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
63 // Settings > Editor > Code Style > Formatter Control
64 //@formatter:off
Eugene Susla05ef53e2019-10-07 12:04:04 -070065
66
67 @DataClass.Generated(
Eugene Suslaf7450422019-11-18 16:09:52 -080068 time = 1574122839646L,
69 codegenVersion = "1.0.14",
Eugene Susla05ef53e2019-10-07 12:04:04 -070070 sourceFile = "frameworks/base/tests/Codegen/src/com/android/codegentest/StaleDataclassDetectorFalsePositivesTest.java",
71 inputSignatures = "public @android.annotation.NonNull java.lang.String someMethod(int)\nclass StaleDataclassDetectorFalsePositivesTest extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genBuilder=false)")
72 @Deprecated
73 private void __metadata() {}
74
Eugene Susla322e8b12019-10-22 17:32:08 -070075
76 //@formatter:on
77 // End of generated code
78
Eugene Susla05ef53e2019-10-07 12:04:04 -070079}