--- old/test/java/io/pathNames/General.java 2016-12-05 14:29:38.000000000 +0800 +++ new/test/java/io/pathNames/General.java 2016-12-05 14:29:38.000000000 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ private static int gensymCounter = 0; protected static final String userDir = System.getProperty("user.dir"); + private static final Path userDirPath = Paths.get(userDir).toAbsolutePath(); protected static String baseDir = null; protected static String relative = null; @@ -337,6 +338,10 @@ String ans, String ask) throws Exception { + if (!Paths.get(ans).toAbsolutePath().startsWith(userDirPath)) { + return; + } + int d = depth - 1; File f = new File(ans); String n;