Skip to content

Commit

Permalink
Add hints for spotbugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Feb 18, 2023
1 parent c2242c7 commit 0f3bd5f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package net.bytebuddy.utility;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.bytebuddy.ClassFileVersion;
import net.bytebuddy.build.AccessControllerPlugin;
import net.bytebuddy.description.enumeration.EnumerationDescription;
Expand Down Expand Up @@ -1000,6 +1001,7 @@ public static MethodType ofSetter(Field field) {
* @param fieldDescription The field to extract a setter type for.
* @return The type of a setter for the given field.
*/
@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Assuming declaring type for type member.")
public static MethodType ofSetter(FieldDescription fieldDescription) {
return new MethodType(TypeDescription.ForLoadedType.of(void.class), fieldDescription.isStatic()
? Collections.singletonList(fieldDescription.getType().asErasure())
Expand All @@ -1022,6 +1024,7 @@ public static MethodType ofGetter(Field field) {
* @param fieldDescription The field to extract a getter type for.
* @return The type of a getter for the given field.
*/
@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Assuming declaring type for type member.")
public static MethodType ofGetter(FieldDescription fieldDescription) {
return new MethodType(fieldDescription.getType().asErasure(), fieldDescription.isStatic()
? Collections.<TypeDescription>emptyList()
Expand Down

0 comments on commit 0f3bd5f

Please sign in to comment.