133 task.analyze();
134 ise = null;
135 } catch (IllegalStateException e) {
136 ise = e;
137 }
138
139 // sadly, command line errors are not (yet?) reported to
140 // the diag listener
141 String out = sw.toString();
142 if (!out.isEmpty())
143 System.err.println(out.trim());
144
145 switch (t) {
146 case JDK1_8:
147 if (ise != null)
148 error("unexpected exception from compiler: " + ise);
149 break;
150 case JDK1_9:
151 case JDK1_10:
152 case JDK1_11:
153 if (p == Profile.DEFAULT)
154 break;
155 if (ise == null)
156 error("IllegalStateException not thrown as expected");
157 else if (!ise.getMessage().contains("option -profile " +
158 "not allowed with target " + t.name)) {
159 error("exception not thrown as expected: " + ise);
160 }
161 break;
162 default:
163 if (p == Profile.DEFAULT)
164 break;
165 if (ise == null)
166 error("IllegalStateException not thrown as expected");
167 else if (!ise.getMessage().contains("profile " + p.name
168 + " is not valid for target release " + t.name)) {
169 error("exception not thrown as expected: " + ise);
170 }
171 break;
172 }
|
133 task.analyze();
134 ise = null;
135 } catch (IllegalStateException e) {
136 ise = e;
137 }
138
139 // sadly, command line errors are not (yet?) reported to
140 // the diag listener
141 String out = sw.toString();
142 if (!out.isEmpty())
143 System.err.println(out.trim());
144
145 switch (t) {
146 case JDK1_8:
147 if (ise != null)
148 error("unexpected exception from compiler: " + ise);
149 break;
150 case JDK1_9:
151 case JDK1_10:
152 case JDK1_11:
153 case JDK1_12:
154 if (p == Profile.DEFAULT)
155 break;
156 if (ise == null)
157 error("IllegalStateException not thrown as expected");
158 else if (!ise.getMessage().contains("option -profile " +
159 "not allowed with target " + t.name)) {
160 error("exception not thrown as expected: " + ise);
161 }
162 break;
163 default:
164 if (p == Profile.DEFAULT)
165 break;
166 if (ise == null)
167 error("IllegalStateException not thrown as expected");
168 else if (!ise.getMessage().contains("profile " + p.name
169 + " is not valid for target release " + t.name)) {
170 error("exception not thrown as expected: " + ise);
171 }
172 break;
173 }
|