|
16 | 16 |
|
17 | 17 | import java.io.IOException;
|
18 | 18 | import java.io.OutputStream;
|
19 |
| -import java.lang.reflect.InvocationTargetException; |
20 |
| -import java.lang.reflect.Method; |
21 | 19 | import java.net.URI;
|
22 | 20 | import java.util.ArrayList;
|
23 | 21 | import java.util.LinkedHashMap;
|
|
28 | 26 | import org.eclipse.cdt.core.IErrorParser2;
|
29 | 27 | import org.eclipse.cdt.core.IMarkerGenerator;
|
30 | 28 | import org.eclipse.cdt.core.ProblemMarkerInfo;
|
| 29 | +import org.eclipse.cdt.internal.core.IErrorMarkeredOutputStream; |
31 | 30 | import org.eclipse.cdt.utils.EFSExtensionManager;
|
32 | 31 | import org.eclipse.core.resources.IProject;
|
33 | 32 | import org.eclipse.core.resources.IResource;
|
|
43 | 42 | *
|
44 | 43 | * @noextend This class is not intended to be subclassed by clients.
|
45 | 44 | */
|
| 45 | +@SuppressWarnings("restriction") |
46 | 46 | public class ErrorParserManager extends OutputStream {
|
47 | 47 | /**
|
48 | 48 | * The list of error parsers stored in .project for 3.X projects
|
@@ -262,28 +262,12 @@ private void outputLine(String line, ProblemMarkerInfo marker) {
|
262 | 262 | String l = line + "\n"; //$NON-NLS-1$
|
263 | 263 | if ( outputStream == null ) return;
|
264 | 264 | try {
|
265 |
| - Class<?> c = outputStream.getClass(); |
266 |
| - Method m = null; |
267 |
| - try { |
268 |
| - if (marker != null) { |
269 |
| - m = c.getDeclaredMethod("write", String.class, ProblemMarkerInfo.class); |
270 |
| - if (m != null) { |
271 |
| - m.invoke(outputStream, l, marker); |
272 |
| - return; |
273 |
| - } |
| 265 | + if (marker != null) { |
| 266 | + if (outputStream instanceof IErrorMarkeredOutputStream) { |
| 267 | + IErrorMarkeredOutputStream mos = (IErrorMarkeredOutputStream)outputStream; |
| 268 | + mos.write(l, marker); |
274 | 269 | }
|
275 |
| - } catch (SecurityException e) { |
276 |
| - // do nothing |
277 |
| - } catch (NoSuchMethodException e) { |
278 |
| - // do nothing |
279 |
| - } catch (IllegalArgumentException e) { |
280 |
| - // do nothing |
281 |
| - } catch (IllegalAccessException e) { |
282 |
| - // do nothing |
283 |
| - AutotoolsPlugin.log(e); |
284 |
| - } catch (InvocationTargetException e) { |
285 |
| - // do nothing |
286 |
| - } |
| 270 | + } |
287 | 271 | byte[] b = l.getBytes();
|
288 | 272 | outputStream.write(b, 0, b.length);
|
289 | 273 | } catch (IOException e) {
|
|
0 commit comments