Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Kong2009-05-12 11:01:02 -0400
committerVivian Kong2009-05-12 11:01:02 -0400
commit9e62905032b90008992bcae79750fc4b7573ef54 (patch)
tree8f578b92c0733ad7d3ceb16f7495ffea167eb874
parent689a5b183f2a008e96ba0359326596aa75ba350a (diff)
downloadorg.eclipse.cdt-9e62905032b90008992bcae79750fc4b7573ef54.tar.gz
org.eclipse.cdt-9e62905032b90008992bcae79750fc4b7573ef54.tar.xz
org.eclipse.cdt-9e62905032b90008992bcae79750fc4b7573ef54.zip
bug 268840
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java20
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java56
2 files changed, 24 insertions, 52 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
index aee6dfd21b..3a9b53c23b 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ import org.eclipse.core.runtime.Path;
public class SCDMakefileGenerator extends DefaultRunSIProvider {
private static final String ENDL = System.getProperty("line.separator"); //$NON-NLS-1$
private static final String DENDL = ENDL+ENDL;
- private String fMakeCommand = "-f ${project_name}_scd.mk ";
+ private String fMakeCommand = "-f ${project_name}_scd.mk "; //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#initialize()
@@ -44,7 +44,7 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
protected boolean initialize() {
String args = buildInfo.getProviderRunArguments(providerId);
if (null == args)
- args = " -E -P -v -dD ";
+ args = " -E -P -v -dD "; //$NON-NLS-1$
else {
int nPos = args.indexOf('|');
if(nPos > 0) {
@@ -106,7 +106,7 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
buffer.append(DENDL);
}
- File makefile = new File(fWorkingDirectory.toFile(), getMakeFileName(projectName)); //$NON-NLS-1$
+ File makefile = new File(fWorkingDirectory.toFile(), getMakeFileName(projectName));
try {
PrintStream ps = new PrintStream(new FileOutputStream(makefile));
ps.println(buffer.toString());
@@ -128,10 +128,10 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
for(String arg : makeArgs) {
if(found)
return arg;
- if(arg.equals("-f"))
+ if(arg.equals("-f")) //$NON-NLS-1$
found = true;
}
- return projectName+"_scd.mk";
+ return projectName+"_scd.mk"; //$NON-NLS-1$
}
@@ -143,18 +143,18 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
resource.getProject().getName());
string = string.replaceAll("\\$\\{plugin_state_location\\}", //$NON-NLS-1$
MakeCorePlugin.getWorkingDirectory().toString());
- string = string.replaceAll("\\$\\{specs_file\\}",
- GCCScannerConfigUtil.C_SPECS_FILE ); //$NON-NLS-1$
+ string = string.replaceAll("\\$\\{specs_file\\}", //$NON-NLS-1$
+ GCCScannerConfigUtil.C_SPECS_FILE );
return string;
}
@Override
protected String[] getCommandLineOptions() {
- return ScannerConfigUtil.tokenizeStringWithQuotes(fMakeCommand, "\"");
+ return ScannerConfigUtil.tokenizeStringWithQuotes(fMakeCommand, "\""); //$NON-NLS-1$
}
@Override
protected IPath getCommandToLaunch() {
- return new Path("make");
+ return new Path("make"); //$NON-NLS-1$
}
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java
index 5d82155895..0f52988d3c 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,16 +17,10 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.core.ProblemMarkerInfo;
import org.eclipse.cdt.core.model.ICModelMarker;
-import org.eclipse.cdt.make.core.MakeCorePlugin;
-import org.eclipse.cdt.make.core.messages.Messages;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
/**
* Scanner config discovery related marker generator
@@ -55,7 +49,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IMarkerGenerator#addMarker(org.eclipse.cdt.core.ProblemMarkerInfo)
*/
- public void addMarker(final ProblemMarkerInfo problemMarkerInfo) {
+ public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
try {
IMarker[] cur = problemMarkerInfo.file.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ONE);
/*
@@ -71,41 +65,19 @@ public class SCMarkerGenerator implements IMarkerGenerator {
}
}
}
-
- // we have to add the marker in the job or we can deadlock other
- // threads that are responding to a resource delta by doing something
- // that accesses the project description
- Job markerJob = new Job(Messages.SCMarkerGenerator_0) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IMarker marker;
- try {
- marker = problemMarkerInfo.file.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
- marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
- marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity));
- marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);
- marker.setAttribute(IMarker.CHAR_START, -1);
- marker.setAttribute(IMarker.CHAR_END, -1);
-
- if (problemMarkerInfo.variableName != null) {
- marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
- }
- if (problemMarkerInfo.externalPath != null) {
- marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, problemMarkerInfo.externalPath.toOSString());
- }
- } catch (CoreException e) {
- return new Status(Status.ERROR, MakeCorePlugin.getUniqueIdentifier(), Messages.SCMarkerGenerator_1, e);
- }
-
- return Status.OK_STATUS;
- }
-
- };
-
- markerJob.setRule(problemMarkerInfo.file);
- markerJob.schedule();
-
+ IMarker marker = problemMarkerInfo.file.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
+ marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
+ marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity));
+ marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);
+ marker.setAttribute(IMarker.CHAR_START, -1);
+ marker.setAttribute(IMarker.CHAR_END, -1);
+ if (problemMarkerInfo.variableName != null) {
+ marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
+ }
+ if (problemMarkerInfo.externalPath != null) {
+ marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, problemMarkerInfo.externalPath.toOSString());
+ }
}
catch (CoreException e) {
CCorePlugin.log(e.getStatus());

Back to the top