File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
approvaltests/src/main/java/org/approvaltests/reporters/intellij Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ private static String[] getRunningPrograms()
4141 Class <?> processHandleClass = Class .forName ("java.lang.ProcessHandle" );
4242 Method allProcessesMethod = processHandleClass .getMethod ("allProcesses" );
4343 Method infoMethod = processHandleClass .getMethod ("info" );
44- // Get the ProcessHandle.Info interface to access the command() method
4544 Class <?> processInfoClass = Class .forName ("java.lang.ProcessHandle$Info" );
4645 Method commandMethod = processInfoClass .getMethod ("command" );
4746 @ SuppressWarnings ("unchecked" )
@@ -58,11 +57,10 @@ private static String[] getRunningPrograms()
5857 }
5958 catch (Exception e )
6059 {
61- System .out .println ("Failed to get command for process: " + e .getMessage ());
6260 return Optional .<String > empty ();
6361 }
6462 });
65- return processes .filter (Optional ::isPresent ).map (c -> c . get () ).toArray (String []::new );
63+ return processes .filter (Optional ::isPresent ).map (Optional :: get ).toArray (String []::new );
6664 }
6765 finally
6866 {
@@ -71,7 +69,6 @@ private static String[] getRunningPrograms()
7169 }
7270 catch (Exception e )
7371 {
74- System .out .println ("Failed to get running programs: " + e .getMessage ());
7572 return new String [0 ];
7673 }
7774 }
You can’t perform that action at this time.
0 commit comments