This post explains why and how ArrayIndexOutOfBoundsException is thrown from Java Path.normalize() for Empty Path directly from the angle of UnixPath source code.
ArrayIndexOutOfBoundsException from Java Path.normalize() for Empty Path
Well, what happens is that the following simple one line statement throws and ArrayIndexOutOfBoundsException:
public class App { public static void main( String[] args ) { Paths.get("").normalize(); System.out.println( "Hello World!" ); } } /* The following exception is thrown: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at sun.nio.fs.UnixPath.normalize(UnixPath.java:508) at net.tech-wonderland.app.App.main(App.java:11) */
Read full article from ArrayIndexOutOfBoundsException from Java Path.normalize() for Empty Path – Sigmainfy – Technical blog to learn, share and to inspire
No comments:
Post a Comment