@@ -113,8 +113,7 @@ public int cloneCmd(@Parameters(index = "0") String url) {
113113
114114 // Launching Editor on the Cloned Directory
115115 System .out .println ("Launching Editor Now..." );
116- GenericIDE genericIde = new GenericIDE (ide ) ;
117- genericIde .getIDE ().launch_editor (directory , ide , directory .toAbsolutePath ().toString (),filePath );
116+ getIDE (ide ).launch_editor (directory , ide , directory .toAbsolutePath ().toString (),filePath );
118117
119118 } catch (Exception e ) {
120119 throw new IllegalStateException (e );
@@ -295,49 +294,22 @@ public static abstract class IDE{
295294
296295 }
297296
298- public static class GenericIDE extends IDE {
299-
300- IDE ide ;
301-
302- GenericIDE (){
303- // Default Constructor
304- }
305-
306- GenericIDE (String ide ){
307- setIDE (ide );
308- }
309-
310- public IDE getIDE (){
311- //Return Current IDE
312- return ide ;
313- }
314-
315- public IDE getIDE (String ide ){
316- // Will return IDE based on String
317- switch (ide ){
318- case "code" :
319- case "code.cmd" :
320- return new VsCode ();
321-
322- case "idea" :
323- case "idea64.exe" :
324- return new IntelliJIdea ();
325-
326- case "eclipse" :
327- case "eclipse.exe" :
328- return new Eclipse ();
329- default :
330- throw new IllegalArgumentException ("IDE not supported" );
331- }
332-
333- }
334-
335- public void setIDE (String ide ){
336- this .ide = getIDE (ide );
337- }
338-
339- public void launch_editor (Path directory , String ide , String path , String filePath )throws IOException , InterruptedException {
340- runCommand (directory .getParent (),ide ,path ,filePath );
297+ public static IDE getIDE (String ide ){
298+ // Will return IDE based on String
299+ switch (ide ){
300+ case "code" :
301+ case "code.cmd" :
302+ return new VsCode ();
303+
304+ case "idea" :
305+ case "idea64.exe" :
306+ return new IntelliJIdea ();
307+
308+ case "eclipse" :
309+ case "eclipse.exe" :
310+ return new Eclipse ();
311+ default :
312+ throw new IllegalArgumentException ("IDE not supported" );
341313 }
342314
343315 }
@@ -352,7 +324,7 @@ public void launch_editor(Path directory, String ide, String path, String fileP
352324 runCommand (directory .getParent (), ide ,"-g" ,path ,filePath );
353325 }
354326 else {
355- new GenericIDE (). launch_editor (directory .getParent (),ide ,path ,filePath );
327+ runCommand (directory .getParent (),ide ,path ,filePath );
356328 }
357329 }
358330 }
@@ -370,7 +342,6 @@ public void launch_editor(Path directory, String ide, String path, String fileP
370342 }
371343 else {
372344 runCommand (directory .getParent (),ide ,path ,filePath );
373- new GenericIDE ().launch_editor (directory .getParent (),ide ,path ,filePath );
374345 }
375346 }
376347 }
@@ -389,7 +360,6 @@ public void launch_editor(Path directory, String ide, String path, String fileP
389360 }
390361 else {
391362 runCommand (directory .getParent (),ide ,path ,filePath );
392- new GenericIDE ().launch_editor (directory .getParent (),ide ,path ,filePath );
393363 }
394364 }
395365 }
0 commit comments