Skip to content

Commit ff83967

Browse files
author
Derek Wasinger
committed
reverting isEmpty for java 8
1 parent 269ab9c commit ff83967

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
<version>1.0.0-SNAPSHOT</version>
1010
<properties>
1111
<compiler-plugin.version>3.8.1</compiler-plugin.version>
12-
<jackson.version>2.10.1</jackson.version>
1312
<maven.compiler.parameters>true</maven.compiler.parameters>
1413
<maven.compiler.source>1.8</maven.compiler.source>
1514
<maven.compiler.target>1.8</maven.compiler.target>
1615
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1716
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1817
<quarkus-plugin.version>1.3.0.Final</quarkus-plugin.version>
19-
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
18+
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
2019
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
2120
<quarkus.platform.version>1.3.0.Final</quarkus.platform.version>
2221
<surefire-plugin.version>2.22.1</surefire-plugin.version>

src/main/java/com/redhat/labs/omp/resources/CacheResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Response testResCache() {
7777
private File fetchContentFromGit(String fileName) {
7878

7979
Optional<File> optional = fileService.getFile(templateRepositoryId, fileName);
80-
if (optional.isEmpty()) {
80+
if (!optional.isPresent()) {
8181
throw new FileNotFoundException("file not found in gitlab.");
8282
}
8383

src/main/java/com/redhat/labs/omp/resources/LegacyFileResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class LegacyFileResource {
3434
public Response getFileFromGitByName(@QueryParam("name") String fileName, @QueryParam("repo_id") Integer repoId,
3535
@QueryParam("branch") String branch) {
3636
Optional<File> optional = fileService.getFile(repoId, fileName, branch);
37-
if (optional.isEmpty()) {
37+
if (!optional.isPresent()) {
3838
return Response.status(HttpStatus.SC_NOT_FOUND).build();
3939
}
4040

src/main/java/com/redhat/labs/omp/service/EngagementService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ private Group getOrCreateGroup(String groupName, Group groupToCreate) {
9797

9898
Optional<Group> optional = groupService.getGitLabGroupByName(groupName);
9999

100-
if (optional.isEmpty()) {
100+
if (!optional.isPresent()) {
101101

102102
// try to create group
103103
optional = groupService.createGitLabGroup(groupToCreate);
104104

105-
if (optional.isEmpty()) {
105+
if (!optional.isPresent()) {
106106
throw new UnexpectedGitLabResponseException("failed to create group");
107107
}
108108

@@ -116,12 +116,12 @@ private Project getOrCreateProject(Integer namespaceId, String projectName, Proj
116116

117117
Optional<Project> optional = projectService.getProjectByName(namespaceId, projectName);
118118

119-
if (optional.isEmpty()) {
119+
if (!optional.isPresent()) {
120120

121121
// try to create project
122122
optional = projectService.createProject(project);
123123

124-
if (optional.isEmpty()) {
124+
if (!optional.isPresent()) {
125125
throw new UnexpectedGitLabResponseException("failed to create project");
126126
}
127127

src/main/java/com/redhat/labs/omp/service/TemplateService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public File getTemplateInventoryFile() {
6666
// get inventory file
6767
Optional<File> optional = fileService.getFile(templateRepositoryId, inventoryFileName);
6868

69-
if (optional.isEmpty()) {
69+
if (!optional.isPresent()) {
7070
throw new FileNotFoundException("could not get template inventory file from gitlab.");
7171
}
7272

@@ -86,7 +86,7 @@ public List<File> getTemplateInventoryFiles(File file) {
8686
String fileName = metaFileFolder + line.substring(1);
8787

8888
Optional<File> optional = fileService.getFile(templateRepositoryId, fileName);
89-
if (optional.isEmpty()) {
89+
if (!optional.isPresent()) {
9090
throw new FileNotFoundException("could not get template file '" + fileName + "' from gitlab.");
9191
}
9292

0 commit comments

Comments
 (0)