Skip to content

Commit 29e9fa7

Browse files
replace var with explicit types
1 parent b3656e4 commit 29e9fa7

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/main/java/de/tum/cit/aet/core/web/DocumentResource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.tum.cit.aet.core.web;
22

3+
import de.tum.cit.aet.application.domain.Application;
34
import de.tum.cit.aet.core.domain.DocumentDictionary;
45
import de.tum.cit.aet.core.exception.AccessDeniedException;
56
import de.tum.cit.aet.core.service.CurrentUserService;
@@ -63,7 +64,7 @@ public ResponseEntity<Resource> downloadDocument(@PathVariable UUID documentDict
6364
*/
6465
private void verifyAccess(DocumentDictionary documentDictionary) {
6566
if (documentDictionary.getApplication() != null) {
66-
var application = documentDictionary.getApplication();
67+
Application application = documentDictionary.getApplication();
6768
if (currentUserService.isProfessor() || currentUserService.isEmployee()) {
6869
currentUserService.verifyJobAccess(application.getJob());
6970
return;
@@ -73,7 +74,7 @@ private void verifyAccess(DocumentDictionary documentDictionary) {
7374
}
7475

7576
if (documentDictionary.getCustomFieldAnswer() != null) {
76-
var application = documentDictionary.getCustomFieldAnswer().getApplication();
77+
Application application = documentDictionary.getCustomFieldAnswer().getApplication();
7778
if (currentUserService.isProfessor() || currentUserService.isEmployee()) {
7879
currentUserService.verifyJobAccess(application.getJob());
7980
return;

src/test/java/de/tum/cit/aet/core/retention/UserRetentionIntegrationTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import de.tum.cit.aet.core.config.UserRetentionProperties;
1111
import de.tum.cit.aet.core.constants.DocumentType;
1212
import de.tum.cit.aet.core.constants.Language;
13+
import de.tum.cit.aet.core.domain.DocumentDictionary;
1314
import de.tum.cit.aet.core.domain.ProfileImage;
1415
import de.tum.cit.aet.core.repository.DocumentDictionaryRepository;
1516
import de.tum.cit.aet.core.repository.DocumentRepository;
@@ -163,7 +164,7 @@ void setUp() {
163164
}
164165

165166
@Test
166-
void shouldDeleteApplicantAndAllAssociatedData() throws Exception {
167+
void shouldDeleteApplicantAndAllAssociatedData() {
167168
User professor = UserTestData.saveProfessor(researchGroup, userRepository);
168169
User savedApplicantUser = ApplicantTestData.saveApplicant("applicant@test.local", userRepository);
169170
UUID applicantId = savedApplicantUser.getUserId();
@@ -186,7 +187,7 @@ void shouldDeleteApplicantAndAllAssociatedData() throws Exception {
186187
DocumentType.CV,
187188
"cv.pdf"
188189
);
189-
var applicantProfileDictionary = DocumentTestData.savedDictionaryWithMockDocument(
190+
DocumentDictionary applicantProfileDictionary = DocumentTestData.savedDictionaryWithMockDocument(
190191
documentRepository,
191192
documentDictionaryRepository,
192193
savedApplicantUser,

src/test/java/de/tum/cit/aet/core/web/UserDataExportResourceTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Map;
3131
import java.util.Set;
3232
import java.util.UUID;
33+
import java.util.stream.Stream;
3334
import java.util.zip.ZipEntry;
3435
import java.util.zip.ZipInputStream;
3536
import org.junit.jupiter.api.BeforeEach;
@@ -183,7 +184,7 @@ void pendingExportIsProcessedAndZipCreated() throws Exception {
183184
}
184185

185186
@Test
186-
void downloadRequiresAuthenticationAndUpdatesStatus() throws Exception {
187+
void downloadRequiresAuthenticationAndUpdatesStatus() {
187188
User user = savedUser("download-user@tum.de");
188189

189190
DataExportRequest request = new DataExportRequest();
@@ -300,7 +301,7 @@ private User savedUser(String email) {
300301
private void cleanExportRoot() {
301302
Path root = Paths.get(exportRootConfig).toAbsolutePath().normalize();
302303
if (Files.exists(root)) {
303-
try (var stream = Files.walk(root)) {
304+
try (Stream<Path> stream = Files.walk(root)) {
304305
stream
305306
.sorted(Comparator.reverseOrder())
306307
.forEach(path -> {

0 commit comments

Comments
 (0)