Skip to content

Commit

Permalink
Merge pull request #481 from /issues/480-remove-guava
Browse files Browse the repository at this point in the history
Fix #480: Remove Guava dependency
  • Loading branch information
banterCZ authored Jan 12, 2024
2 parents 488cf52 + ae61f41 commit 5a9f669
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
19 changes: 6 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,26 +193,19 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<dependencies>
<dependency>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-banned-java-imports</id>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<RestrictImports>
<!-- https://github.com/google/guava/issues/2960 -->
<reason>Guava depends on jsr305 but we prefer jakarta in our code</reason>
<bannedImport>javax.annotation.**</bannedImport>
</RestrictImports>
<bannedDependencies>
<excludes>
<exclude>com.google.guava:guava*:*:*:compile</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
package io.getlime.security.powerauth.rest.api.spring.filter;

import com.google.common.io.ByteStreams;
import jakarta.annotation.Nonnull;
import jakarta.servlet.ReadListener;
import jakarta.servlet.ServletInputStream;
Expand Down Expand Up @@ -61,10 +60,9 @@ public byte[] getRequestBody() throws IOException {
return Arrays.copyOf(requestBody, requestBody.length);
}

InputStream inputStream = super.getInputStream();
final InputStream inputStream = super.getInputStream();

//TODO: Replace by Java 9 InputStream.readAllBytes() method when relevant.
requestBody = ByteStreams.toByteArray(inputStream);
requestBody = inputStream.readAllBytes();

bufferFilled = true;

Expand Down

0 comments on commit 5a9f669

Please sign in to comment.