Created
February 6, 2013 19:55
-
-
Save cancerberoSgx/4725277 to your computer and use it in GitHub Desktop.
a "negative" bug - Arrays.fill() is not throwing expected index exceptions IllegalArgumentException and ArrayIndexOutOfBoundsException - in this example with boolean, but fails with all types:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean[] b3 = new boolean[2]; | |
try { | |
Arrays.fill(b3, 2, 1, false); | |
Window.alert("error 1 - IllegalArgumentException expected"); | |
} catch (IllegalArgumentException e) { | |
} | |
try { | |
Arrays.fill(b3, -1, 1, false); | |
Window.alert("error 1 - ArrayIndexOutOfBoundsException expected"); | |
} catch (ArrayIndexOutOfBoundsException e) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment