|
| 1 | +/* |
| 2 | + * This file is part of SpongeAPI, licensed under the MIT License (MIT). |
| 3 | + * |
| 4 | + * Copyright (c) SpongePowered <https://www.spongepowered.org> |
| 5 | + * Copyright (c) contributors |
| 6 | + * |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in |
| 15 | + * all copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | + * THE SOFTWARE. |
| 24 | + */ |
1 | 25 | package org.spongepowered.plugin.processor; |
2 | 26 |
|
3 | 27 | import org.checkerframework.checker.nullness.qual.Nullable; |
|
9 | 33 |
|
10 | 34 | import java.lang.annotation.Annotation; |
11 | 35 | import java.util.HashMap; |
12 | | -import java.util.List; |
13 | 36 | import java.util.Map; |
14 | 37 | import java.util.Set; |
15 | | - |
16 | 38 | import javax.lang.model.element.AnnotationValue; |
17 | 39 | import javax.lang.model.element.Element; |
18 | 40 | import javax.lang.model.element.ElementKind; |
@@ -95,7 +117,7 @@ void validate(final ParameterContext ctx) { |
95 | 117 | } |
96 | 118 |
|
97 | 119 | TypeMirror expectedType = ((ExecutableType) ctx.types().asMemberOf(ctx.eventType().get(), possible)).getReturnType(); |
98 | | - if (expectedType.getKind() == TypeKind.DECLARED) {// maybe Optional, if so unwrap |
| 120 | + if (expectedType.getKind() == TypeKind.DECLARED) { // maybe Optional, if so unwrap |
99 | 121 | final DeclaredType declared = (DeclaredType) expectedType; |
100 | 122 | if (this.isOptional(declared) && declared.getTypeArguments().size() == 1 && !this.isOptional(ctx.param().asType())) { |
101 | 123 | expectedType = declared.getTypeArguments().get(0); |
|
0 commit comments