Skip to content

Commit

Permalink
Housekeeping - update libs and get rid of compilation warnings
Browse files Browse the repository at this point in the history
- JUnit updated to `4.12`
- Hamcrest updated to `1.10.19`
- Fixed a few compilation warnings in reflection code
  • Loading branch information
davidmarquis committed Apr 29, 2018
1 parent 6fee7da commit 780e204
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -63,7 +63,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.0</version>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/fluentinterface/beans/reflect/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public final class Property implements AnnotatedElement {
*/
@Override
public Annotation[] getAnnotations() {
return annotations.values().toArray(new Annotation[annotations.size()]);
return annotations.values().toArray(new Annotation[0]);
}

/**
Expand All @@ -202,7 +202,7 @@ public Annotation[] getAnnotations() {
*/
@Override
public Annotation[] getDeclaredAnnotations() {
return declaredAnnotations.values().toArray(new Annotation[declaredAnnotations.size()]);
return declaredAnnotations.values().toArray(new Annotation[0]);
}

/**
Expand Down Expand Up @@ -403,7 +403,7 @@ public boolean isWritable() {
public Object get(Object obj) throws ReflectionException {
try {
if (isPublic(readMethod)) {
return readMethod.invoke(obj, null);
return readMethod.invoke(obj);
} else {
throw new ReflectionException("Cannot get the value of " + this + ", as it is write-only.");
}
Expand Down Expand Up @@ -431,7 +431,7 @@ public Object get(Object obj) throws ReflectionException {
public void set(Object obj, Object value) throws ReflectionException {
try {
if (isPublic(writeMethod)) {
writeMethod.invoke(obj, new Object[]{value});
writeMethod.invoke(obj, value);
} else {
throw new ReflectionException("Cannot set the value of " + this + ", as it is read-only.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/fluentinterface/BuilderProxyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.internal.matchers.IsCollectionContaining.hasItem;

@RunWith(Parameterized.class)
public class BuilderProxyTest {
Expand Down

0 comments on commit 780e204

Please sign in to comment.