Skip to content

Commit 055c999

Browse files
committed
Fix problem with pkg_config error marking in configuration.
2011-05-19 Jeff Johnston <[email protected]> * src/org/eclipse/linuxtools/internal/cdt/autotools/core/ErrorParserManager.java (outputLine): Fix to use IErrorMarkeredOutputStream interface rather than reflection.
1 parent 10b8c41 commit 055c999

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

autotools/org.eclipse.linuxtools.cdt.autotools.core/ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2011-05-19 Jeff Johnston <[email protected]>
2+
3+
* src/org/eclipse/linuxtools/internal/cdt/autotools/core/ErrorParserManager.java (outputLine): Fix
4+
to use IErrorMarkeredOutputStream interface rather than reflection.
5+
16
2011-04-27 Jeff Johnston <[email protected]>
27

38
Resolves #343875

autotools/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/ErrorParserManager.java

+7-23
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
import java.io.IOException;
1818
import java.io.OutputStream;
19-
import java.lang.reflect.InvocationTargetException;
20-
import java.lang.reflect.Method;
2119
import java.net.URI;
2220
import java.util.ArrayList;
2321
import java.util.LinkedHashMap;
@@ -28,6 +26,7 @@
2826
import org.eclipse.cdt.core.IErrorParser2;
2927
import org.eclipse.cdt.core.IMarkerGenerator;
3028
import org.eclipse.cdt.core.ProblemMarkerInfo;
29+
import org.eclipse.cdt.internal.core.IErrorMarkeredOutputStream;
3130
import org.eclipse.cdt.utils.EFSExtensionManager;
3231
import org.eclipse.core.resources.IProject;
3332
import org.eclipse.core.resources.IResource;
@@ -43,6 +42,7 @@
4342
*
4443
* @noextend This class is not intended to be subclassed by clients.
4544
*/
45+
@SuppressWarnings("restriction")
4646
public class ErrorParserManager extends OutputStream {
4747
/**
4848
* The list of error parsers stored in .project for 3.X projects
@@ -262,28 +262,12 @@ private void outputLine(String line, ProblemMarkerInfo marker) {
262262
String l = line + "\n"; //$NON-NLS-1$
263263
if ( outputStream == null ) return;
264264
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);
274269
}
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+
}
287271
byte[] b = l.getBytes();
288272
outputStream.write(b, 0, b.length);
289273
} catch (IOException e) {

0 commit comments

Comments
 (0)