Skip to content

Commit

Permalink
Version 1.1.6: changed Google Guava version to 28.2-android
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyagong committed Jun 29, 2020
1 parent fef5145 commit 1ee2587
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<version>28.2-android</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
2 changes: 1 addition & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ download_dependencies() {
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.10.3 \
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.3 \
com.google.code.findbugs:jsr305:3.0.1 \
com.google.guava:guava:18.0 \
com.google.guava:guava:28.2-android \
org.apache.httpcomponents:httpclient:4.5.1 \
org.apache.httpcomponents:httpclient-cache:4.5.1 \
org.apache.httpcomponents:httpmime:4.5.1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ private Class<AWSCredentialsProvider> loadUserDefinedCredentialsProvider() {
addCustomCredentialsJarToClassPath(customCredentialsProvider, classPathList);
}
URL[] urlArray = new URL[classPathList.size()];
URLClassLoader urlClassLoader = new URLClassLoader(classPathList.toArray(urlArray),
ClassLoader.getSystemClassLoader());
Class classToLoad = Class.forName(customCredentialsProvider.getLeft(), true,
urlClassLoader);
return (Class<AWSCredentialsProvider>) classToLoad;
try (URLClassLoader urlClassLoader = new URLClassLoader(classPathList.toArray(urlArray),
ClassLoader.getSystemClassLoader())) {
Class classToLoad = Class.forName(customCredentialsProvider.getLeft(), true,
urlClassLoader);
return (Class<AWSCredentialsProvider>) classToLoad;
}
} catch (Exception e) {
LOGGER.error("Error loading user defined credentials provider. " + e);
}
Expand Down
7 changes: 4 additions & 3 deletions tst/com/amazon/kinesis/streaming/agent/ByteBuffersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ public void testAsInputStream(ByteBuffer buffer) throws IOException {

@Test(expectedExceptions = EOFException.class)
public void testReadFullyEOFException() throws IOException {
FileChannel mockChannel = mock(FileChannel.class);
when(mockChannel.read(any(ByteBuffer.class), anyInt())).thenReturn(-1);
ByteBuffers.readFully(mockChannel, 6, 8);
final File tmpFile = File.createTempFile("temp", "test");
tmpFile.deleteOnExit();
final FileChannel channel = FileChannel.open(tmpFile.toPath(), StandardOpenOption.READ);
ByteBuffers.readFully(channel, 6, 8);
}

@Test
Expand Down
17 changes: 17 additions & 0 deletions tst/log4j2-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Configuration:
Appenders:
Console:
name: Console
target: SYSTEM_OUT
PatternLayout:
Pattern: "[%d{UTC}] [%t] [%c:%L] %highlight{[%p]}: %m %ex %n"
AlwaysWriteExceptions: false

Loggers:
Root:
level: info
AppenderRef:
- ref: Console
Logger:
- name: com.amazonaws.kinesis.streaming.agent
level: debug

0 comments on commit 1ee2587

Please sign in to comment.