Skip to content

Commit

Permalink
Simplify condition and narrow checkstyle exception.
Browse files Browse the repository at this point in the history
(cherry picked from commit f655975)
  • Loading branch information
cstancu authored and gilles-duboscq committed Aug 8, 2019
1 parent 8a9fb51 commit a9233dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,7 @@ private static void set(Object array, int index, Object value) {
return;
}
} else if (array instanceof Object[]) {
if (value == null) {
((Object[]) array)[index] = null;
return;
} else if (array.getClass().getComponentType().isAssignableFrom(value.getClass())) {
if (value == null || array.getClass().getComponentType().isAssignableFrom(value.getClass())) {
((Object[]) array)[index] = value;
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*/
package com.oracle.svm.test;

// Checkstyle: off
// Checkstyle: allow reflection

import java.lang.reflect.Array;

import org.junit.Assert;
Expand Down

0 comments on commit a9233dc

Please sign in to comment.