1 /* 2 * Copyright 2021 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 */ 16 17 @file:Suppress("unused") 18 19 package androidx.sample.consumer 20 21 import sample.annotation.provider.ExperimentalSampleAnnotationJava 22 import sample.annotation.provider.RequiresAndroidXOptInSampleAnnotationJava 23 import sample.annotation.provider.RequiresAndroidXOptInSampleAnnotationJavaDuplicate 24 import sample.annotation.provider.RequiresOptInSampleAnnotationJava 25 import sample.annotation.provider.RequiresOptInSampleAnnotationJavaDuplicate 26 27 class OutsideGroupExperimentalAnnotatedClass { 28 29 // b/201564937 (comments 3, 5-7) - temporarily commenting out due to import issue 30 // @ExperimentalSampleAnnotation 31 // fun invalidAnnotatedFunction() { 32 // // Nothing to see here. 33 // } 34 35 @ExperimentalSampleAnnotationJava invalidExperimentalAnnotatedMethodnull36 fun invalidExperimentalAnnotatedMethod() { 37 // Nothing to see here. 38 } 39 40 @RequiresOptInSampleAnnotationJava invalidRequiresOptInAnnotatedMethodnull41 fun invalidRequiresOptInAnnotatedMethod() { 42 // Nothing to see here. 43 } 44 45 @kotlin.OptIn(RequiresOptInSampleAnnotationJava::class) invalidMethodWithSingleOptInnull46 fun invalidMethodWithSingleOptIn() { 47 // Nothing to see here. 48 } 49 50 @kotlin.OptIn( 51 RequiresOptInSampleAnnotationJava::class, 52 RequiresOptInSampleAnnotationJavaDuplicate::class 53 ) invalidMethodWithMultipleOptInsWithLineBreaksnull54 fun invalidMethodWithMultipleOptInsWithLineBreaks() { 55 // Nothing to see here. 56 } 57 58 @kotlin.OptIn( 59 RequiresOptInSampleAnnotationJava::class, 60 RequiresOptInSampleAnnotationJavaDuplicate::class 61 ) invalidMethodWithMultipleOptInsWithoutLineBreaksnull62 fun invalidMethodWithMultipleOptInsWithoutLineBreaks() { 63 // Nothing to see here. 64 } 65 66 @androidx.annotation.OptIn(RequiresAndroidXOptInSampleAnnotationJava::class) invalidMethodWithSingleAndroidXOptInnull67 fun invalidMethodWithSingleAndroidXOptIn() { 68 // Nothing to see here. 69 } 70 71 @androidx.annotation.OptIn( 72 RequiresAndroidXOptInSampleAnnotationJava::class, 73 RequiresAndroidXOptInSampleAnnotationJavaDuplicate::class 74 ) invalidMethodWithMultipleAndroidXOptInsWithLineBreaksnull75 fun invalidMethodWithMultipleAndroidXOptInsWithLineBreaks() { 76 // Nothing to see here. 77 } 78 79 @androidx.annotation.OptIn( 80 RequiresAndroidXOptInSampleAnnotationJava::class, 81 RequiresAndroidXOptInSampleAnnotationJavaDuplicate::class 82 ) invalidMethodWithMultipleAndroidXOptInsWithoutLineBreaksnull83 fun invalidMethodWithMultipleAndroidXOptInsWithoutLineBreaks() { 84 // Nothing to see here. 85 } 86 } 87