langtools/test/tools/lib/toolbox/JavacTask.java
changeset 44690 aec722d1b538
parent 40308 274367a99f98
equal deleted inserted replaced
44689:53c703004306 44690:aec722d1b538
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   285             switch (mode == null ? Task.Mode.API : mode) {
   285             switch (mode == null ? Task.Mode.API : mode) {
   286                 case API:
   286                 case API:
   287                     rc = runAPI(direct.pw);
   287                     rc = runAPI(direct.pw);
   288                     break;
   288                     break;
   289                 case CMDLINE:
   289                 case CMDLINE:
       
   290                     if (fileManager != null) {
       
   291                         throw new IllegalStateException("file manager set in CMDLINE mode");
       
   292                     }
   290                     rc = runCommand(direct.pw);
   293                     rc = runCommand(direct.pw);
   291                     break;
   294                     break;
   292                 default:
   295                 default:
   293                     throw new IllegalStateException();
   296                     throw new IllegalStateException("unknown mode " + mode);
   294             }
   297             }
   295         } catch (IOException e) {
   298         } catch (IOException e) {
   296             toolBox.out.println("Exception occurred: " + e);
   299             toolBox.out.println("Exception occurred: " + e);
   297             rc = 99;
   300             rc = 99;
   298         } finally {
   301         } finally {