File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
main/java/com/nordstrom/common/file
test/java/com/nordstrom/common/file Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ public String getNewName() {
267267 */
268268 public static String findExecutableOnSystemPath (final String nameOrPath ) {
269269 List <String > paths = getSystemPathList ();
270- paths .add (0 , "" );
270+ paths .add (0 , null ); // check full path first
271271 for (String path : paths ) {
272272 for (String ending : ENDINGS ) {
273273 File file = new File (path , nameOrPath + ending );
Original file line number Diff line number Diff line change @@ -146,6 +146,13 @@ public void testFindExecutableOnSystemPath() {
146146 assertNotNull (path );
147147 }
148148
149+ @ Test
150+ public void testFindExecutableByFullPath () {
151+ String javaPath = System .getProperty ("java.home" ) + File .separator + "bin" + File .separator + "java" ;
152+ String path = PathUtils .findExecutableOnSystemPath (javaPath );
153+ assertNotNull (path );
154+ }
155+
149156 @ Test
150157 public void testGetSystemPath () {
151158 String systemPath = PathUtils .getSystemPath ();
You can’t perform that action at this time.
0 commit comments