Skip to content

Commit

Permalink
Use jspecify instead of custom annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Dec 18, 2024
1 parent c1a9062 commit b00f394
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 88 deletions.
36 changes: 0 additions & 36 deletions flow-server/src/main/java/com/vaadin/flow/Nonnull.java

This file was deleted.

36 changes: 0 additions & 36 deletions flow-server/src/main/java/com/vaadin/flow/Nullable.java

This file was deleted.

20 changes: 13 additions & 7 deletions vaadin-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>


<dependency>
<groupId>com.vaadin</groupId>
Expand Down Expand Up @@ -225,13 +231,13 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.vaadin.flow.spring.data;

import com.vaadin.flow.Nullable;
import org.jspecify.annotations.Nullable;

import com.vaadin.flow.spring.data.filter.Filter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.vaadin.flow.spring.data;

import com.vaadin.flow.Nullable;
import org.jspecify.annotations.Nullable;

/**
* A service that can create, update, and delete a given type of object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.util.List;

import com.vaadin.flow.Nullable;
import com.vaadin.flow.Nonnull;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
import org.springframework.data.domain.Pageable;

import com.vaadin.flow.spring.data.filter.Filter;
import org.springframework.data.domain.Pageable;

/**
* A service that can list the given type of object.
Expand All @@ -22,7 +22,7 @@ public interface ListService<T> {
* the filter to apply or {@code null} to not filter
* @return a list of objects or an empty list if no objects were found
*/
@Nonnull
List<@Nonnull T> list(Pageable pageable, @Nullable Filter filter);
@NonNull
List<@NonNull T> list(Pageable pageable, @Nullable Filter filter);

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.util.ArrayList;
import java.util.List;

import org.jspecify.annotations.Nullable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;

import com.vaadin.flow.Nullable;
import com.vaadin.flow.spring.data.CrudService;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import java.util.Optional;

import com.googlecode.gentyref.GenericTypeReflector;
import org.jspecify.annotations.Nullable;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;

import com.vaadin.flow.Nullable;
import com.vaadin.flow.spring.data.CountService;
import com.vaadin.flow.spring.data.GetService;
import com.vaadin.flow.spring.data.ListService;
Expand Down

0 comments on commit b00f394

Please sign in to comment.