Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-11-17 17:34:21 -0500
committerAndrew Gvozdev2011-11-17 17:34:21 -0500
commit2a1cddd71635c39ae336ba43bb89cecbfb09e21f (patch)
treec7a504d11610c16c23c34e29bba23ba0b280bb81 /build/org.eclipse.cdt.make.core
parente47db971decd8fd15ce52984be3de50b6eaa24de (diff)
downloadorg.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.gz
org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.xz
org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.zip
auto-clean: @Override annotations + organize imports + unnecessary
casts/$NON-NLS + trailing white spaces
Diffstat (limited to 'build/org.eclipse.cdt.make.core')
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java9
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java31
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java12
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java6
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java13
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java5
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java1
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java34
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigNature.java30
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java47
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java2
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java35
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java19
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/ConfigSupportNature.java4
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java24
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java6
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java4
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java7
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java12
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java5
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java4
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java3
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java7
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java20
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java28
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java1
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java16
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java5
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java2
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java1
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java2
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java14
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java16
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java269
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java11
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java29
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java92
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java49
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java12
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java40
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java44
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java14
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java17
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java13
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java15
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/jobs/SCJobsUtil.java40
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java48
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java26
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java179
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java117
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCMarkerGenerator.java16
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java234
52 files changed, 1015 insertions, 675 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
index eafa18288f..df6f7d2ee5 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
@@ -21,8 +21,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CommandLauncher;
@@ -126,6 +126,7 @@ public class MakeBuilder extends ACBuilder {
try {
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) {
invokeMake(CLEAN_BUILD, info, monitor);
}
@@ -170,7 +171,7 @@ public class MakeBuilder extends ACBuilder {
if(pathFromURI == null) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.PLUGIN_ID, MakeMessages.getString("MakeBuilder.ErrorWorkingDirectory"), null)); //$NON-NLS-1$
}
-
+
IPath workingDirectory = new Path(pathFromURI);
String[] targets = getTargets(kind, info);
@@ -288,7 +289,7 @@ public class MakeBuilder extends ACBuilder {
/**
* Refresh project. Can be overridden to not call actual refresh or to do something else.
* Method is called after build is complete.
- *
+ *
* @since 6.0
*/
protected void refreshProject(IProject project) {
@@ -297,7 +298,7 @@ public class MakeBuilder extends ACBuilder {
// to Eclipse, files may have been created/modified and we will be out-of-sync.
// The caveat is for huge projects, it may take sometimes at every build.
// project.refreshLocal(IResource.DEPTH_INFINITE, null);
-
+
// use the refresh scope manager to refresh
RefreshScopeManager refreshManager = RefreshScopeManager.getInstance();
IWorkspaceRunnable runnable = refreshManager.getRefreshRunnable(project);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java
index 11c6ea3d6c..92f34491ac 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java
@@ -60,7 +60,7 @@ import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -74,13 +74,14 @@ public class MakeCorePlugin extends Plugin {
fEncoding = encoding != null ? encoding : ResourcesPlugin.getEncoding();
}
+ @Override
public Reader getReader(URI fileURI) throws IOException {
try {
final IFileStore store = EFS.getStore(fileURI);
final IFileInfo info = store.fetchInfo();
if (!info.exists() || info.isDirectory())
throw new IOException();
-
+
return new InputStreamReader(store.openInputStream(EFS.NONE, null), fEncoding);
} catch (CoreException e) {
MakeCorePlugin.log(e);
@@ -88,7 +89,7 @@ public class MakeCorePlugin extends Plugin {
}
}
}
-
+
public static final String PLUGIN_ID = "org.eclipse.cdt.make.core"; //$NON-NLS-1$
public static final String MAKE_PROJECT_ID = MakeCorePlugin.getUniqueIdentifier() + ".make"; //$NON-NLS-1$
public static final String OLD_BUILDER_ID = "org.eclipse.cdt.core.cbuilder"; //$NON-NLS-1$
@@ -229,8 +230,8 @@ public class MakeCorePlugin extends Plugin {
/**
* Create an IMakefile using the given IMakefileReaderProvider to fetch
- * contents by name.
- *
+ * contents by name.
+ *
* @param fileURI URI of main file
* @param makefileReaderProvider may be <code>null</code> for EFS IFileStore reading
*/
@@ -263,7 +264,7 @@ public class MakeCorePlugin extends Plugin {
/**
* Create an IMakefile using EFS to fetch contents.
- *
+ *
* @param fileURI URI of main file
*/
public static IMakefile createMakefile(URI fileURI, boolean isGnuStyle, String[] makefileDirs) {
@@ -273,7 +274,7 @@ public class MakeCorePlugin extends Plugin {
public IMakefile createMakefile(IFile file) throws CoreException {
return createMakefile(EFS.getStore(file.getLocationURI()), isMakefileGNUStyle(), getMakefileDirs(), file.getCharset());
}
-
+
@Override
public void stop(BundleContext context) throws Exception {
try {
@@ -309,7 +310,7 @@ public class MakeCorePlugin extends Plugin {
Map<String, String> args, String builderID) {
return ScannerConfigInfoFactory.create(args, builderID);
}
-
+
public static IPath getWorkingDirectory() {
return MakeCorePlugin.getDefault().getStateLocation();
}
@@ -337,7 +338,7 @@ public class MakeCorePlugin extends Plugin {
IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
IConfigurationElement[] runElement = configElements[j].getChildren("run"); //$NON-NLS-1$
- if (runElement.length > 0) {
+ if (runElement.length > 0) {
IExternalScannerInfoProvider builder = (IExternalScannerInfoProvider) runElement[0].createExecutableExtension("class"); //$NON-NLS-1$
return builder;
}
@@ -345,7 +346,7 @@ public class MakeCorePlugin extends Plugin {
}
}
}
- }
+ }
catch (CoreException e) {
log(e);
}
@@ -372,13 +373,13 @@ public class MakeCorePlugin extends Plugin {
if (id != null && (id.equals(commandId) || id.equals("all"))) { //$NON-NLS-1$
parserIds.add(parserId);
}
- }
+ }
}
return parserIds.toArray(empty);
}
return empty;
}
-
+
/**
* @return parser - parser object identified by the parserId
*/
@@ -402,14 +403,14 @@ public class MakeCorePlugin extends Plugin {
}
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#startup()
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
-
+
//Set debug tracing options
configurePluginDebugOptions();
// Scanner config discovery setup
@@ -418,7 +419,7 @@ public class MakeCorePlugin extends Plugin {
private static final String SCANNER_CONFIG = MakeCorePlugin.getUniqueIdentifier() + "/debug/scdiscovery"; //$NON-NLS-1$
/**
- *
+ *
*/
private void configurePluginDebugOptions() {
if (isDebugging()) {
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java
index 6ba156a67e..ffd1230fba 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java
@@ -22,7 +22,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class MakeProjectNature implements IProjectNature {
-
+
public final static String NATURE_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeNature"; //$NON-NLS-1$
private IProject fProject;
@@ -49,7 +49,7 @@ public class MakeProjectNature implements IProjectNature {
}
return null;
}
-
+
/**
* Update the Java command in the build spec (replace existing one if present,
* add one first if none).
@@ -78,7 +78,7 @@ public class MakeProjectNature implements IProjectNature {
// Commit the spec change into the project
description.setBuildSpec(newCommands);
return description;
- }
+ }
/**
* Adds a builder to the build spec for the given project.
@@ -130,6 +130,7 @@ public class MakeProjectNature implements IProjectNature {
/**
* @see IProjectNature#configure
*/
+ @Override
public void configure() throws CoreException {
addBuildSpec();
IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(MakeCorePlugin.getDefault().getPluginPreferences(), MakeBuilder.BUILDER_ID, false);
@@ -142,7 +143,7 @@ public class MakeProjectNature implements IProjectNature {
projectInfo.setAutoBuildEnable(info.isAutoBuildEnable());
projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, "")); //$NON-NLS-1$
-
+
projectInfo.setIncrementalBuildEnable(info.isIncrementalBuildEnabled());
projectInfo.setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, info.getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, "")); //$NON-NLS-1$
@@ -163,6 +164,7 @@ public class MakeProjectNature implements IProjectNature {
/**
* @see IProjectNature#deconfigure
*/
+ @Override
public void deconfigure() throws CoreException {
removeBuildSpec();
}
@@ -170,6 +172,7 @@ public class MakeProjectNature implements IProjectNature {
/**
* @see IProjectNature#getProject
*/
+ @Override
public IProject getProject() {
return fProject;
}
@@ -177,6 +180,7 @@ public class MakeProjectNature implements IProjectNature {
/**
* @see IProjectNature#setProject
*/
+ @Override
public void setProject(IProject project) {
fProject = project;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java
index 1e607a55cb..f024c515b0 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java
@@ -69,18 +69,20 @@ public class MakeScannerInfo implements IScannerInfo {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
*/
+ @Override
public synchronized String[] getIncludePaths() {
return getPathList().toArray(new String[getPathList().size()]);
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
*/
+ @Override
public synchronized Map<String, String> getDefinedSymbols() {
// Return the defined symbols for the default configuration
HashMap<String, String> symbols = new HashMap<String, String>();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java
index 20ae16a0a7..994334c3e5 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java
@@ -40,7 +40,7 @@ import org.w3c.dom.Element;
/**
* @deprecated @author DInglis
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -100,7 +100,7 @@ public class MakeScannerProvider extends ScannerProvider {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource)
*/
@Override
@@ -116,7 +116,7 @@ public class MakeScannerProvider extends ScannerProvider {
* Loads the build file and parses the nodes for build information. The information is then associated with the resource for the
* duration of the session.
*/
- private MakeScannerInfo loadScannerInfo(IProject project) throws CoreException {
+ private MakeScannerInfo loadScannerInfo(IProject project) throws CoreException {
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project);
ICStorageElement storage = descriptor.getProjectStorageElement(CDESCRIPTOR_ID);
@@ -143,7 +143,7 @@ public class MakeScannerProvider extends ScannerProvider {
ICProject cProject = CoreModel.getDefault().create(info.getProject());
IPathEntry[] entries = cProject.getRawPathEntries();
List<IPathEntry> cPaths = new ArrayList<IPathEntry>(Arrays.asList(entries));
-
+
Iterator<IPathEntry> cpIter = cPaths.iterator();
while(cpIter.hasNext()) {
int kind = cpIter.next().getEntryKind();
@@ -187,7 +187,8 @@ public class MakeScannerProvider extends ScannerProvider {
*/
public static void updateScannerInfo(final MakeScannerInfo scannerInfo) throws CoreException {
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
-
+
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
IProject project = scannerInfo.getProject();
@@ -202,6 +203,6 @@ public class MakeScannerProvider extends ScannerProvider {
descriptor.saveProjectData();
migrateToCPathEntries(scannerInfo);
}
- }, null);
+ }, null);
}
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java
index 85bfed8b3f..5daec5a792 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.make.core.makefile;
/**
* A Makefile can contain rules, macro definitons and comments.
* They are call directives.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -38,10 +38,11 @@ public interface IDirective {
/**
* Returns the makefile where the directive was found.
- *
+ *
* @return <code>IMakefile</code>
*/
IMakefile getMakefile();
+ @Override
String toString();
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java
index 6eaed888db..03326b0eef 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java
@@ -16,6 +16,7 @@ package org.eclipse.cdt.make.core.makefile;
*/
public interface ITarget {
+ @Override
String toString();
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java
index bc64ca11db..b87bcd1547 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfo.java
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.CoreException;
* Discovered portion of scanner configuration
* @deprecated as of CDT 4.0.
* @author vhirsl
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -38,16 +38,16 @@ public class DiscoveredScannerInfo implements IScannerInfo {
private ArrayList<String> activePaths;
private ArrayList<String> removedPaths;
-
+
private ArrayList<String> activeSymbols;
private ArrayList<String> removedSymbols;
private org.eclipse.cdt.make.core.MakeScannerInfo userInfo;
-
+
public DiscoveredScannerInfo(IProject project) {
this.project = project;
}
-
+
public IProject getProject() {
return project;
}
@@ -55,6 +55,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols()
*/
+ @Override
public synchronized Map<String, String> getDefinedSymbols() {
Map<String, String> dSymbols = ScannerConfigUtil.scSymbolEntryMap2Map(discoveredSymbols);
dSymbols.putAll(userInfo.getDefinedSymbols());
@@ -63,6 +64,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.IScannerInfo#getIncludePaths()
*/
+ @Override
public synchronized String[] getIncludePaths() {
String[] iPaths = new String[getUserIncludePaths().length + getActiveIncludePaths().length];
System.arraycopy(getUserIncludePaths(), 0, iPaths, 0, getUserIncludePaths().length);
@@ -77,7 +79,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
public synchronized void setUserScannerInfo( org.eclipse.cdt.make.core.MakeScannerInfo info) {
userInfo = info;
}
-
+
public LinkedHashMap<String, Boolean> getDiscoveredIncludePaths() {
if (discoveredPaths == null) {
return new LinkedHashMap<String, Boolean>();
@@ -88,7 +90,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
discoveredPaths = new LinkedHashMap<String, Boolean>(paths);
createPathLists();
}
-
+
/**
* Populates active and removed include path lists
*/
@@ -97,7 +99,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
aPaths.clear();
List<String> rPaths = getRemovedPathList();
rPaths.clear();
-
+
Set<String> paths = discoveredPaths.keySet();
for (String path : paths) {
Boolean removed = discoveredPaths.get(path);
@@ -120,7 +122,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
discoveredSymbols = new LinkedHashMap<String, SymbolEntry>(symbols);
createSymbolsLists();
}
-
+
/**
* Populates active and removed defined symbols sets
*/
@@ -129,7 +131,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
aSymbols.clear();
List<String> rSymbols = getRemovedSymbolsList();
rSymbols.clear();
-
+
aSymbols.addAll(ScannerConfigUtil.scSymbolsSymbolEntryMap2List(discoveredSymbols, true));
rSymbols.addAll(ScannerConfigUtil.scSymbolsSymbolEntryMap2List(discoveredSymbols, false));
}
@@ -141,12 +143,12 @@ public class DiscoveredScannerInfo implements IScannerInfo {
return userInfo.getIncludePaths();
}
public String[] getActiveIncludePaths() {
- return getActivePathList().toArray(new String[getActivePathList().size()]);
+ return getActivePathList().toArray(new String[getActivePathList().size()]);
}
public String[] getRemovedIncludePaths() {
return getRemovedPathList().toArray(new String[getRemovedPathList().size()]);
}
-
+
public String[] getUserSymbolDefinitions() {
if (userInfo == null) {
return new String[0];
@@ -154,10 +156,10 @@ public class DiscoveredScannerInfo implements IScannerInfo {
return userInfo.getPreprocessorSymbols();
}
public String[] getActiveSymbolDefinitions() {
- return getActiveSymbolsList().toArray(new String[getActiveSymbolsList().size()]);
+ return getActiveSymbolsList().toArray(new String[getActiveSymbolsList().size()]);
}
public String[] getRemovedSymbolDefinitions() {
- return getRemovedSymbolsList().toArray(new String[getRemovedSymbolsList().size()]);
+ return getRemovedSymbolsList().toArray(new String[getRemovedSymbolsList().size()]);
}
public String[] getPreprocessorSymbols() {
// user specified + active
@@ -168,7 +170,7 @@ public class DiscoveredScannerInfo implements IScannerInfo {
System.arraycopy(discActiveSymbols, 0, rv, userSymbols.length, discActiveSymbols.length);
return rv;
}
-
+
private List<String> getActivePathList() {
if (activePaths == null) {
activePaths = new ArrayList<String>();
@@ -189,14 +191,14 @@ public class DiscoveredScannerInfo implements IScannerInfo {
}
return activeSymbols;
}
-
+
private List<String> getRemovedSymbolsList() {
if (removedSymbols == null) {
removedSymbols = new ArrayList<String>();
}
return removedSymbols;
}
-
+
public void update() throws CoreException {
DiscoveredScannerInfoProvider.updateScannerInfo(this);
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigNature.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigNature.java
index b278f7e3ed..3b9e0512a8 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigNature.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigNature.java
@@ -30,21 +30,22 @@ import org.eclipse.core.runtime.CoreException;
/**
* @deprecated as of CDT 4.0. Used by legacy CDT 3.X projects.
* Replaced by ScannerConfigNature in org.eclipse.cdt.managedbuilder.core.
- *
+ *
* @see IProjectNature
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@Deprecated
public class ScannerConfigNature implements IProjectNature {
-
+
public final static String NATURE_ID = MakeCorePlugin.getUniqueIdentifier() + ".ScannerConfigNature"; //$NON-NLS-1$
private IProject fProject;
/**
* @see IProjectNature#configure
*/
+ @Override
public void configure() throws CoreException {
IProjectDescription description = getProject().getDescription();
ICommand[] commands = description.getBuildSpec();
@@ -60,13 +61,14 @@ public class ScannerConfigNature implements IProjectNature {
newCommands[commands.length] = command;
description.setBuildSpec(newCommands);
getProject().setDescription(description, null);
-
+
// set default project scanner config settings
}
/**
* @see IProjectNature#deconfigure
*/
+ @Override
public void deconfigure() throws CoreException {
IProjectDescription description = getProject().getDescription();
ICommand[] commands = description.getBuildSpec();
@@ -85,6 +87,7 @@ public class ScannerConfigNature implements IProjectNature {
/**
* @see IProjectNature#getProject
*/
+ @Override
public IProject getProject() {
return fProject;
}
@@ -92,10 +95,11 @@ public class ScannerConfigNature implements IProjectNature {
/**
* @see IProjectNature#setProject
*/
+ @Override
public void setProject(IProject project) {
fProject = project;
}
-
+
public static void addScannerConfigNature(IProject project) throws CoreException {
IProjectDescription description = project.getDescription();
if (description.hasNature(NATURE_ID))
@@ -106,9 +110,9 @@ public class ScannerConfigNature implements IProjectNature {
newIds[ids.length] = NATURE_ID;
description.setNatureIds(newIds);
project.setDescription(description, null);
-
+
}
-
+
public static void removeScannerConfigNature(IProject project) throws CoreException {
IProjectDescription description = project.getDescription();
if (!description.hasNature(NATURE_ID))
@@ -152,7 +156,7 @@ public class ScannerConfigNature implements IProjectNature {
newCommands = new ICommand[oldCommands.length + 1];
System.arraycopy(oldCommands, 0, newCommands, 0, oldCommands.length);
newCommands[oldCommands.length] = newCommand;
- }
+ }
else {
for (int i = 0; i < oldCommands.length; i++) {
if (oldCommands[i] == oldCommand) {
@@ -175,19 +179,19 @@ public class ScannerConfigNature implements IProjectNature {
String selectedProfile = scPrefInfo.getSelectedProfileId();
IScannerConfigBuilderInfo2 scProjInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(
project, selectedProfile);
-
+
scProjInfo.setAutoDiscoveryEnabled(scPrefInfo.isAutoDiscoveryEnabled());
scProjInfo.setProblemReportingEnabled(scPrefInfo.isProblemReportingEnabled());
-
+
scProjInfo.setBuildOutputParserEnabled(scPrefInfo.isBuildOutputParserEnabled());
scProjInfo.setBuildOutputFileActionEnabled(scPrefInfo.isBuildOutputFileActionEnabled());
scProjInfo.setBuildOutputFilePath(scPrefInfo.getBuildOutputFilePath());
-
+
ScannerConfigProfile profile = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(selectedProfile);
List<String> providerIdList = scPrefInfo.getProviderIdList();
for (Iterator<String> i = providerIdList.iterator(); i.hasNext();) {
String providerId = i.next();
-
+
scProjInfo.setProviderOutputParserEnabled(providerId, scPrefInfo.isProviderOutputParserEnabled(providerId));
if (profile.getScannerInfoProviderElement(providerId).getProviderKind().equals(
ScannerConfigProfile.ScannerInfoProvider.RUN)) {
@@ -199,7 +203,7 @@ public class ScannerConfigNature implements IProjectNature {
}
}
scProjInfo.save();
-
+
// the last step is to add discovered paths container
ICProject cProject = CoreModel.getDefault().create(project);
IPathEntry[] rawPathEntries = CoreModel.getRawPathEntries(cProject);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java
index 1f619688c7..10bbd648e8 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java
@@ -57,14 +57,16 @@ public class BuildInfoFactory {
static final String BUILD_AUTO_ENABLED = PREFIX + ".enableAutoBuild"; //$NON-NLS-1$
static final String BUILD_ARGUMENTS = PREFIX + ".buildArguments"; //$NON-NLS-1$
static final String ENVIRONMENT = PREFIX + ".environment"; //$NON-NLS-1$
- static final String BUILD_APPEND_ENVIRONMENT = PREFIX + ".append_environment"; //$NON-NLS-1$
+ static final String BUILD_APPEND_ENVIRONMENT = PREFIX + ".append_environment"; //$NON-NLS-1$
private abstract static class AbstractBuildInfo implements IMakeBuilderInfo {
+ @Override
public void setUseDefaultBuildCmd(boolean on) throws CoreException {
putString(USE_DEFAULT_BUILD_CMD, new Boolean(on).toString());
}
+ @Override
public boolean isDefaultBuildCmd() {
if (getString(USE_DEFAULT_BUILD_CMD) == null) { // if no property
// then default to
@@ -74,6 +76,7 @@ public class BuildInfoFactory {
return getBoolean(USE_DEFAULT_BUILD_CMD);
}
+ @Override
public String getBuildAttribute(String name, String defaultValue) {
String value = getString(name);
if (value == null ) {
@@ -89,15 +92,17 @@ public class BuildInfoFactory {
value = getString(BuildInfoFactory.BUILD_TARGET_CLEAN);
} else if (IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL.equals(name)) {
value = getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL);
- }
- }
+ }
+ }
return value != null ? value : defaultValue != null ? defaultValue : ""; //$NON-NLS-1$
}
+ @Override
public void setBuildAttribute(String name, String value) throws CoreException {
putString(name, value);
}
+ @Override
public Map<String, String> getExpandedEnvironment() {
Map<String, String> env = getEnvironment();
HashMap<String, String> envMap = new HashMap<String, String>(env.entrySet().size());
@@ -121,11 +126,13 @@ public class BuildInfoFactory {
return envMap;
}
+ @Override
public void setBuildCommand(IPath location) throws CoreException {
putString(IMakeCommonBuildInfo.BUILD_COMMAND, null);
putString(BuildInfoFactory.BUILD_COMMAND, location.toString());
}
+ @Override
public IPath getBuildCommand() {
if (isDefaultBuildCmd()) {
String command = getBuildParameter("defaultCommand"); //$NON-NLS-1$
@@ -163,11 +170,13 @@ public class BuildInfoFactory {
protected abstract String getBuilderID();
+ @Override
public void setBuildLocation(IPath location) throws CoreException {
putString(IMakeCommonBuildInfo.BUILD_LOCATION, null);
putString(BuildInfoFactory.BUILD_LOCATION, location.toString());
}
+ @Override
public IPath getBuildLocation() {
String result = getBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION, getString(BuildInfoFactory.BUILD_LOCATION));
try {
@@ -177,6 +186,7 @@ public class BuildInfoFactory {
return new Path(result);
}
+ @Override
public String getBuildArguments() {
String result = getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, getString(BuildInfoFactory.BUILD_ARGUMENTS));
if (result == null) {
@@ -189,24 +199,29 @@ public class BuildInfoFactory {
return result;
}
+ @Override
public void setBuildArguments(String args) throws CoreException {
putString(IMakeCommonBuildInfo.BUILD_ARGUMENTS, null);
putString(BuildInfoFactory.BUILD_ARGUMENTS, args);
}
-
+
+ @Override
public void setStopOnError(boolean enabled) throws CoreException {
putString(STOP_ON_ERROR, new Boolean(enabled).toString());
}
+ @Override
public boolean isStopOnError() {
return getBoolean(STOP_ON_ERROR);
}
+ @Override
public void setAutoBuildTarget(String target) throws CoreException {
putString(IMakeBuilderInfo.BUILD_TARGET_AUTO, null);
putString(BuildInfoFactory.BUILD_TARGET_AUTO, target);
}
+ @Override
public String getAutoBuildTarget() {
String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, getString(BuildInfoFactory.BUILD_TARGET_AUTO));
try {
@@ -216,11 +231,13 @@ public class BuildInfoFactory {
return result;
}
+ @Override
public void setIncrementalBuildTarget(String target) throws CoreException {
putString(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, null);
putString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL, target);
}
+ @Override
public String getIncrementalBuildTarget() {
String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL,
getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL));
@@ -231,10 +248,12 @@ public class BuildInfoFactory {
return result;
}
+ @Override
public void setFullBuildTarget(String target) throws CoreException {
-
+
}
+ @Override
public String getFullBuildTarget() {
String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, getString(BuildInfoFactory.BUILD_TARGET_INCREMENTAL));
try {
@@ -244,11 +263,13 @@ public class BuildInfoFactory {
return result;
}
+ @Override
public void setCleanBuildTarget(String target) throws CoreException {
putString(IMakeBuilderInfo.BUILD_TARGET_CLEAN, null);
putString(BuildInfoFactory.BUILD_TARGET_CLEAN, target);
}
+ @Override
public String getCleanBuildTarget() {
String result = getBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, getString(BuildInfoFactory.BUILD_TARGET_CLEAN));
try {
@@ -258,38 +279,47 @@ public class BuildInfoFactory {
return result;
}
+ @Override
public void setAutoBuildEnable(boolean enabled) throws CoreException {
putString(BUILD_AUTO_ENABLED, new Boolean(enabled).toString());
}
+ @Override
public boolean isAutoBuildEnable() {
return getBoolean(BUILD_AUTO_ENABLED);
}
+ @Override
public void setIncrementalBuildEnable(boolean enabled) throws CoreException {
putString(BUILD_INCREMENTAL_ENABLED, new Boolean(enabled).toString());
}
+ @Override
public boolean isIncrementalBuildEnabled() {
return getBoolean(BUILD_INCREMENTAL_ENABLED);
}
+ @Override
public void setFullBuildEnable(boolean enabled) throws CoreException {
putString(BUILD_FULL_ENABLED, new Boolean(enabled).toString());
}
+ @Override
public boolean isFullBuildEnabled() {
return getBoolean(BUILD_FULL_ENABLED);
}
+ @Override
public void setCleanBuildEnable(boolean enabled) throws CoreException {
putString(BUILD_CLEAN_ENABLED, new Boolean(enabled).toString());
}
+ @Override
public boolean isCleanBuildEnabled() {
return getBoolean(BUILD_CLEAN_ENABLED);
}
+ @Override
public String[] getErrorParsers() {
String parsers = getString(ErrorParserManager.PREF_ERROR_PARSER);
if (parsers != null && parsers.length() > 0) {
@@ -303,6 +333,7 @@ public class BuildInfoFactory {
return new String[0];
}
+ @Override
public void setErrorParsers(String[] parsers) throws CoreException {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < parsers.length; i++) {
@@ -311,14 +342,17 @@ public class BuildInfoFactory {
putString(ErrorParserManager.PREF_ERROR_PARSER, buf.toString());
}
+ @Override
public Map<String, String> getEnvironment() {
return decodeMap(getString(ENVIRONMENT));
}
+ @Override
public void setEnvironment(Map<String, String> env) throws CoreException {
putString(ENVIRONMENT, encodeMap(env));
}
+ @Override
public boolean appendEnvironment() {
if (getString(BUILD_APPEND_ENVIRONMENT) != null) {
return getBoolean(BUILD_APPEND_ENVIRONMENT);
@@ -326,6 +360,7 @@ public class BuildInfoFactory {
return true;
}
+ @Override
public void setAppendEnvironment(boolean append) throws CoreException {
putString(BUILD_APPEND_ENVIRONMENT, new Boolean(append).toString());
}
@@ -345,7 +380,7 @@ public class BuildInfoFactory {
int ndx = 0;
while (ndx < envStr.length()) {
if (escapeChars.indexOf(envStr.charAt(ndx)) != -1) {
- if (envStr.charAt(ndx - 1) == escapeChar) {
+ if (envStr.charAt(ndx - 1) == escapeChar) {
// escaped '|' - remove '\' and continue on.
envStr.deleteCharAt(ndx - 1);
if (ndx == envStr.length()) {
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java
index bd3bf98258..f2b18f1e76 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java
@@ -26,6 +26,7 @@ import org.eclipse.core.runtime.Preferences;
@Deprecated
public class MakeProject implements ICOwner {
+ @Override
public void configure(ICDescriptor cDescriptor) throws CoreException {
cDescriptor.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
cDescriptor.remove(CCorePlugin.BUILDER_MODEL_ID);
@@ -33,6 +34,7 @@ public class MakeProject implements ICOwner {
updateIndexers(cDescriptor);
}
+ @Override
public void update(ICDescriptor cDescriptor, String extensionID) throws CoreException {
if (extensionID.equals(CCorePlugin.BINARY_PARSER_UNIQ_ID)) {
updateBinaryParsers(cDescriptor);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java
index d1c4db44c2..21bcd8f9e3 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java
@@ -63,14 +63,17 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
isStopOnError = info.isStopOnError();
}
+ @Override
public IProject getProject() {
return project;
}
+ @Override
public void setContainer(IContainer container) {
this.container = container;
}
+ @Override
public void setName(String name) {
this.name = name;
}
@@ -79,32 +82,39 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return targetAttributes;
}
+ @Override
public String getName() {
return name;
}
+ @Override
public String getTargetBuilderID() {
return targetBuilderID;
}
+ @Override
public boolean isStopOnError() {
return isStopOnError;
}
+ @Override
public void setStopOnError(boolean stopOnError) throws CoreException {
isStopOnError = stopOnError;
manager.updateTarget(this);
}
+ @Override
public boolean isDefaultBuildCmd() {
return isDefaultBuildCmd;
}
+ @Override
public void setUseDefaultBuildCmd(boolean useDefault) throws CoreException {
isDefaultBuildCmd = useDefault;
manager.updateTarget(this);
}
+ @Override
public IPath getBuildCommand() {
if (isDefaultBuildCmd()) {
IMakeBuilderInfo info;
@@ -122,10 +132,12 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return new Path(result);
}
+ @Override
public void setBuildCommand(IPath command) throws CoreException {
setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, command.toString());
}
+ @Override
public String getBuildArguments() {
if (isDefaultBuildCmd()) {
IMakeBuilderInfo info;
@@ -134,7 +146,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return info.getBuildArguments();
} catch (CoreException e) {
}
- }
+ }
String result = getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, ""); //$NON-NLS-1$
try {
result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result, false);
@@ -143,14 +155,17 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return result;
}
+ @Override
public void setBuildArguments(String arguments) throws CoreException {
setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, arguments);
}
+ @Override
public void setBuildTarget(String target) throws CoreException {
setBuildAttribute(IMakeTarget.BUILD_TARGET, target);
}
+ @Override
public String getBuildTarget() {
String result = getBuildAttribute(IMakeTarget.BUILD_TARGET, ""); //$NON-NLS-1$
try {
@@ -160,33 +175,40 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return result;
}
+ @Override
public void setRunAllBuilders(boolean runAllBuilders) throws CoreException {
this.runAllBuidlers = runAllBuilders;
manager.updateTarget(this);
}
+ @Override
public boolean runAllBuilders() {
return runAllBuidlers;
}
+ @Override
public void setBuildAttribute(String name, String value) throws CoreException {
targetAttributes.put(name, value);
manager.updateTarget(this);
}
+ @Override
public String getBuildAttribute(String name, String defaultValue) {
String value = targetAttributes.get(name);
return value != null ? value : defaultValue;
}
+ @Override
public IPath getBuildLocation() {
return container.getLocation();
}
+ @Override
public void setBuildLocation(IPath location) throws CoreException {
throw new UnsupportedOperationException();
}
+ @Override
public String[] getErrorParsers() {
IMakeBuilderInfo projectInfo;
try {
@@ -197,10 +219,12 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return new String[0];
}
+ @Override
public void setErrorParsers(String[] parsers) throws CoreException {
throw new UnsupportedOperationException();
}
+ @Override
public Map<String, String> getExpandedEnvironment() throws CoreException {
Map<String, String> env = null;
if (appendProjectEnvironment()) {
@@ -232,28 +256,34 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return envMap;
}
+ @Override
public boolean appendProjectEnvironment() {
return appendProjectEnvironment;
}
+ @Override
public void setAppendProjectEnvironment(boolean append) {
appendProjectEnvironment = append;
}
+ @Override
public Map<String, String> getEnvironment() {
return buildEnvironment;
}
+ @Override
public void setEnvironment(Map<String, String> env) throws CoreException {
buildEnvironment = new HashMap<String, String>(env);
manager.updateTarget(this);
}
+ @Override
public void setAppendEnvironment(boolean append) throws CoreException {
appendEnvironment = append ? 1 : 0;
manager.updateTarget(this);
}
+ @Override
public boolean appendEnvironment() {
return appendEnvironment == USE_PROJECT_ENV_SETTING ? getProjectEnvSetting(): appendEnvironment == 1;
}
@@ -268,6 +298,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return false;
}
+ @Override
public IContainer getContainer() {
return container;
}
@@ -288,6 +319,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
return container.hashCode() * 17 + name != null ? name.hashCode(): 0;
}
+ @Override
public void build(IProgressMonitor monitor) throws CoreException {
final String builderID = manager.getBuilderID(targetBuilderID);
final HashMap<String, String> infoMap = new HashMap<String, String>();
@@ -314,6 +346,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
*
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
if (runAllBuidlers) {
ICommand[] commands = project.getDescription().getBuildSpec();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java
index 2684e9aa86..9772046fb9 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java
@@ -14,8 +14,8 @@ package org.eclipse.cdt.make.internal.core;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
-import java.util.Vector;
import java.util.Map.Entry;
+import java.util.Vector;
import org.eclipse.cdt.make.core.IMakeTarget;
import org.eclipse.cdt.make.core.IMakeTargetListener;
@@ -55,14 +55,17 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
public MakeTargetManager() {
}
+ @Override
public IMakeTarget createTarget(IProject project, String name, String targetBuilderID) throws CoreException {
return new MakeTarget(this, project, targetBuilderID, name);
}
+ @Override
public void addTarget(IMakeTarget target) throws CoreException {
addTarget(null, target);
}
+ @Override
public void addTarget(IContainer container, IMakeTarget target) throws CoreException {
if (container instanceof IWorkspaceRoot) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeMessages.getString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$
@@ -82,6 +85,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_ADD, target));
}
+ @Override
public void setTargets(IContainer container, IMakeTarget[] targets) throws CoreException {
if (container instanceof IWorkspaceRoot) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeMessages.getString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$
@@ -104,6 +108,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_ADD, targets[0]));
}
+ @Override
public boolean targetExists(IMakeTarget target) {
ProjectTargets projectTargets = projectMap.get(target.getProject());
if (projectTargets == null) {
@@ -112,6 +117,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
return projectTargets.contains(target);
}
+ @Override
public void removeTarget(IMakeTarget target) throws CoreException {
ProjectTargets projectTargets = projectMap.get(target.getProject());
if (projectTargets == null) {
@@ -128,6 +134,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
}
}
+ @Override
public void renameTarget(IMakeTarget target, String name) throws CoreException {
IMakeTarget makeTarget = target;
@@ -142,6 +149,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
}
}
+ @Override
public IMakeTarget[] getTargets(IContainer container) throws CoreException {
ProjectTargets projectTargets = projectMap.get(container.getProject());
if (projectTargets == null) {
@@ -150,6 +158,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
return projectTargets.get(container);
}
+ @Override
public IMakeTarget findTarget(IContainer container, String name) throws CoreException {
ProjectTargets projectTargets = projectMap.get(container.getProject());
if (projectTargets == null) {
@@ -158,10 +167,12 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
return projectTargets.findTarget(container, name);
}
+ @Override
public IProject[] getTargetBuilderProjects() {
return fProjects.toArray(new IProject[fProjects.size()]);
}
+ @Override
public String[] getTargetBuilders(IProject project) {
if (fProjects.contains(project) || hasTargetBuilder(project)) {
try {
@@ -182,6 +193,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
return new String[0];
}
+ @Override
public boolean hasTargetBuilder(IProject project) {
try {
if (project.isAccessible()) {
@@ -213,6 +225,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
}
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta != null) {
@@ -228,6 +241,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
/**
* @see IResourceDeltaVisitor#visit(IResourceDelta)
*/
+ @Override
public boolean visit(IResourceDelta delta) {
if (delta == null) {
return false;
@@ -330,14 +344,17 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
}
}
+ @Override
public void addListener(IMakeTargetListener listener) {
listeners.add(listener);
}
+ @Override
public void removeListener(IMakeTargetListener listener) {
listeners.remove(listeners);
}
+ @Override
public String getBuilderID(String targetBuilderID) {
return builderMap.get(targetBuilderID);
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/ConfigSupportNature.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/ConfigSupportNature.java
index e9ba40b7ed..23d0afe16e 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/ConfigSupportNature.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/ConfigSupportNature.java
@@ -17,16 +17,20 @@ import org.eclipse.core.runtime.CoreException;
public class ConfigSupportNature implements IProjectNature {
private IProject fProject;
+ @Override
public void configure() throws CoreException {
}
+ @Override
public void deconfigure() throws CoreException {
}
+ @Override
public IProject getProject() {
return fProject;
}
+ @Override
public void setProject(IProject project) {
fProject = project;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java
index 3c578338e8..1f9b83a62c 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java
@@ -26,15 +26,15 @@ import org.eclipse.cdt.make.core.makefile.ITargetRule;
* statement : rule | macro_definition | comments | empty
* rule : inference_rule | target_rule
* inference_rule : target ':' <nl> ( <tab> command <nl> ) +
- * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
[ ( command ) * ]
- * macro_definition : string '=' (string)*
+ * macro_definition : string '=' (string)*
* comments : ('#' (string) <nl>) *
* empty : <nl>
* command : <tab> prefix_command string <nl>
* target : string
* prefix_command : '-' | '@' | '+'
- * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
*/
public abstract class AbstractMakefile extends Parent implements IMakefile {
@@ -45,8 +45,10 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
super(parent);
}
+ @Override
public abstract IDirective[] getBuiltins();
+ @Override
public IRule[] getRules() {
IDirective[] stmts = getDirectives(true);
List<IDirective> array = new ArrayList<IDirective>(stmts.length);
@@ -58,6 +60,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IRule[0]);
}
+ @Override
public IRule[] getRules(String target) {
IRule[] rules = getRules();
List<IRule> array = new ArrayList<IRule>(rules.length);
@@ -69,6 +72,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IRule[0]);
}
+ @Override
public IInferenceRule[] getInferenceRules() {
IRule[] rules = getRules();
List<IRule> array = new ArrayList<IRule>(rules.length);
@@ -80,6 +84,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IInferenceRule[0]);
}
+ @Override
public IInferenceRule[] getInferenceRules(String target) {
IInferenceRule[] irules = getInferenceRules();
List<IInferenceRule> array = new ArrayList<IInferenceRule>(irules.length);
@@ -91,6 +96,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IInferenceRule[0]);
}
+ @Override
public ITargetRule[] getTargetRules() {
IRule[] trules = getRules();
List<IRule> array = new ArrayList<IRule>(trules.length);
@@ -102,6 +108,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new ITargetRule[0]);
}
+ @Override
public ITargetRule[] getTargetRules(String target) {
ITargetRule[] trules = getTargetRules();
List<ITargetRule> array = new ArrayList<ITargetRule>(trules.length);
@@ -113,6 +120,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new ITargetRule[0]);
}
+ @Override
public IMacroDefinition[] getMacroDefinitions() {
IDirective[] stmts = getDirectives(true);
List<IDirective> array = new ArrayList<IDirective>(stmts.length);
@@ -124,6 +132,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IMacroDefinition[0]);
}
+ @Override
public IMacroDefinition[] getMacroDefinitions(String name) {
IMacroDefinition[] variables = getMacroDefinitions();
List<IMacroDefinition> array = new ArrayList<IMacroDefinition>(variables.length);
@@ -135,6 +144,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IMacroDefinition[0]);
}
+ @Override
public IMacroDefinition[] getBuiltinMacroDefinitions() {
IDirective[] stmts = getBuiltins();
List<IDirective> array = new ArrayList<IDirective>(stmts.length);
@@ -146,6 +156,7 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IMacroDefinition[0]);
}
+ @Override
public IMacroDefinition[] getBuiltinMacroDefinitions(String name) {
IMacroDefinition[] variables = getBuiltinMacroDefinitions();
List<IMacroDefinition> array = new ArrayList<IMacroDefinition>(variables.length);
@@ -179,10 +190,12 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return array.toArray(new IInferenceRule[0]);
}
+ @Override
public String expandString(String line) {
return expandString(line, false);
}
+ @Override
public String expandString(String line, boolean recursive) {
int len = line.length();
boolean foundDollar = false;
@@ -264,14 +277,15 @@ public abstract class AbstractMakefile extends Parent implements IMakefile {
return buffer.toString();
}
+ @Override
public URI getFileURI() {
return filename;
}
-
+
public void setFileURI(URI filename) {
this.filename = filename;
}
-
+
@Override
public IMakefile getMakefile() {
return this;
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java
index 5d22944456..f15e025097 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java
@@ -17,7 +17,7 @@ import org.eclipse.cdt.make.core.makefile.ICommand;
/**
* Makefile : ( statement ) *
- * statement : command | ..
+ * statement : command | ..
* command : <tab> prefix_command string <nl>
* prefix_command : '-' | '@' | '+'
*/
@@ -39,6 +39,7 @@ public class Command extends Directive implements ICommand {
* target as a prerequisite or has no prerequisites, any error
* found while executing the command will be ignored.
*/
+ @Override
public boolean shouldIgnoreError() {
// Check for the prefix hyphen in the command.
if (getPrefix() == HYPHEN) {
@@ -54,6 +55,7 @@ public class Command extends Directive implements ICommand {
* target as a prerequisite or has no prerequisites, the command
* will not be written to standard output before it is executed.
*/
+ @Override
public boolean shouldBeSilent() {
// Check for the prefix at sign
if (getPrefix() == AT) {
@@ -67,6 +69,7 @@ public class Command extends Directive implements ICommand {
* command line that will be executed even if -n, -q or -t is
* specified.
*/
+ @Override
public boolean shouldExecute() {
// Check for the prefix at sign
if (getPrefix() == PLUS) {
@@ -108,6 +111,7 @@ public class Command extends Directive implements ICommand {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.ICommand#execute(java.lang.String[], java.io.File)
*/
+ @Override
public Process execute(String shell, String[] envp, File dir) throws IOException {
String[] cmdArray = new String[] { shell, "-c", command}; //$NON-NLS-1$
return Runtime.getRuntime().exec(cmdArray, envp, dir);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java
index f5f7ea0b0b..a8983abc96 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java
@@ -33,6 +33,7 @@ public abstract class Directive implements IDirective {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IDirective#getEndLine()
*/
+ @Override
public int getEndLine() {
return endLine;
}
@@ -40,6 +41,7 @@ public abstract class Directive implements IDirective {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IDirective#getStartLine()
*/
+ @Override
public int getStartLine() {
return startLine;
}
@@ -47,6 +49,7 @@ public abstract class Directive implements IDirective {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IDirective#getParent()
*/
+ @Override
public IDirective getParent() {
return parent;
}
@@ -54,6 +57,7 @@ public abstract class Directive implements IDirective {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IDirective#getMakefile()
*/
+ @Override
public IMakefile getMakefile() {
return parent.getMakefile();
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java
index f211c34b47..5ac3b6f2ee 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java
@@ -29,6 +29,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
value = v;
}
+ @Override
public String getName() {
return name;
}
@@ -37,6 +38,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
name = (n == null) ? "" : n.trim() ; //$NON-NLS-1$
}
+ @Override
public StringBuffer getValue() {
return value;
}
@@ -78,6 +80,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromCommand()
*/
+ @Override
public boolean isFromCommand() {
return fromCommand;
}
@@ -85,6 +88,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromDefault()
*/
+ @Override
public boolean isFromDefault() {
return fromDefault;
}
@@ -92,6 +96,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromEnviroment()
*/
+ @Override
public boolean isFromEnviroment() {
return fromEnvironment;
}
@@ -99,6 +104,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromEnviroment()
*/
+ @Override
public boolean isFromEnvironmentOverride() {
return fromEnvironmentOverride;
}
@@ -106,6 +112,7 @@ public class MacroDefinition extends Directive implements IMacroDefinition {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromMakefile()
*/
+ @Override
public boolean isFromMakefile() {
return fromMakefile;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java
index dbe0a139ac..cdec17a21b 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java
@@ -22,15 +22,15 @@ import org.eclipse.cdt.make.core.makefile.IMakefileReaderProvider;
* statement : rule | macro_definition | comments | empty
* rule : inference_rule | target_rule
* inference_rule : target ':' <nl> ( <tab> command <nl> ) +
- * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
[ ( command ) * ]
- * macro_definition : string '=' (string)*
+ * macro_definition : string '=' (string)*
* comments : ('#' (string) <nl>) *
* empty : <nl>
* command : <tab> prefix_command string <nl>
* target : string
* prefix_command : '-' | '@' | '+'
- * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
*/
public class NullMakefile extends AbstractMakefile {
@@ -62,12 +62,14 @@ public class NullMakefile extends AbstractMakefile {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#parse(java.io.Reader)
*/
+ @Override
public void parse(String name, Reader makefile) throws IOException {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#getMakefileReaderProvider()
*/
+ @Override
public IMakefileReaderProvider getMakefileReaderProvider() {
return null;
}
@@ -78,12 +80,14 @@ public class NullMakefile extends AbstractMakefile {
public void parse(String name,
IMakefileReaderProvider makefileReaderProvider) throws IOException {
}
+ @Override
public void parse(URI fileURI, Reader makefile) throws IOException {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#parse(java.net.URI, org.eclipse.cdt.make.core.makefile.IMakefileReaderProvider)
*/
+ @Override
public void parse(URI fileURI,
IMakefileReaderProvider makefileReaderProvider) throws IOException {
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java
index f4ba6cebcf..ff6cd45d33 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java
@@ -13,8 +13,8 @@ package org.eclipse.cdt.make.internal.core.makefile;
import java.util.ArrayList;
import java.util.Arrays;
-import org.eclipse.cdt.make.core.makefile.IParent;
import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IParent;
/**
* IParent
@@ -32,6 +32,7 @@ public abstract class Parent extends Directive implements IParent {
return getDirectives();
}
+ @Override
public IDirective[] getDirectives() {
children.trimToSize();
return children.toArray(new IDirective[0]);
@@ -57,7 +58,7 @@ public abstract class Parent extends Directive implements IParent {
public Directive[] getStatements() {
children.trimToSize();
- return children.toArray(new Directive[0]);
+ return children.toArray(new Directive[0]);
}
/* (non-Javadoc)
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java
index 949c7cd203..73e0a6a2ad 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java
@@ -13,8 +13,8 @@ package org.eclipse.cdt.make.internal.core.makefile;
import java.util.ArrayList;
import org.eclipse.cdt.make.core.makefile.ICommand;
-import org.eclipse.cdt.make.core.makefile.IRule;
import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IRule;
import org.eclipse.cdt.make.core.makefile.ITarget;
public abstract class Rule extends Parent implements IRule {
@@ -31,6 +31,7 @@ public abstract class Rule extends Parent implements IRule {
addDirectives(cmds);
}
+ @Override
public ICommand[] getCommands() {
IDirective[] directives = getDirectives();
ArrayList<IDirective> cmds = new ArrayList<IDirective>(directives.length);
@@ -42,6 +43,7 @@ public abstract class Rule extends Parent implements IRule {
return cmds.toArray(new ICommand[0]);
}
+ @Override
public ITarget getTarget() {
return target;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java
index 2b5c3a6cec..b73578a1a7 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.cdt.make.internal.core.makefile;
-import org.eclipse.cdt.make.core.makefile.ISpecialRule;
import org.eclipse.cdt.make.core.makefile.ICommand;
+import org.eclipse.cdt.make.core.makefile.ISpecialRule;
/**
* Targets that have special meaning for Make.
@@ -25,6 +25,7 @@ public abstract class SpecialRule extends Rule implements ISpecialRule {
prerequisites = reqs;
}
+ @Override
public String[] getPrerequisites() {
return prerequisites;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java
index fbfd7cfc0e..25d5366ed3 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java
@@ -18,15 +18,15 @@ import org.eclipse.cdt.make.core.makefile.ITargetRule;
* statement : rule | macro_definition | comments | empty
* rule : inference_rule | target_rule
* inference_rule : target ':' <nl> ( <tab> command <nl> ) +
- * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
[ ( <tab> prefix_command command ) * ]
- * macro_definition : string '=' (string)*
+ * macro_definition : string '=' (string)*
* comments : '#' (string) *
* empty : <nl>
* command : string <nl>
* target : string
* prefix_command : '-' | '@' | '+'
- * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
*/
public class TargetRule extends Rule implements ITargetRule {
@@ -46,6 +46,7 @@ public class TargetRule extends Rule implements ITargetRule {
prerequisites = reqs;
}
+ @Override
public String[] getPrerequisites() {
return prerequisites;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java
index f4c848632d..102a75c851 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java
@@ -39,34 +39,42 @@ public abstract class Conditional extends Parent implements IConditional {
}
+ @Override
public String getConditional() {
return cond;
}
+ @Override
public String getArg1() {
return arg1;
}
+ @Override
public String getArg2() {
return arg2;
}
+ @Override
public boolean isIfdef() {
return false;
}
+ @Override
public boolean isIfndef() {
return false;
}
+ @Override
public boolean isIfeq() {
return false;
}
+ @Override
public boolean isIfneq() {
return false;
}
+ @Override
public boolean isElse() {
return false;
}
@@ -87,12 +95,12 @@ public abstract class Conditional extends Parent implements IConditional {
String line = getConditional().trim();
char terminal = line.charAt(0) == '(' ? ',' : line.charAt(0);
-
+
if (line.length() < 5 && terminal != ',' && terminal != '"' && terminal != '\'') {
arg1 = arg2 = EMPTY;
return;
}
-
+
// Find the end of the first string.
int count = 0;
// For the (ARG1, ARG2) format.
@@ -121,20 +129,20 @@ public abstract class Conditional extends Parent implements IConditional {
if (count >= line.length()) {
arg1 = arg2 = EMPTY;
- return;
+ return;
}
arg1 = line.substring(1, count);
-
+
/* Find the start of the second string. */
line = line.substring(count + 1).trim();
-
+
terminal = terminal == ',' ? ')' : line.charAt(0);
if (terminal != ')' && terminal != '"' && terminal != '\'') {
arg2 = EMPTY;
return;
}
-
+
count = 0;
/* Find the end of the second string. */
if (terminal == ')') {
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java
index 66d639bb49..295144cdbf 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java
@@ -59,15 +59,15 @@ import org.eclipse.core.runtime.CoreException;
* statement : rule | macro_definition | comments | empty
* rule : inference_rule | target_rule
* inference_rule : target ':' <nl> ( <tab> command <nl> ) +
- * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
[ ( command ) * ]
- * macro_definition : string '=' (string)*
+ * macro_definition : string '=' (string)*
* comments : ('#' (string) <nl>) *
* empty : <nl>
* command : <tab> prefix_command string <nl>
* target : string
* prefix_command : '-' | '@' | '+'
- * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
*/
public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
@@ -82,14 +82,16 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
public GNUMakefile() {
super(null);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#getMakefileReaderProvider()
*/
+ @Override
public IMakefileReaderProvider getMakefileReaderProvider() {
return makefileReaderProvider;
}
-
+
+ @Override
public void parse(String filePath, Reader reader) throws IOException {
parse(URIUtil.toURI(filePath), new MakefileReader(reader));
}
@@ -97,6 +99,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#parse(java.net.URI, org.eclipse.cdt.make.core.makefile.IMakefileReaderProvider)
*/
+ @Override
public void parse(URI fileURI,
IMakefileReaderProvider makefileReaderProvider) throws IOException {
this.makefileReaderProvider = makefileReaderProvider;
@@ -107,7 +110,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
final IFileInfo info = store.fetchInfo();
if (!info.exists() || info.isDirectory())
throw new IOException();
-
+
reader = new MakefileReader(new InputStreamReader(
store.openInputStream(EFS.NONE, null)));
} catch (CoreException e) {
@@ -119,12 +122,13 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
}
parse(fileURI, reader);
}
-
+
+ @Override
public void parse(URI filePath, Reader reader) throws IOException {
- parse(filePath, new MakefileReader(reader));
+ parse(filePath, new MakefileReader(reader));
}
-
-
+
+
protected void parse(URI fileURI, MakefileReader reader) throws IOException {
String line;
Rule[] rules = null;
@@ -306,7 +310,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
vd.setLines(startLine, endLine);
addDirective(conditions, vd);
if (!vd.isTargetSpecific()) {
- continue;
+ continue;
}
}
@@ -814,10 +818,12 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
return builtins;
}
+ @Override
public void setIncludeDirectories(String[] dirs) {
includeDirectories = dirs;
}
+ @Override
public String[] getIncludeDirectories() {
return includeDirectories;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java
index 247bfdc855..8682075361 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java
@@ -38,6 +38,7 @@ public class GNUMakefileChecker extends ACBuilder {
this.monitor = monitor;
}
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
if (resource != null && resource.getProject() == getProject()) {
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java
index 1fca7eb5d9..04960c5044 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java
@@ -41,6 +41,7 @@ public class GNUMakefileValidator implements IMakefileValidator {
setMarkerGenerator(errorHandler);
}
+ @Override
public void setMarkerGenerator(IMarkerGenerator errorHandler) {
reporter = errorHandler;
}
@@ -49,16 +50,18 @@ public class GNUMakefileValidator implements IMakefileValidator {
if (reporter == null) {
reporter = new IMarkerGenerator() {
+ @Override
public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
ProblemMarkerInfo problemMarkerInfo = new ProblemMarkerInfo(file, lineNumber, errorDesc, severity, errorVar, null);
addMarker(problemMarkerInfo);
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IMarkerGenerator#addMarker(org.eclipse.cdt.core.ProblemMarkerInfo)
*/
+ @Override
public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
String name = "Makefile"; //$NON-NLS-1$
if (problemMarkerInfo.file != null) {
@@ -76,8 +79,8 @@ public class GNUMakefileValidator implements IMakefileValidator {
sb.append(':').append(problemMarkerInfo.externalPath);
}
sb.append('\n');
- System.out.println(sb.toString());
-
+ System.out.println(sb.toString());
+
}
@@ -94,12 +97,13 @@ public class GNUMakefileValidator implements IMakefileValidator {
}
return MakefileMessages.getString("MakefileValidator.unknown"); //$NON-NLS-1$
}
-
+
};
}
return reporter;
}
-
+
+ @Override
public void checkFile(IFile file, IProgressMonitor monitor) {
String message = MakefileMessages.getString("MakefileValidator.checkingFile") + file.getFullPath().toString(); //$NON-NLS-1$
monitor.subTask(message);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java
index 253630990d..9b4c212e59 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java
@@ -44,6 +44,7 @@ public class Include extends Parent implements IInclude {
return sb.toString();
}
+ @Override
public String[] getFilenames() {
return filenames;
}
@@ -60,8 +61,8 @@ public class Include extends Parent implements IInclude {
}
return null;
}
-
-
+
+
@Override
public IDirective[] getDirectives() {
clearDirectives();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java
index 6e44712119..4eadf939ca 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java
@@ -19,10 +19,12 @@ public abstract class Terminal extends Directive implements ITerminal {
super(parent);
}
+ @Override
public boolean isEndif() {
return false;
}
+ @Override
public boolean isEndef() {
return false;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java
index b7cfefcc62..34850e0ec5 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java
@@ -29,6 +29,7 @@ public class UnExport extends Directive implements IUnExport {
return sb.toString();
}
+ @Override
public String getVariable() {
return variable;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java
index a9d9755d91..e417eedc9d 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java
@@ -36,10 +36,12 @@ public class VPath extends Directive implements IVPath {
return sb.toString();
}
+ @Override
public String[] getDirectories() {
return directories;
}
+ @Override
public String getPattern() {
return pattern;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java
index 9134d434aa..ab215362ae 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java
@@ -84,31 +84,38 @@ public class VariableDefinition extends MacroDefinition implements IVariableDefi
return sb.toString();
}
+ @Override
public boolean isRecursivelyExpanded() {
return type == TYPE_RECURSIVE_EXPAND;
}
+ @Override
public boolean isSimplyExpanded() {
return type == TYPE_SIMPLE_EXPAND;
}
-
+
+ @Override
public boolean isConditional() {
return type == TYPE_CONDITIONAL;
}
-
+
+ @Override
public boolean isAppend() {
return type == TYPE_APPEND;
}
+ @Override
public boolean isTargetSpecific() {
String t = getTarget();
return t != null && t.length() > 0;
}
+ @Override
public boolean isExport() {
return false;
}
+ @Override
public boolean isMultiLine() {
return false;
}
@@ -116,6 +123,7 @@ public class VariableDefinition extends MacroDefinition implements IVariableDefi
/**
* Variable from an `override' directive.
*/
+ @Override
public boolean isOverride() {
return false;
}
@@ -123,10 +131,12 @@ public class VariableDefinition extends MacroDefinition implements IVariableDefi
/**
* Automatic variable -- cannot be set.
*/
+ @Override
public boolean isAutomatic() {
return false;
}
+ @Override
public String getTarget() {
return varTarget;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java
index fd026d905b..4166b2d4f8 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java
@@ -51,15 +51,15 @@ import org.eclipse.core.runtime.CoreException;
* rule : inference_rule | target_rule | special_rule
* inference_rule : target ':' [ ';' command ] <nl>
[ ( command ) * ]
- * target_rule : [ ( target ) + ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ * target_rule : [ ( target ) + ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
[ ( command ) * ]
- * macro_definition : string '=' ( string )*
+ * macro_definition : string '=' ( string )*
* comments : ('#' ( string ) <nl>) *
* empty : <nl>
* command : <tab> prefix_command string <nl>
* target : string
* prefix_command : '-' | '@' | '+'
- * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
*/
public class PosixMakefile extends AbstractMakefile {
@@ -70,14 +70,16 @@ public class PosixMakefile extends AbstractMakefile {
public PosixMakefile() {
super(null);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#getMakefileReaderProvider()
*/
+ @Override
public IMakefileReaderProvider getMakefileReaderProvider() {
return makefileReaderProvider;
}
-
+
+ @Override
public void parse(String name, Reader reader) throws IOException {
parse(URIUtil.toURI(name), new MakefileReader(reader));
}
@@ -85,6 +87,7 @@ public class PosixMakefile extends AbstractMakefile {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.makefile.IMakefile#parse(java.net.URI, org.eclipse.cdt.make.core.makefile.IMakefileReaderProvider)
*/
+ @Override
public void parse(URI fileURI,
IMakefileReaderProvider makefileReaderProvider) throws IOException {
this.makefileReaderProvider = makefileReaderProvider;
@@ -102,7 +105,8 @@ public class PosixMakefile extends AbstractMakefile {
}
parse(fileURI, reader);
}
-
+
+ @Override
public void parse(URI fileURI, Reader reader) throws IOException {
parse(fileURI, new MakefileReader(reader));
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java
index 9147442838..8a53b6bb99 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoCalculator.java
@@ -42,23 +42,23 @@ import org.eclipse.core.runtime.IPath;
public class CDataDiscoveredInfoCalculator {
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
private static CDataDiscoveredInfoCalculator fInstance;
-
+
public static class DiscoveredSettingInfo{
private boolean fIsPerFileDiscovery;
private IRcSettingInfo[] fInfos;
-
+
public DiscoveredSettingInfo(boolean isPerFileDiscovery, IRcSettingInfo[] infos){
fIsPerFileDiscovery = isPerFileDiscovery;
fInfos = infos;
}
-
+
public boolean isPerFileDiscovery(){
return fIsPerFileDiscovery;
}
-
+
public IRcSettingInfo[] getRcSettingInfos(){
return fInfos;
}
@@ -66,16 +66,16 @@ public class CDataDiscoveredInfoCalculator {
public interface IRcSettingInfo {
CResourceData getResourceData();
-
+
ILangSettingInfo[] getLangInfos();
}
-
+
public interface ILangSettingInfo {
CLanguageData getLanguageData();
-
+
PathInfo getFilePathInfo();
}
-
+
private static class RcSettingInfo implements IRcSettingInfo{
private ArrayList<ILangSettingInfo> fLangInfoList;
private CResourceData fRcData;
@@ -84,68 +84,72 @@ public class CDataDiscoveredInfoCalculator {
fRcData = rcData;
}
+ @Override
public ILangSettingInfo[] getLangInfos() {
if(fLangInfoList != null && fLangInfoList.size() != 0)
return fLangInfoList.toArray(new ILangSettingInfo[fLangInfoList.size()]);
return new ILangSettingInfo[0];
}
+ @Override
public CResourceData getResourceData() {
return fRcData;
}
-
+
void add(ILangSettingInfo info){
if(fLangInfoList == null)
fLangInfoList = new ArrayList<ILangSettingInfo>();
fLangInfoList.add(info);
}
}
-
+
private static class LangSettingInfo implements ILangSettingInfo {
private CLanguageData fLangData;
private PathInfo fPathInfo;
-
+
LangSettingInfo(CLanguageData langData, PathInfo info){
fLangData = langData;
fPathInfo = info;
}
+ @Override
public PathInfo getFilePathInfo() {
return fPathInfo;
}
+ @Override
public CLanguageData getLanguageData() {
return fLangData;
}
-
+
}
private static class ListIndexStore {
private int fMaxIndex;
private List<PathFilePathInfo>[] fStore;
-
+
public ListIndexStore(int size){
if(size < 0)
size = 0;
-
+
@SuppressWarnings("unchecked")
List<PathFilePathInfo>[] lists = new List[size];
fStore = lists;
}
-
+
public void add(int index, PathFilePathInfo value){
List<PathFilePathInfo> list = checkResize(index) ? new ArrayList<PathFilePathInfo>() : fStore[index];
if(list == null){
list = new ArrayList<PathFilePathInfo>();
fStore[index] = list;
}
-
+
if(fMaxIndex < index)
fMaxIndex = index;
-
+
list.add(value);
}
-
+
private boolean checkResize(int index){
if(index >= fStore.length){
int newSize = ++index;
@@ -159,7 +163,7 @@ public class CDataDiscoveredInfoCalculator {
}
return false;
}
-
+
public List<PathFilePathInfo>[] getLists(){
int size = fMaxIndex + 1;
List<List<PathFilePathInfo>> list = new ArrayList<List<PathFilePathInfo>>(size);
@@ -169,23 +173,23 @@ public class CDataDiscoveredInfoCalculator {
if(l != null)
list.add(l);
}
-
+
@SuppressWarnings("unchecked")
List<PathFilePathInfo>[] lists = list.toArray(new List[list.size()]);
return lists;
}
}
-
+
private static class PathFilePathInfo {
IPath fPath;
PathInfo fInfo;
-
+
PathFilePathInfo(IPath path, PathInfo info){
fPath = path;
fInfo = info;
}
}
-
+
private static class ExtsSetSettings {
// String[] fExts;
// HashSet fExtsSet;
@@ -202,7 +206,7 @@ public class CDataDiscoveredInfoCalculator {
fBaseLangData = baseLangData;
fIsDerived = isDerived;
}
-
+
void add(ExtsSetSettings setting){
if(setting.fPathFilePathInfoMap != null){
Collection<List<PathFilePathInfo>> infoLists = setting.fPathFilePathInfoMap.values();
@@ -213,11 +217,11 @@ public class CDataDiscoveredInfoCalculator {
}
}
}
-
+
public void add(PathFilePathInfo pInfo){
if(fPathFilePathInfoMap == null)
fPathFilePathInfoMap = new HashMap<PathInfo, List<PathFilePathInfo>>(3);
-
+
PathInfo fileInfo = pInfo.fInfo;
List<PathFilePathInfo> list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList : fPathFilePathInfoMap.get(fileInfo);
if(list == null){
@@ -226,13 +230,13 @@ public class CDataDiscoveredInfoCalculator {
if(fMaxMatchInfo == null){
fMaxMatchInfo = fileInfo;
fMaxMatchInfoList = list;
- }
+ }
// else {
// fIsMultiple = true;
// }
} else if(fMaxMatchInfoList != list){
// fIsMultiple = true;
-
+
if(fMaxMatchInfoList.size() == list.size()){
fMaxMatchInfoList = list;
fMaxMatchInfo = fileInfo;
@@ -240,32 +244,32 @@ public class CDataDiscoveredInfoCalculator {
}
list.add(pInfo);
}
-
+
public boolean isMultiple(){
return fPathFilePathInfoMap != null && fPathFilePathInfoMap.size() > 1;
}
-
+
@Override
public boolean equals(Object obj) {
if(obj == this)
return true;
-
+
if(isMultiple())
return false;
-
+
if(!(obj instanceof ExtsSetSettings))
return false;
-
+
ExtsSetSettings other = (ExtsSetSettings)obj;
if(other.isMultiple())
return false;
-
+
if(!fExtsSet.equals(other.fExtsSet))
return false;
-
+
if(!CDataUtil.objectsEqual(fMaxMatchInfo, other.fMaxMatchInfo))
return false;
-
+
return true;
}
@@ -277,18 +281,18 @@ public class CDataDiscoveredInfoCalculator {
hash = super.hashCode();
else {
hash = fExtsSet.hashCode();
-
+
if(fMaxMatchInfo != null)
- hash += fMaxMatchInfo.hashCode();
+ hash += fMaxMatchInfo.hashCode();
}
-
+
fHash = hash;
}
return hash;
}
-
+
}
-
+
private static class ExtsSet {
private String[] fExts;
private HashSet<String> fExtsSet;
@@ -297,19 +301,19 @@ public class CDataDiscoveredInfoCalculator {
public ExtsSet(String[] exts){
fExts = exts == null || exts.length == 0 ? EMPTY_STRING_ARRAY : (String[])exts.clone();
}
-
+
@Override
public boolean equals(Object obj) {
if(this == obj)
return true;
-
+
if(!(obj instanceof ExtsSet))
return false;
-
+
ExtsSet other = (ExtsSet)obj;
if(fExts.length != other.fExts.length)
return false;
-
+
if(fExts.length != 0){
@SuppressWarnings("unchecked")
HashSet<String> set = (HashSet<String>)calcExtsSet().clone();
@@ -319,7 +323,7 @@ public class CDataDiscoveredInfoCalculator {
}
return true;
}
-
+
@Override
public int hashCode() {
int hash = fHash;
@@ -332,7 +336,7 @@ public class CDataDiscoveredInfoCalculator {
}
return hash;
}
-
+
private HashSet<String> calcExtsSet(){
if(fExtsSet == null)
fExtsSet = new HashSet<String>(Arrays.asList(fExts));
@@ -343,9 +347,9 @@ public class CDataDiscoveredInfoCalculator {
public String toString() {
if(fExts.length == 0)
return "<empty>"; //$NON-NLS-1$
-
+
StringBuffer buf = new StringBuffer();
-
+
for(int i = 0; i < fExts.length; i++){
if(i != 0)
buf.append(","); //$NON-NLS-1$
@@ -354,7 +358,7 @@ public class CDataDiscoveredInfoCalculator {
return buf.toString();
}
}
-
+
private static class RcSetSettings {
private CResourceData fRcData;
private HashMap<String, ExtsSetSettings> fExtToExtsSetMap;
@@ -392,13 +396,13 @@ public class CDataDiscoveredInfoCalculator {
}
return child;
}
-
+
void updateRcData(CResourceData data, boolean isDerived){
fRcData = data;
fIsDerived = data != null ? isDerived : false;
updateLangDatas();
}
-
+
private void updateLangDatas(){
if(fRcData.getType() == ICSettingBase.SETTING_FILE){
CLanguageData lData = ((CFileData)fRcData).getLanguageData();
@@ -407,9 +411,9 @@ public class CDataDiscoveredInfoCalculator {
extSetting.fBaseLangData = lData;
extSetting.fIsDerived = lData != null ? fIsDerived : false;
}
-
- if(extSetting != null ?
- fExtsSetToExtsSetSettingsMap.size() > 1
+
+ if(extSetting != null ?
+ fExtsSetToExtsSetSettingsMap.size() > 1
: fExtsSetToExtsSetSettingsMap.size() > 0){
for (ExtsSetSettings s : fExtsSetToExtsSetSettingsMap.values()) {
if(s != extSetting){
@@ -422,7 +426,7 @@ public class CDataDiscoveredInfoCalculator {
CLanguageData[] lDatas = ((CFolderData)fRcData).getLanguageDatas();
@SuppressWarnings("unchecked")
Map<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>)fExtsSetToExtsSetSettingsMap.clone();
-
+
CLanguageData lData;
for(int i = 0; i < lDatas.length; i++){
lData = lDatas[i];
@@ -432,7 +436,7 @@ public class CDataDiscoveredInfoCalculator {
extSetting.fIsDerived = this.fIsDerived;
}
}
-
+
if(map.size() != 0){
Collection<ExtsSetSettings> extSettings = map.values();
for (ExtsSetSettings extSetting : extSettings) {
@@ -442,28 +446,28 @@ public class CDataDiscoveredInfoCalculator {
}
}
}
-
+
public IPath getPath(){
return fContainer.getPath();
}
-
+
public RcSetSettings getParent(){
PathSettingsContainer cr = fContainer.getParentContainer();
if(cr != null)
return (RcSetSettings)cr.getValue();
return null;
}
-
+
void internalSetSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map){
fExtsSetToExtsSetSettingsMap = map;
fExtToExtsSetMap = calcExtToExtSetSettingsMap(map);
}
-
+
void internalAdd(ExtsSetSettings setting){
if(fExtsSetToExtsSetSettingsMap == null){
fExtsSetToExtsSetSettingsMap = new HashMap<ExtsSet, ExtsSetSettings>();
}
-
+
ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet);
if(cur != null){
cur.add(setting);
@@ -472,7 +476,7 @@ public class CDataDiscoveredInfoCalculator {
fExtToExtsSetMap = addExtsInfoToMap(setting, fExtToExtsSetMap);
}
}
-
+
void internalAddSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map){
Collection<ExtsSetSettings> settings = map.values();
for (ExtsSetSettings setting : settings) {
@@ -488,55 +492,56 @@ public class CDataDiscoveredInfoCalculator {
// }
}
}
-
+
public RcSetSettings[] getChildren(final boolean includeCurrent){
final List<Object> list = new ArrayList<Object>();
fContainer.accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
if(includeCurrent || container != fContainer){
list.add(container.getValue());
}
return true;
}
-
+
});
-
+
return list.toArray(new RcSetSettings[list.size()]);
}
-
+
public boolean containsEqualMaxMatches(RcSetSettings other, boolean ignoreGenerated){
if(!ignoreGenerated && fExtsSetToExtsSetSettingsMap.size() < other.fExtsSetToExtsSetSettingsMap.size())
return false;
-
+
Set<Entry<ExtsSet, ExtsSetSettings>> entrySet = other.fExtsSetToExtsSetSettingsMap.entrySet();
for (Entry<ExtsSet, ExtsSetSettings> entry : entrySet) {
ExtsSetSettings otherSetting = entry.getValue();
if(ignoreGenerated && otherSetting.fBaseLangData == null)
continue;
-
+
ExtsSetSettings thisSetting = fExtsSetToExtsSetSettingsMap.get(entry.getKey());
if(thisSetting == null)
return false;
-
+
if(otherSetting.fMaxMatchInfo != null && !otherSetting.fMaxMatchInfo.equals(thisSetting.fMaxMatchInfo))
return false;
}
-
+
return true;
}
-
+
void removeChild(RcSetSettings setting){
IPath path = setting.fContainer.getPath();
IPath thisPath = fContainer.getPath();
if(!thisPath.isPrefixOf(path))
throw new IllegalArgumentException();
-
+
path = path.removeFirstSegments(thisPath.segmentCount());
fContainer.removeChildContainer(path);
}
}
-
+
private static HashMap<String, ExtsSetSettings> calcExtToExtSetSettingsMap(Map<ExtsSet, ExtsSetSettings> extsSetMap){
HashMap<String, ExtsSetSettings> result = null;
Collection<ExtsSetSettings> settings = extsSetMap.values();
@@ -545,7 +550,7 @@ public class CDataDiscoveredInfoCalculator {
}
return result;
}
-
+
private static HashMap<String, ExtsSetSettings> addExtsInfoToMap(ExtsSetSettings setting, HashMap<String, ExtsSetSettings> map){
boolean forceAdd = false;
String[] exts = setting.fExtsSet.fExts;
@@ -563,7 +568,7 @@ public class CDataDiscoveredInfoCalculator {
}
return map;
}
-
+
private RcSetSettings createRcSetInfo (CConfigurationData data){
CFolderData rootData = data.getRootFolderData();
PathSettingsContainer container = PathSettingsContainer.createRootContainer();
@@ -571,22 +576,22 @@ public class CDataDiscoveredInfoCalculator {
rcSet.internalSetSettingsMap(createExtsSetSettingsMap(rootData));
// rcSet.fExtToExtsSetMap = new HashMap();
// rcSet.fExtsSetToExtsSetSettingsMap = new HashMap();
-
+
CResourceData[] rcDatas = data.getResourceDatas();
CResourceData rcData;
RcSetSettings curRcSet;
HashMap<ExtsSet, ExtsSetSettings> fileMap;
ExtsSetSettings fileSetting;
IPath path;
-
+
for(int i = 0; i < rcDatas.length; i++){
rcData = rcDatas[i];
if(rcData == rootData)
continue;
-
+
if(!includeRcDataInCalculation(data, rcData))
continue;
-
+
path = rcData.getPath();
curRcSet = rcSet.createChild(path, rcData, false);
if(rcData.getType() == ICSettingBase.SETTING_FILE){
@@ -598,14 +603,14 @@ public class CDataDiscoveredInfoCalculator {
curRcSet.internalSetSettingsMap(createExtsSetSettingsMap((CFolderData)rcData));
}
}
-
+
return rcSet;
}
-
+
protected boolean includeRcDataInCalculation(CConfigurationData cfgData, CResourceData rcData){
return true;
}
-
+
protected CFileData createFileData(CConfigurationData cfgData, IPath path, CFileData base) throws CoreException{
return cfgData.createFileData(path, base);
}
@@ -626,7 +631,7 @@ public class CDataDiscoveredInfoCalculator {
checkRemoveDups(rcSet);
return rcSet;
}
-
+
/*
* utility method for creating empty IRcSettingInfo
*/
@@ -664,12 +669,12 @@ public class CDataDiscoveredInfoCalculator {
} else {
list.ensureCapacity(lDatas.length);
}
-
+
for(int i = 0; i < lDatas.length; i++){
list.add(new LangSettingInfo(lDatas[i], info));
}
}
-
+
private IRcSettingInfo[] mapFileDiscoveredInfo(IProject project, CConfigurationData data, RcSetSettings rcSet, PathFilePathInfo[] pfpis){
// IResource rc;
PathInfo pInfo;
@@ -682,7 +687,7 @@ public class CDataDiscoveredInfoCalculator {
CLanguageData lData;
ArrayList<ILangSettingInfo> tmpList;
PathFilePathInfo pfpi;
-
+
for(int i = 0; i < pfpis.length; i++){
pfpi = pfpis[i];
projRelPath = pfpi.fPath;
@@ -708,19 +713,19 @@ public class CDataDiscoveredInfoCalculator {
kinds |= ICLanguageSettingEntry.MACRO_FILE;
if(symbolMap.size() != 0)
kinds |= ICLanguageSettingEntry.MACRO;
-
+
rcInfo = null;
for(int k = 0; k < lDatas.length; k++){
lData = lDatas[k];
if((lData.getSupportedEntryKinds() & kinds) == 0)
continue;
-
+
if(rcInfo == null){
rcInfo = new RcSettingInfo(rootData);
tmpList = new ArrayList<ILangSettingInfo>(lDatas.length - k);
rcInfo.fLangInfoList = tmpList;
}
-
+
lInfo = new LangSettingInfo(lData, pInfo);
rcInfo.add(lInfo);
}
@@ -733,7 +738,7 @@ public class CDataDiscoveredInfoCalculator {
// switch(rc.getType()){
// case IResource.FILE:
// projRelPath = rc.getProjectRelativePath();
-// dataSetting = rcSet.getChild(projRelPath, false);
+// dataSetting = rcSet.getChild(projRelPath, false);
// rcData = dataSetting.fRcData;
rcData = rcSet.getChild(projRelPath, false).fRcData;
if(!rcData.getPath().equals(projRelPath)){
@@ -752,20 +757,20 @@ public class CDataDiscoveredInfoCalculator {
} catch (CoreException e) {
rcData = null;
MakeCorePlugin.log(e);
- }
+ }
}
// if(rcData != null)
// dataSetting = rcSet.createChild(projRelPath, rcData, false);
// else
// dataSetting = null;
}
-
+
if(rcData != null){
if(rcData.getType() == ICSettingBase.SETTING_FILE){
lData = ((CFileData)rcData).getLanguageData();
} else {
lData = CDataUtil.findLanguagDataForFile(projRelPath.lastSegment(), project, (CFolderData)rcData);
-
+
}
if(lData != null){
@@ -784,7 +789,7 @@ public class CDataDiscoveredInfoCalculator {
}
return list.toArray(new RcSettingInfo[list.size()]);
}
-
+
public IRcSettingInfo[] getSettingInfos(IProject project, CConfigurationData data, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 discoveredInfo, boolean fileDataMode){
if(fileDataMode){
RcSetSettings rcSettings = createRcSetInfo(data);
@@ -794,7 +799,7 @@ public class CDataDiscoveredInfoCalculator {
RcSetSettings settings = createRcSetSettings(data, discoveredInfo);
return createInfos(data, settings);
}
-
+
private IRcSettingInfo[] createInfos(CConfigurationData data, RcSetSettings rootSetting){
RcSetSettings settings[] = rootSetting.getChildren(true);
RcSetSettings setting;
@@ -823,7 +828,7 @@ public class CDataDiscoveredInfoCalculator {
continue;
}
}
-
+
if(rcData.getType() == ICSettingBase.SETTING_FILE){
ExtsSetSettings extSetting = setting.fExtToExtsSetMap.get(getFileExt(rcData.getPath()));
if(extSetting != null){
@@ -846,17 +851,17 @@ public class CDataDiscoveredInfoCalculator {
for (ExtsSetSettings extSetting : extSettings) {
if(extSetting.fMaxMatchInfo == null)
continue;
-
+
if(extSetting.fBaseLangData == null)
continue;
-
+
if(extSetting.fIsDerived){
throw new IllegalStateException();
}
-
-
+
+
rcInfo.add(new LangSettingInfo(extSetting.fBaseLangData, extSetting.fMaxMatchInfo));
-
+
if(extSetting.isMultiple()){
Set<Entry<PathInfo, List<PathFilePathInfo>>> entries = extSetting.fPathFilePathInfoMap.entrySet();
for (Entry<PathInfo, List<PathFilePathInfo>> entry : entries) {
@@ -883,18 +888,18 @@ public class CDataDiscoveredInfoCalculator {
}
}
// }
-
+
return resultList.toArray(new RcSettingInfo[resultList.size()]);
}
-
+
private CFolderData createFolderData(CConfigurationData cfg, CResourceData base, RcSetSettings setting) throws CoreException{
if(base.getType() == ICSettingBase.SETTING_FOLDER)
return createFolderData(cfg, setting.getPath(), (CFolderData)base);
-
+
//should not be here
throw new IllegalStateException();
}
-
+
private static void checkRemoveDups(RcSetSettings rcSet){
RcSetSettings settings[] = rcSet.getChildren(true);
RcSetSettings setting, parent;
@@ -902,21 +907,21 @@ public class CDataDiscoveredInfoCalculator {
setting = settings[i];
if(!setting.fIsDerived)
continue;
-
+
parent = setting.getParent();
if(parent == null)
continue;
-
+
if(parent.containsEqualMaxMatches(setting, true))
removeChildAddingChildSettings(parent, setting);
}
}
-
+
private static void removeChildAddingChildSettings(RcSetSettings parent, RcSetSettings child){
parent.internalAddSettingsMap(child.fExtsSetToExtsSetSettingsMap);
parent.removeChild(child);
}
-
+
private static void mapDiscoveredInfo(RcSetSettings rcSet, PathFilePathInfo[] pInfos){
PathFilePathInfo pInfo;
RcSetSettings child, parent;
@@ -938,8 +943,8 @@ public class CDataDiscoveredInfoCalculator {
child.internalSetSettingsMap(createEmptyExtSetMapCopy(parent.fExtsSetToExtsSetSettingsMap));
}
}
- }
-
+ }
+
// isDerived = child.fIsDerived;
if(pInfo.fPath.segmentCount() == 0){
@@ -956,21 +961,21 @@ public class CDataDiscoveredInfoCalculator {
}
}
}
-
+
private static void processProjectPaths(RcSetSettings rcSet, PathFilePathInfo pfpi){
Collection<ExtsSetSettings> settings = rcSet.fExtsSetToExtsSetSettingsMap.values();
for (ExtsSetSettings setting : settings) {
setting.add(pfpi);
}
}
-
+
private static String getFileExt(IPath path){
String ext = path.getFileExtension();
if(ext != null)
return ext;
return ""; //$NON-NLS-1$
}
-
+
private static HashMap<ExtsSet, ExtsSetSettings> createEmptyExtSetMapCopy(HashMap<ExtsSet, ExtsSetSettings> base){
@SuppressWarnings("unchecked")
HashMap<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>)base.clone();
@@ -982,7 +987,7 @@ public class CDataDiscoveredInfoCalculator {
}
return map;
}
-
+
private static ExtsSetSettings createExtsSetSettings(IPath path, CFileData data){
CLanguageData lData = data.getLanguageData();
if(lData != null){
@@ -991,7 +996,7 @@ public class CDataDiscoveredInfoCalculator {
}
return new ExtsSetSettings(null, new ExtsSet(EMPTY_STRING_ARRAY), false);
}
-
+
private static ExtsSetSettings createExtsSetSettings(CLanguageData lData, String exts[]){
return new ExtsSetSettings(lData, new ExtsSet(exts), false);
}
@@ -1000,7 +1005,7 @@ public class CDataDiscoveredInfoCalculator {
CLanguageData[] lDatas = data.getLanguageDatas();
HashMap<ExtsSet, ExtsSetSettings> map = new HashMap<ExtsSet, ExtsSetSettings>(lDatas.length);
ExtsSetSettings settings;
-
+
if(lDatas.length != 0) {
CLanguageData lData;
for( int i = 0; i < lDatas.length; i++){
@@ -1009,7 +1014,7 @@ public class CDataDiscoveredInfoCalculator {
map.put(settings.fExtsSet, settings);
}
}
-
+
return map;
}
@@ -1017,7 +1022,7 @@ public class CDataDiscoveredInfoCalculator {
ListIndexStore store = new ListIndexStore(10);
HashMap<PathInfo, PathInfo> infoMap = new HashMap<PathInfo, PathInfo>();
// LinkedHashMap result;
-
+
Set<Entry<IResource, PathInfo>> entries = map.entrySet();
for (Entry<IResource, PathInfo> entry : entries) {
IResource rc = entry.getKey();
@@ -1028,17 +1033,17 @@ public class CDataDiscoveredInfoCalculator {
// path = path.removeFirstSegments(1);
// segCount--;
-
+
PathInfo info = entry.getValue();
PathInfo storedInfo = infoMap.get(info);
if(storedInfo == null){
storedInfo = info;
infoMap.put(storedInfo, storedInfo);
}
-
+
store.add(segCount, new PathFilePathInfo(path, storedInfo));
}
-
+
List<PathFilePathInfo> lists[] = store.getLists();
// result = new LinkedHashMap(map.size());
// List l;
@@ -1059,7 +1064,7 @@ public class CDataDiscoveredInfoCalculator {
for(int i = 0; i < lists.length; i++){
size += lists[i].size();
}
-
+
infos = new PathFilePathInfo[size];
int num = 0;
int listSize;
@@ -1071,17 +1076,17 @@ public class CDataDiscoveredInfoCalculator {
infos[num++] = list.get(k);
}
}
-
+
return infos;
}
-
+
public static CDataDiscoveredInfoCalculator getDefault(){
if(fInstance == null)
fInstance = new CDataDiscoveredInfoCalculator();
return fInstance;
}
-
- public DiscoveredSettingInfo getSettingInfos(IProject project,
+
+ public DiscoveredSettingInfo getSettingInfos(IProject project,
CConfigurationData cfgData){
InfoContext context = createContext(project, cfgData);
try {
@@ -1093,7 +1098,7 @@ public class CDataDiscoveredInfoCalculator {
}
IPath[] includes = info.getIncludePaths();
Map<String, String> symbols = info.getSymbols();
-
+
PathInfo pathInfo = new PathInfo(includes, null, symbols, null, null);
CFolderData rootData = cfgData.getRootFolderData();
IRcSettingInfo rcInfo = createRcSettingInfo(rootData, pathInfo);
@@ -1103,11 +1108,11 @@ public class CDataDiscoveredInfoCalculator {
}
return new DiscoveredSettingInfo(false, new IRcSettingInfo[0]);
}
-
+
protected InfoContext createContext(IProject project, CConfigurationData data){
return new InfoContext(project, idForData(data));
}
-
+
protected String idForData(CDataObject data){
return data.getId();
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java
index de37531abe..66d286aba6 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathContainer.java
@@ -37,7 +37,7 @@ public class DiscoveredPathContainer implements IPathEntryContainer {
fProject = project;
fPathEntries = null;
}
-
+
// public IPathEntry[] getPathEntries() {
// IPathEntry[] fPathEntries;
// try {
@@ -49,15 +49,18 @@ public class DiscoveredPathContainer implements IPathEntryContainer {
// return fPathEntries;
// }
- public String getDescription() {
+ @Override
+ public String getDescription() {
return MakeMessages.getString("DiscoveredContainer.description"); //$NON-NLS-1$
}
- public IPath getPath() {
+ @Override
+ public IPath getPath() {
return CONTAINER_ID;
}
- public IPathEntry[] getPathEntries() {
+ @Override
+ public IPathEntry[] getPathEntries() {
if (fPathEntries == null) {
try {
fPathEntries = computeNewPathEntries();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java
index 4e503a3534..43287d3d5b 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathInfo.java
@@ -51,10 +51,12 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
discoveredSymbols = new LinkedHashMap<String, SymbolEntry>();
}
+ @Override
public IProject getProject() {
return project;
}
+ @Override
public synchronized Map<String, String> getSymbols() {
if (activeSymbols == null) {
createSymbolsMap();
@@ -63,6 +65,7 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
return dSymbols;
}
+ @Override
public synchronized IPath[] getIncludePaths() {
if ( activePaths == null) {
createPathLists();
@@ -70,22 +73,24 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
return activePaths.toArray(new IPath[activePaths.size()]);
}
+ @Override
public LinkedHashMap<String, Boolean> getIncludeMap() {
return new LinkedHashMap<String, Boolean>(discoveredPaths);
}
+ @Override
public synchronized void setIncludeMap(LinkedHashMap<String, Boolean> paths) {
discoveredPaths = SafeStringInterner.safeIntern(new LinkedHashMap<String, Boolean>(paths));
activePaths = null;
}
-
+
/**
* Populates active and removed include path lists
*/
private void createPathLists() {
List<Path> aPaths = getActivePathList();
aPaths.clear();
-
+
Set<String> paths = discoveredPaths.keySet();
for (String path : paths) {
Boolean removed = discoveredPaths.get(path);
@@ -95,22 +100,24 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
}
}
+ @Override
public LinkedHashMap<String, SymbolEntry> getSymbolMap() {
return new LinkedHashMap<String, SymbolEntry>(discoveredSymbols);
}
-
+
+ @Override
public synchronized void setSymbolMap(LinkedHashMap<String, SymbolEntry> symbols) {
discoveredSymbols = SafeStringInterner.safeIntern(new LinkedHashMap<String, SymbolEntry>(symbols));
activeSymbols = null;
}
-
+
/**
* Populates active symbols sets
*/
private void createSymbolsMap() {
Map<String, String> aSymbols = getActiveSymbolsMap();
aSymbols.clear();
-
+
aSymbols.putAll(SafeStringInterner.safeIntern(ScannerConfigUtil.scSymbolEntryMap2Map(discoveredSymbols)));
}
@@ -131,9 +138,10 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#serialize(org.w3c.dom.Element)
*/
+ @Override
public void serialize(Element collectorElem) {
- Document doc = collectorElem.getOwnerDocument();
-
+ Document doc = collectorElem.getOwnerDocument();
+
Map<String, Boolean> includes = getIncludeMap();
Set<String> includesSet = includes.keySet();
for (String include : includesSet) {
@@ -172,6 +180,7 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#deserialize(org.w3c.dom.Element)
*/
+ @Override
public void deserialize(Element collectorElem) {
LinkedHashMap<String, Boolean> includes = getIncludeMap();
LinkedHashMap<String, SymbolEntry> symbols = getSymbolMap();
@@ -190,7 +199,7 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
}
child = child.getNextSibling();
}
-
+
setIncludeMap(includes);
setSymbolMap(symbols);
}
@@ -198,6 +207,7 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#getCollectorId()
*/
+ @Override
public String getCollectorId() {
return PerProjectSICollector.COLLECTOR_ID;
}
@@ -205,7 +215,8 @@ public class DiscoveredPathInfo implements IPerProjectDiscoveredPathInfo, IDisco
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getSerializable()
*/
- public IDiscoveredScannerInfoSerializable getSerializable() {
+ @Override
+ public IDiscoveredScannerInfoSerializable getSerializable() {
return this;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java
index d9ca8d3b44..305b3b0b6b 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java
@@ -62,7 +62,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
public IDiscoveredPathInfo getInfo(InfoContext context){
return fInfoMap.get(context);
}
-
+
// private Map getMap(IPath path, boolean create, boolean exactPath){
// PathSettingsContainer child = fContainer.getChildContainer(path, create, exactPath);
// Map map = null;
@@ -73,10 +73,10 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
// child.setValue(map);
// }
// }
-//
+//
// return map;
// }
-
+
// public IDiscoveredPathInfo getInfo(IFile file, String instanceId){
// IPath path = file.getProjectRelativePath();
// Map map = getMap(path, false, false);
@@ -98,20 +98,21 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
}
public DiscoveredPathManager() {
-
+
}
-
+
public void startup() {
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
-
+
public void shutdown() {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
IResource resource = event.getResource();
@@ -131,29 +132,32 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
}
}
}
-
-
+
+
+ @Override
public IDiscoveredPathInfo getDiscoveredInfo(IProject project) throws CoreException {
return getDiscoveredInfo(project, new InfoContext(project));
}
+ @Override
public IDiscoveredPathInfo getDiscoveredInfo(IProject project, InfoContext context) throws CoreException{
return getDiscoveredInfo(project, context, true);
}
+ @Override
public IDiscoveredPathInfo getDiscoveredInfo(IProject project, InfoContext context, boolean defaultToProjectSettings) throws CoreException{
DiscoveredInfoHolder holder = getHolder(project, true);
IDiscoveredPathInfo info = holder.getInfo(context);
-
+
if(info == null){
info = loadPathInfo(project, context, defaultToProjectSettings);
holder.setInfo(context, info);
}
-
+
return info;
}
-
+
private DiscoveredInfoHolder getHolder(IProject project, boolean create){
DiscoveredInfoHolder holder = fDiscoveredInfoHolderMap.get(project);
if(holder == null && create){
@@ -165,7 +169,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
private IDiscoveredPathInfo loadPathInfo(IProject project, InfoContext context, boolean defaultToProjectSettings) throws CoreException {
IDiscoveredPathInfo pathInfo = null;
-
+
IScannerConfigBuilderInfo2Set container = ScannerConfigProfileManager.createScannerConfigBuildInfo2Set(project);
IScannerConfigBuilderInfo2 buildInfo = container.getInfo(context);
if(buildInfo == null && defaultToProjectSettings)
@@ -176,7 +180,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
getSCProfileInstance(project, context, profileId);
IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
-
+
if (collector instanceof IScannerInfoCollector2) {
IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
pathInfo = collector2.createPathInfoObject();
@@ -188,20 +192,20 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
return pathInfo;
}
-
-
-
+
+
+
// private DiscoveredInfoHolder getHolder
// private IDiscoveredPathInfo loadPathInfo(IProject project) throws CoreException {
// IDiscoveredPathInfo pathInfo = null;
-//
+//
// IScannerConfigBuilderInfo2 buildInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(project);
// String profileId = buildInfo.getSelectedProfileId();
// SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
// getSCProfileInstance(project, profileId);
// IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
-//
+//
// if (collector instanceof IScannerInfoCollector2) {
// IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
// pathInfo = collector2.createPathInfoObject();
@@ -212,10 +216,12 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
// return pathInfo;
// }
+ @Override
public void removeDiscoveredInfo(IProject project) {
removeDiscoveredInfo(project, new InfoContext(project));
}
+ @Override
public void removeDiscoveredInfo(IProject project, InfoContext context) {
DiscoveredInfoHolder holder = getHolder(project, false);
if(holder != null){
@@ -229,16 +235,18 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager#updateDiscoveredInfo(org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo, java.util.List)
*/
- public void updateDiscoveredInfo(IDiscoveredPathInfo info, List<IResource> changedResources) throws CoreException {
+ @Override
+ public void updateDiscoveredInfo(IDiscoveredPathInfo info, List<IResource> changedResources) throws CoreException {
updateDiscoveredInfo(new InfoContext(info.getProject()), info, true, changedResources);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager#updateDiscoveredInfo(org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo, java.util.List)
*/
- public void updateDiscoveredInfo(InfoContext context, IDiscoveredPathInfo info, boolean updateContainer, List<IResource> changedResources) throws CoreException {
+ @Override
+ public void updateDiscoveredInfo(InfoContext context, IDiscoveredPathInfo info, boolean updateContainer, List<IResource> changedResources) throws CoreException {
DiscoveredInfoHolder holder = getHolder(info.getProject(), true);
- IDiscoveredPathInfo oldInfo = holder.getInfo(context);
+ IDiscoveredPathInfo oldInfo = holder.getInfo(context);
if (oldInfo != null) {
IDiscoveredScannerInfoSerializable serializable = info.getSerializable();
if (serializable != null) {
@@ -246,7 +254,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
IProject project = info.getProject();
DiscoveredScannerInfoStore.getInstance().saveDiscoveredScannerInfoToState(project, context, serializable);
fireUpdate(INFO_CHANGED, info);
-
+
if(updateContainer){
IScannerConfigBuilderInfo2 buildInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(project);
@@ -262,11 +270,11 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
}
}
}
-
+
/**
* Allows one to update the discovered information for a particular scanner discovery profile ID.
* TODO: This should be made API in IDiscoveredPathManager, or in an interface derived there from.
- *
+ *
* @param context
* @param info
* @param updateContainer
@@ -276,7 +284,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
*/
public void updateDiscoveredInfo(InfoContext context, IDiscoveredPathInfo info, boolean updateContainer, List<IResource> changedResources, String profileId) throws CoreException {
DiscoveredInfoHolder holder = getHolder(info.getProject(), true);
- IDiscoveredPathInfo oldInfo = holder.getInfo(context);
+ IDiscoveredPathInfo oldInfo = holder.getInfo(context);
if (oldInfo != null) {
IDiscoveredScannerInfoSerializable serializable = info.getSerializable();
if (serializable != null) {
@@ -284,11 +292,11 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
IProject project = info.getProject();
DiscoveredScannerInfoStore.getInstance().saveDiscoveredScannerInfoToState(project, context, serializable);
fireUpdate(INFO_CHANGED, info);
-
+
if(updateContainer){
IScannerConfigBuilderInfo2 buildInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(project);
-
+
ScannerConfigScope profileScope = ScannerConfigProfileManager.getInstance().
getSCProfileConfiguration(profileId).getProfileScope();
changeDiscoveredContainer(project, profileScope, changedResources);
@@ -304,17 +312,19 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager#changeDiscoveredContainer(org.eclipse.core.resources.IProject, java.lang.String)
*/
- public void changeDiscoveredContainer(final IProject project, final ScannerConfigScope profileScope, final List<IResource> changedResources) {
+ @Override
+ public void changeDiscoveredContainer(final IProject project, final ScannerConfigScope profileScope, final List<IResource> changedResources) {
// order here is of essence
// 1. clear DiscoveredPathManager's path info cache
DiscoveredInfoHolder holder = getHolder(project, false);
InfoContext context = new InfoContext(project);
IDiscoveredPathInfo oldInfo = holder.getInfo(context);
-
+
// 2. switch the containers
try {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
+ @Override
+ public void run(IProgressMonitor monitor) throws CoreException {
ICProject cProject = CoreModel.getDefault().create(project);
if (ScannerConfigScope.PROJECT_SCOPE.equals(profileScope)) {
CoreModel.setPathEntryContainer(new ICProject[]{cProject},
@@ -328,12 +338,12 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
List<PathEntryContainerChanged> changeDelta = new ArrayList<PathEntryContainerChanged>(changedResources.size());
for (IResource resource : changedResources) {
IPath path = resource.getFullPath();
- changeDelta.add(new PathEntryContainerChanged(path,
- PathEntryContainerChanged.INCLUDE_CHANGED |
+ changeDelta.add(new PathEntryContainerChanged(path,
+ PathEntryContainerChanged.INCLUDE_CHANGED |
PathEntryContainerChanged.MACRO_CHANGED)); // both include paths and symbols changed
}
- CoreModel.pathEntryContainerUpdates(container,
- changeDelta.toArray(new PathEntryContainerChanged[changeDelta.size()]),
+ CoreModel.pathEntryContainerUpdates(container,
+ changeDelta.toArray(new PathEntryContainerChanged[changeDelta.size()]),
null);
}
}
@@ -341,7 +351,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
MakeCorePlugin.log(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), 1,
MakeMessages.getString("DiscoveredContainer.ScopeErrorMessage"), null)); //$NON-NLS-1$
}
-
+
}
};
CoreModel.run(runnable, null);
@@ -349,7 +359,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
catch (CoreException e) {
MakeCorePlugin.log(e);
}
-
+
// 3. clear the container's path entry cache
if (oldInfo != null) {
fireUpdate(INFO_REMOVED, oldInfo);
@@ -362,13 +372,15 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
final IDiscoveredInfoListener listener = (IDiscoveredInfoListener)list[i];
if (listener != null) {
SafeRunner.run(new ISafeRunnable() {
-
+
+ @Override
public void handleException(Throwable exception) {
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1,
CCorePlugin.getResourceString("CDescriptorManager.exception.listenerError"), exception); //$NON-NLS-1$
CCorePlugin.log(status);
}
-
+
+ @Override
public void run() throws Exception {
switch (type) {
case INFO_CHANGED :
@@ -384,10 +396,12 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
}
}
+ @Override
public void addDiscoveredInfoListener(IDiscoveredInfoListener listener) {
listeners.add(listener);
}
+ @Override
public void removeDiscoveredInfoListener(IDiscoveredInfoListener listener) {
listeners.remove(listener);
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java
index 6c85cbd142..c95f1a4972 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredScannerInfoStore.java
@@ -32,8 +32,8 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.eclipse.cdt.make.core.MakeCorePlugin;
-import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
+import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
import org.eclipse.cdt.make.internal.core.MakeMessages;
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
import org.eclipse.core.resources.IProject;
@@ -54,18 +54,18 @@ import org.xml.sax.SAXException;
/**
* Discovered scanner info persistance store
- *
+ *
* @author vhirsl
*/
public final class DiscoveredScannerInfoStore {
- private static final QualifiedName dscFileNameProperty = new
+ private static final QualifiedName dscFileNameProperty = new
QualifiedName(MakeCorePlugin.getUniqueIdentifier(), "discoveredScannerConfigFileName"); //$NON-NLS-1$
private static final String CDESCRIPTOR_ID = MakeCorePlugin.getUniqueIdentifier() + ".discoveredScannerInfo"; //$NON-NLS-1$
public static final String SCD_STORE_VERSION = "scdStore"; //$NON-NLS-1$
public static final String SI_ELEM = "scannerInfo"; //$NON-NLS-1$
public static final String COLLECTOR_ELEM = "collector"; //$NON-NLS-1$
public static final String ID_ATTR = "id"; //$NON-NLS-1$
-
+
private static final String INSTANCE_ELEM = "instance"; //$NON-NLS-1$
private static DiscoveredScannerInfoStore instance;
@@ -82,7 +82,7 @@ public final class DiscoveredScannerInfoStore {
return instance;
}
/**
- *
+ *
*/
private DiscoveredScannerInfoStore() {
}
@@ -96,7 +96,7 @@ public final class DiscoveredScannerInfoStore {
throws CoreException {
// Get the document
Element rootElem = getRootElement(project, context, serializable);
-
+
if(rootElem != null){
// get the collector element
NodeList collectorList = rootElem.getElementsByTagName(COLLECTOR_ELEM);
@@ -113,7 +113,7 @@ public final class DiscoveredScannerInfoStore {
}
}
}
-
+
public boolean hasInfo(IProject project, InfoContext context, IDiscoveredScannerInfoSerializable serializable){
try {
if(getRootElement(project, context, serializable) != null)
@@ -123,7 +123,7 @@ public final class DiscoveredScannerInfoStore {
}
return false;
}
-
+
private Element getRootElement(IProject project, InfoContext context, IDiscoveredScannerInfoSerializable serializable) throws CoreException{
if(serializable == null)
return null;
@@ -134,17 +134,17 @@ public final class DiscoveredScannerInfoStore {
NodeList rootList = document.getElementsByTagName(SI_ELEM);
if (rootList.getLength() > 0) {
rootElem = (Element) rootList.item(0);
-
+
if(!context.isDefaultContext()){
String instanceId = context.getInstanceId();
-
+
Element instanceElem = findChild(rootElem, INSTANCE_ELEM, ID_ATTR, instanceId);
-
+
rootElem = instanceElem;
}
}
}
-
+
return rootElem;
}
@@ -200,7 +200,7 @@ public final class DiscoveredScannerInfoStore {
Element rootElem = (Element) document.getElementsByTagName(SI_ELEM).item(0);
ProcessingInstruction pi = document.createProcessingInstruction(SCD_STORE_VERSION, "version=\"2.0\""); //$NON-NLS-1$
document.insertBefore(pi, rootElem);
-
+
Element collectorElem = document.createElement(COLLECTOR_ELEM);
collectorElem.setAttribute(ID_ATTR, PerProjectSICollector.COLLECTOR_ID);
for (Node child = rootElem.getFirstChild(); child != null; child = rootElem.getFirstChild()) {
@@ -223,15 +223,15 @@ public final class DiscoveredScannerInfoStore {
}
}
}
-
+
return cfgElem;
}
-
+
private void saveDiscoveredScannerInfo(InfoContext context, IDiscoveredScannerInfoSerializable serializable, Document doc) {
NodeList rootList = doc.getElementsByTagName(SI_ELEM);
if (rootList.getLength() > 0) {
Element rootElem = (Element) rootList.item(0);
-
+
// get the collector element
if(!context.isDefaultContext()){
String instanceId = context.getInstanceId();
@@ -243,7 +243,7 @@ public final class DiscoveredScannerInfoStore {
instanceElem.setAttribute(ID_ATTR, instanceId);
rootElem.appendChild(instanceElem);
}
-
+
rootElem = instanceElem;
}
@@ -256,7 +256,7 @@ public final class DiscoveredScannerInfoStore {
Element cElem = (Element) collectorList.item(i);
String collectorId = cElem.getAttribute(ID_ATTR);
if (serializable.getCollectorId().equals(collectorId)) {
- for (Node child = cElem.getFirstChild(); child != null;
+ for (Node child = cElem.getFirstChild(); child != null;
child = cElem.getFirstChild()) {
cElem.removeChild(child);
}
@@ -271,7 +271,7 @@ public final class DiscoveredScannerInfoStore {
collectorElem.setAttribute(ID_ATTR, serializable.getCollectorId());
rootElem.appendChild(collectorElem);
}
-
+
// Save the discovered scanner info
serializable.serialize(collectorElem);
}
@@ -279,13 +279,13 @@ public final class DiscoveredScannerInfoStore {
public void saveDiscoveredScannerInfoToState(IProject project, IDiscoveredScannerInfoSerializable serializable) throws CoreException {
saveDiscoveredScannerInfoToState(project, new InfoContext(project), serializable);
}
-
+
public void saveDiscoveredScannerInfoToState(IProject project, InfoContext context, IDiscoveredScannerInfoSerializable serializable) throws CoreException {
Document document = getDocument(project);
// Create document
try {
saveDiscoveredScannerInfo(context, serializable, document);
-
+
// Transform the document to something we can save in a file
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -295,7 +295,7 @@ public final class DiscoveredScannerInfoStore {
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(stream);
transformer.transform(source, result);
-
+
// Save the document
try {
IPath path = getDiscoveredScannerConfigStore(project);
@@ -306,7 +306,7 @@ public final class DiscoveredScannerInfoStore {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1,
MakeMessages.getString("DiscoveredPathManager.File_Error_Message"), e)); //$NON-NLS-1$
}
-
+
// Close the streams
stream.close();
} catch (TransformerException e) {
@@ -345,7 +345,8 @@ public final class DiscoveredScannerInfoStore {
try {
delta.accept(new IResourceDeltaVisitor() {
- public boolean visit(IResourceDelta delta) throws CoreException {
+ @Override
+ public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
if (resource instanceof IProject) {
IProject project = (IProject) resource;
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java
index 1e0f8a404d..fb5ccb744d 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
+public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
implements IPathEntryContainerExtension {
public PerFileDiscoveredPathContainer(IProject project) {
@@ -36,13 +36,14 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IPathEntryContainerExtension#getPathEntries(org.eclipse.core.runtime.IPath, int)
*/
- public IPathEntry[] getPathEntries(IPath path, int mask) {
+ @Override
+ public IPathEntry[] getPathEntries(IPath path, int mask) {
ArrayList<IPathEntry> entries = new ArrayList<IPathEntry>();
try {
IDiscoveredPathInfo info = MakeCorePlugin.getDefault().getDiscoveryManager().getDiscoveredInfo(fProject);
if (info instanceof IPerFileDiscoveredPathInfo) {
IPerFileDiscoveredPathInfo filePathInfo = (IPerFileDiscoveredPathInfo) info;
-
+
if ((mask & IPathEntry.CDT_INCLUDE) != 0) {
IPath[] includes = filePathInfo.getIncludePaths(path);
for (int i = 0; i < includes.length; i++) {
@@ -86,7 +87,7 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
}
}
catch (CoreException e) {
- //
+ //
}
return entries.toArray(new IPathEntry[entries.size()]);
}
@@ -94,6 +95,7 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IPathEntryContainerExtension#isEmpty(org.eclipse.core.runtime.IPath)
*/
+ @Override
public boolean isEmpty(IPath path) {
IDiscoveredPathInfo info;
try {
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java
index 901befd055..a8b99bc1a4 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerConfigInfoFactory.java
@@ -51,7 +51,7 @@ public class ScannerConfigInfoFactory {
* @since 3.0
*/
static final String SI_PROFILE_ID = PREFIX + ".siProfileId"; //$NON-NLS-1$
-
+
/**
*
* @author vhirsl
@@ -60,6 +60,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#isAutoDiscoveryEnabled()
*/
+ @Override
public boolean isAutoDiscoveryEnabled() {
return getBoolean(BUILD_SCANNER_CONFIG_ENABLED);
}
@@ -67,6 +68,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setAutoDiscoveryEnabled(boolean)
*/
+ @Override
public void setAutoDiscoveryEnabled(boolean enabled) throws CoreException {
putString(BUILD_SCANNER_CONFIG_ENABLED, Boolean.toString(enabled));
}
@@ -74,6 +76,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#isMakeBuilderConsoleParserEnabled()
*/
+ @Override
public boolean isMakeBuilderConsoleParserEnabled() {
if (getString(MAKE_BUILDER_PARSER_ENABLED) == null ||
getString(MAKE_BUILDER_PARSER_ENABLED).length() == 0) { // if no property then default to true
@@ -81,10 +84,11 @@ public class ScannerConfigInfoFactory {
}
return getBoolean(MAKE_BUILDER_PARSER_ENABLED);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setMakeBuilderConsoleParserEnabled(boolean)
*/
+ @Override
public void setMakeBuilderConsoleParserEnabled(boolean enabled) throws CoreException {
putString(MAKE_BUILDER_PARSER_ENABLED, Boolean.toString(enabled));
}
@@ -92,19 +96,21 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#getMakeBuilderConsoleParserId()
*/
+ @Override
public String getMakeBuilderConsoleParserId() {
String parserId = getString(MAKE_BUILDER_PARSER_ID);
if (parserId == null || parserId.length() == 0) {
String[] parserIds = MakeCorePlugin.getDefault().
getScannerInfoConsoleParserIds("makeBuilder"); //$NON-NLS-1$
// the default is the first one in the registry
- parserId = parserIds[0];
+ parserId = parserIds[0];
}
return parserId;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setMakeBuilderConsoleParserId(java.lang.String)
*/
+ @Override
public void setMakeBuilderConsoleParserId(String parserId) throws CoreException {
putString(MAKE_BUILDER_PARSER_ID, parserId);
}
@@ -112,6 +118,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#isESIProviderCommandEnabled()
*/
+ @Override
public boolean isESIProviderCommandEnabled() {
if (getString(ESI_PROVIDER_COMMAND_ENABLED) == null ||
getString(ESI_PROVIDER_COMMAND_ENABLED).length() == 0) { // if no property then default to true
@@ -123,13 +130,15 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setESIProviderCommandEnabled(boolean)
*/
+ @Override
public void setESIProviderCommandEnabled(boolean enabled) throws CoreException {
putString(ESI_PROVIDER_COMMAND_ENABLED, Boolean.toString(enabled));
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#isDefaultESIProviderCmd()
*/
+ @Override
public boolean isDefaultESIProviderCmd() {
if (getString(USE_DEFAULT_ESI_PROVIDER_CMD) == null ||
getString(USE_DEFAULT_ESI_PROVIDER_CMD).length() == 0) { // if no property then default to true
@@ -141,6 +150,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setUseDefaultESIProviderCmd(boolean)
*/
+ @Override
public void setUseDefaultESIProviderCmd(boolean on) throws CoreException {
putString(USE_DEFAULT_ESI_PROVIDER_CMD, Boolean.toString(on));
}
@@ -148,6 +158,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#getESIProviderCommand()
*/
+ @Override
public IPath getESIProviderCommand() {
if (isDefaultESIProviderCmd()) {
String command = getESIProviderParameter("defaultCommand"); //$NON-NLS-1$
@@ -162,13 +173,15 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setESIProviderCommand(org.eclipse.core.runtime.IPath)
*/
+ @Override
public void setESIProviderCommand(IPath command) throws CoreException {
putString(ESI_PROVIDER_COMMAND, command.toString());
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#getESIProviderArguments()
*/
+ @Override
public String getESIProviderArguments() {
if (isDefaultESIProviderCmd()) {
String attributes = getESIProviderParameter("defaultAttributes"); //$NON-NLS-1$
@@ -183,6 +196,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setESIProviderArguments(java.lang.String)
*/
+ @Override
public void setESIProviderArguments(String args) throws CoreException {
putString(ESI_PROVIDER_ARGUMENTS, args);
}
@@ -190,20 +204,22 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#getESIProviderConsoleParserId()
*/
+ @Override
public String getESIProviderConsoleParserId() {
String parserId = getString(ESI_PROVIDER_PARSER_ID);
if (parserId == null || parserId.length() == 0) {
String[] parserIds = MakeCorePlugin.getDefault().
getScannerInfoConsoleParserIds("externalScannerInfoProvider"); //$NON-NLS-1$
// the default is the first one in the registry
- parserId = parserIds[0];
+ parserId = parserIds[0];
}
return parserId;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setESIProviderConsoleParserId(java.lang.String)
*/
+ @Override
public void setESIProviderConsoleParserId(String parserId) throws CoreException {
putString(ESI_PROVIDER_PARSER_ID, parserId);
}
@@ -211,6 +227,7 @@ public class ScannerConfigInfoFactory {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#isSIProblemGenerationEnabled()
*/
+ @Override
public boolean isSIProblemGenerationEnabled() {
if (getString(SI_PROBLEM_GENERATION_ENABLED) == null ||
getString(SI_PROBLEM_GENERATION_ENABLED).length() == 0) { // if no property then default to true
@@ -218,10 +235,11 @@ public class ScannerConfigInfoFactory {
}
return getBoolean(SI_PROBLEM_GENERATION_ENABLED);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setSIProblemGenerationEnabled(boolean)
*/
+ @Override
public void setSIProblemGenerationEnabled(boolean enabled) throws CoreException {
putString(SI_PROBLEM_GENERATION_ENABLED, Boolean.toString(enabled));
}
@@ -256,7 +274,7 @@ public class ScannerConfigInfoFactory {
return null;
}
}
-
+
private static class Preference extends Store {
private Preferences prefs;
private String builderID;
@@ -290,7 +308,7 @@ public class ScannerConfigInfoFactory {
return builderID;
}
}
-
+
private static class BuildProperty extends Store {
private IProject project;
private String builderID;
@@ -304,7 +322,7 @@ public class ScannerConfigInfoFactory {
throw new CoreException(new Status(IStatus.ERROR,
MakeCorePlugin.getUniqueIdentifier(), -1,
MakeMessages.getString("ScannerConfigInfoFactory.Missing_Builder")//$NON-NLS-1$
- + builderID, null));
+ + builderID, null));
}
Map<String,String> bArgs = builder.getArguments();
args = bArgs;
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java
index d296098584..26fcd27f74 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/AbstractGCCBOPConsoleParser.java
@@ -19,13 +19,13 @@ import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser;
import org.eclipse.cdt.make.internal.core.MakeMessages;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig2.SCProfileInstance;
-import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfile.BuildOutputProvider;
+import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
import org.eclipse.core.resources.IProject;
/**
* Common stuff for all GNU build output parsers
- *
+ *
* @author vhirsl
*/
public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsoleParser {
@@ -35,10 +35,10 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
protected static final String DASHIDASH= "-I-"; //$NON-NLS-1$
protected static final String DASHI= "-I"; //$NON-NLS-1$
protected static final String DASHD= "-D"; //$NON-NLS-1$
-
+
private IProject project;
protected IScannerInfoCollector collector;
-
+
private boolean bMultiline = false;
private String sMultiline = ""; //$NON-NLS-1$
@@ -65,7 +65,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
/**
* Returns array of additional compiler commands to look for
- *
+ *
* @return String[]
*/
private String[] computeCompilerCommands() {
@@ -86,13 +86,14 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
}
}
}
- return COMPILER_INVOCATION;
+ return COMPILER_INVOCATION;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#processLine(java.lang.String)
*/
- public boolean processLine(String line) {
+ @Override
+ public boolean processLine(String line) {
boolean rc = false;
int lineBreakPos = line.length()-1;
char[] lineChars = line.toCharArray();
@@ -123,7 +124,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
String make = line.substring(0, firstColon + 1);
if (firstColon != -1 && make.indexOf("make") != -1) { //$NON-NLS-1$
boolean enter = false;
- String msg = line.substring(firstColon + 1).trim();
+ String msg = line.substring(firstColon + 1).trim();
if ((enter = msg.startsWith(MakeMessages.getString("AbstractGCCBOPConsoleParser_EnteringDirectory"))) || //$NON-NLS-1$
(msg.startsWith(MakeMessages.getString("AbstractGCCBOPConsoleParser_LeavingDirectory")))) { //$NON-NLS-1$
int s = msg.indexOf('`');
@@ -146,7 +147,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
int num = 0;
if (s != -1) {
int e = line.indexOf(']');
- String number = line.substring(s + 1, e).trim();
+ String number = line.substring(s + 1, e).trim();
try {
num = Integer.parseInt(number);
} catch (NumberFormatException exc) {
@@ -156,21 +157,22 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
}
protected abstract AbstractGCCBOPConsoleParserUtility getUtility();
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#shutdown()
*/
- public void shutdown() {
+ @Override
+ public void shutdown() {
if (getUtility() != null) {
getUtility().reportProblems();
}
}
-
+
/**
- * Tokenizes a line into an array of commands. Commands are separated by
+ * Tokenizes a line into an array of commands. Commands are separated by
* ';', '&&' or '||'. Tokens are separated by whitespace unless found inside
* of quotes, back-quotes, or double quotes.
- * Outside of single-, double- or back-quotes a backslash escapes white-spaces, all quotes,
+ * Outside of single-, double- or back-quotes a backslash escapes white-spaces, all quotes,
* the backslash, '&' and '|'.
* A backslash used for escaping is removed.
* Quotes other than the back-quote plus '&&', '||', ';' are removed, also.
@@ -182,14 +184,14 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
ArrayList<String[]> commands= new ArrayList<String[]>();
ArrayList<String> tokens= new ArrayList<String>();
StringBuffer token= new StringBuffer();
-
+
final char[] input= line.toCharArray();
boolean nextEscaped= false;
char currentQuote= 0;
for (int i = 0; i < input.length; i++) {
final char c = input[i];
final boolean escaped= nextEscaped; nextEscaped= false;
-
+
if (currentQuote != 0) {
if (c == currentQuote) {
if (escaped) {
@@ -255,7 +257,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
endCommand(token, tokens, commands);
}
break;
-
+
default:
if (Character.isWhitespace(c)) {
if (escaped) {
@@ -277,7 +279,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
endCommand(token, tokens, commands);
return commands.toArray(new String[commands.size()][]);
}
-
+
private void endCommand(StringBuffer token, ArrayList<String> tokens, ArrayList<String[]> commands) {
endToken(token, tokens);
if (!tokens.isEmpty()) {
@@ -291,7 +293,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
token.setLength(0);
}
}
-
+
protected boolean processSingleLine(String line) {
boolean rc= false;
String[][] tokens= tokenize(line, true);
@@ -316,7 +318,7 @@ public abstract class AbstractGCCBOPConsoleParser implements IScannerInfoConsole
}
return rc;
}
-
+
protected int findCompilerInvocation(String[] tokens) {
for (int i = 0; i < tokens.length; i++) {
final String token = tokens[i].toLowerCase();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java
index 46a8263cb6..8c6b1889de 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java
@@ -19,6 +19,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
@@ -32,7 +33,7 @@ import org.eclipse.core.runtime.IPath;
/**
* GCC per file build output parser
- *
+ *
* @author vhirsl
*/
public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
@@ -40,13 +41,14 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
".c", ".cc", ".cpp", ".cxx", ".C", ".CC", ".CPP", ".CXX" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
};
private final static List<String> FILE_EXTENSIONS_LIST = Arrays.asList(FILE_EXTENSIONS);
-
+
private GCCPerFileBOPConsoleParserUtility fUtil;
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#startup(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector, org.eclipse.cdt.core.IMarkerGenerator)
*/
- public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
+ @Override
+ public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
fUtil = (project != null && workingDirectory != null && markerGenerator != null) ?
new GCCPerFileBOPConsoleParserUtility(project, workingDirectory, markerGenerator) : null;
super.startup(project, collector);
@@ -65,7 +67,7 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
*/
@Override
protected boolean processCommand(String[] tokens) {
- // GCC C/C++ compiler invocation
+ // GCC C/C++ compiler invocation
int compilerInvocationIndex= findCompilerInvocation(tokens);
if (compilerInvocationIndex < 0) {
return false;
@@ -117,7 +119,7 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
tokens[i]= "SHORT_NAME" + token.substring(shortFileName.length()); //$NON-NLS-1$
}
}
-
+
IFile file= null;
IPath baseDirectory= fUtil.getBaseDirectory();
if (baseDirectory.isPrefixOf(pFilePath) || baseDirectory.setDevice(null).isPrefixOf(pFilePath)) {
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java
index 6162cf9c62..9201476a89 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileSIPConsoleParser.java
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.IPath;
/**
* Console parser for generated makefile output
- *
+ *
* @author vhirsl
*/
public class GCCPerFileSIPConsoleParser implements IScannerInfoConsoleParser {
@@ -39,9 +39,9 @@ public class GCCPerFileSIPConsoleParser implements IScannerInfoConsoleParser {
private final static int NO_INCLUDES = 0;
private final static int QUOTE_INCLUDES = 1;
private final static int INCLUDES = 2;
-
+
private IScannerInfoCollector fCollector = null;
-
+
private int expectingIncludes = NO_INCLUDES;
private List<String> symbols;
private List<String> includes;
@@ -51,14 +51,16 @@ public class GCCPerFileSIPConsoleParser implements IScannerInfoConsoleParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#startup(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector, org.eclipse.cdt.core.IMarkerGenerator)
*/
- public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
+ @Override
+ public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
this.fCollector = collector;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParser#processLine(java.lang.String)
*/
- public boolean processLine(String line) {
+ @Override
+ public boolean processLine(String line) {
boolean rc = false;
line= line.trim();
TraceUtil.outputTrace("GCCPerFileSIPConsoleParser parsing line: [", line, "]"); //$NON-NLS-1$//$NON-NLS-2$
@@ -114,14 +116,15 @@ public class GCCPerFileSIPConsoleParser implements IScannerInfoConsoleParser {
if (!includes.contains(line))
includes.add(line);
}
-
+
return rc;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParser#shutdown()
*/
- public void shutdown() {
+ @Override
+ public void shutdown() {
// Map scannerInfo = new HashMap();
// scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes);
// scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java
index 496b912704..ef2d34dab8 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java
@@ -30,18 +30,19 @@ import org.eclipse.core.runtime.Path;
/**
* Parses gcc and g++ output for -I and -D parameters.
- *
+ *
* @author vhirsl
*/
public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
protected ScannerInfoConsoleParserUtility fUtil = null;
private String fDefaultMacroDefinitionValue= "1"; //$NON-NLS-1$
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#startup(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector, org.eclipse.cdt.core.IMarkerGenerator)
*/
- public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
+ @Override
+ public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
fUtil = (project != null && workingDirectory != null && markerGenerator != null) ?
new ScannerInfoConsoleParserUtility(project, workingDirectory, markerGenerator) : null;
super.startup(project, collector);
@@ -61,7 +62,7 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
if (compilerInvocationIdx<0) {
return false;
}
-
+
if (compilerInvocationIdx+1 >= tokens.length) {
return false;
}
@@ -164,7 +165,7 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
return false; // return when no file was given (analogous to GCCPerFileBOPConsoleParser)
}
- IProject project = getProject();
+ IProject project = getProject();
IFile file = null;
List<String> translatedIncludes = includes;
if (includes.size() > 0) {
@@ -200,7 +201,7 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
}
return true;
}
-
+
public void setDefaultMacroDefinitionValue(String val) {
if (val != null) {
fDefaultMacroDefinitionValue= val;
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java
index 16e1d2f6c7..bd42c16fd9 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
@@ -30,7 +30,7 @@ import org.eclipse.core.runtime.IPath;
* Parses output of gcc -c -v specs.c or
* g++ -c -v specs.cpp
* command
- *
+ *
* @author vhirsl
*/
public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
@@ -39,7 +39,7 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
private IProject fProject = null;
protected IScannerInfoCollector fCollector = null;
-
+
private boolean expectingIncludes = false;
protected List<String> symbols = new ArrayList<String>();
protected List<String> includes = new ArrayList<String>();
@@ -47,7 +47,8 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser#startup(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IPath, org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector, org.eclipse.cdt.core.IMarkerGenerator)
*/
- public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
+ @Override
+ public void startup(IProject project, IPath workingDirectory, IScannerInfoCollector collector, IMarkerGenerator markerGenerator) {
this.fProject = project;
this.fCollector = collector;
}
@@ -55,6 +56,7 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParser#processLine(java.lang.String)
*/
+ @Override
public boolean processLine(String line) {
boolean rc = false;
line= line.trim();
@@ -89,7 +91,7 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
if (defineParts.length > 2) {
symbol += defineParts[2];
}
- if (!symbols.contains(symbol)) {
+ if (!symbols.contains(symbol)) {
symbols.add(symbol);
}
}
@@ -106,13 +108,14 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
if (!includes.contains(line))
includes.add(line);
}
-
+
return rc;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParser#shutdown()
*/
+ @Override
public void shutdown() {
Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>();
scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, includes);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/jobs/SCJobsUtil.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/jobs/SCJobsUtil.java
index 0cf997ac8d..188b2054a8 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/jobs/SCJobsUtil.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/jobs/SCJobsUtil.java
@@ -34,7 +34,7 @@ import org.eclipse.core.runtime.SafeRunner;
/**
* Utility class for build and job related functionality
- *
+ *
* @author vhirsl
*/
public class SCJobsUtil {
@@ -54,7 +54,7 @@ public class SCJobsUtil {
public void set(boolean rc) {
this.rc = rc;
}
-
+
@Override
public String toString() {
return rc ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
@@ -69,7 +69,7 @@ public class SCJobsUtil {
final IProgressMonitor monitor) {
return getProviderScannerInfo(project, buildInfo.getContext(), buildInfo, monitor);
}
-
+
public static boolean getProviderScannerInfo(final IProject project,
final InfoContext context,
final IScannerConfigBuilderInfo2 buildInfo,
@@ -90,7 +90,8 @@ public class SCJobsUtil {
if (esiProvider != null) {
ISafeRunnable runnable = new ISafeRunnable() {
- public void run() {
+ @Override
+ public void run() {
// TODO we need the environment for the project here...
ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
@@ -104,12 +105,13 @@ public class SCJobsUtil {
esiProvider.invokeProvider(monitor, project, context, providerId, buildInfo, collector, env);
rc.set(true);
}
-
- public void handleException(Throwable exception) {
+
+ @Override
+ public void handleException(Throwable exception) {
rc.set(false);
MakeCorePlugin.log(exception);
}
-
+
};
SafeRunner.run(runnable);
}
@@ -143,12 +145,14 @@ public class SCJobsUtil {
final IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
ISafeRunnable runnable = new ISafeRunnable() {
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
collector2.updateScannerConfiguration(monitor);
rc.set(true);
}
-
- public void handleException(Throwable exception) {
+
+ @Override
+ public void handleException(Throwable exception) {
rc.set(false);
MakeCorePlugin.log(exception);
}
@@ -156,7 +160,7 @@ public class SCJobsUtil {
};
SafeRunner.run(runnable);
}
-
+
return rc.get();
}
@@ -180,21 +184,23 @@ public class SCJobsUtil {
if (buildInfo.isBuildOutputFileActionEnabled()) {
ISafeRunnable runnable = new ISafeRunnable() {
-
- public void run() {
+
+ @Override
+ public void run() {
esiProvider.invokeProvider(monitor, project, context, null, buildInfo, collector, null);
rc.set(true);
}
-
- public void handleException(Throwable exception) {
+
+ @Override
+ public void handleException(Throwable exception) {
rc.set(false);
MakeCorePlugin.log(exception);
}
-
+
};
SafeRunner.run(runnable);
}
-
+
return rc.get();
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
index 8f9cbfb9c3..1b8d8b8d14 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
* Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
@@ -51,7 +51,7 @@ import org.osgi.service.prefs.BackingStoreException;
/**
* New default external scanner info provider of type 'run'
- *
+ *
* @author vhirsl
*/
public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
@@ -70,19 +70,21 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
protected IPath fWorkingDirectory;
protected IPath fCompileCommand;
protected String[] fCompileArguments;
-
+
private SCMarkerGenerator markerGenerator = new SCMarkerGenerator();
- public boolean invokeProvider(IProgressMonitor monitor, IResource resource,
+ @Override
+ public boolean invokeProvider(IProgressMonitor monitor, IResource resource,
String providerId, IScannerConfigBuilderInfo2 buildInfo,
IScannerInfoCollector collector) {
return invokeProvider(monitor, resource, new InfoContext(resource.getProject()), providerId, buildInfo, collector, null);
}
-
- public boolean invokeProvider(IProgressMonitor monitor,
- IResource resource,
+
+ @Override
+ public boolean invokeProvider(IProgressMonitor monitor,
+ IResource resource,
InfoContext context,
- String providerId,
+ String providerId,
IScannerConfigBuilderInfo2 buildInfo,
IScannerInfoCollector collector,
Properties env) {
@@ -91,7 +93,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
this.providerId = providerId;
this.buildInfo = buildInfo;
this.collector = collector;
-
+
IProject currentProject = resource.getProject();
// call a subclass to initialize protected fields
if (!initialize()) {
@@ -101,7 +103,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
monitor = new NullProgressMonitor();
}
monitor.beginTask(MakeMessages.getString("ExternalScannerInfoProvider.Reading_Specs"), 100); //$NON-NLS-1$
-
+
try {
ILanguage language = context.getLanguage();
IConsole console;
@@ -118,7 +120,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
// Before launching give visual cues via the monitor
monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Reading_Specs")); //$NON-NLS-1$
-
+
String errMsg = null;
ICommandLauncher launcher = new CommandLauncher();
launcher.setProject(currentProject);
@@ -198,29 +200,29 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
}
return true;
}
-
+
protected IPath getCommandToLaunch() {
return fCompileCommand;
}
-
+
protected String[] getCommandLineOptions() {
// add additional arguments
// subclass can change default behavior
- return prepareArguments(
+ return prepareArguments(
buildInfo.isUseDefaultProviderCommand(providerId));
}
-
+
private void printLine(OutputStream stream, String msg) throws IOException {
stream.write((msg + NEWLINE).getBytes());
stream.flush();
}
-
+
/**
- * Initialization of protected fields.
+ * Initialization of protected fields.
* Subclasses are most likely to override default implementation.
*/
protected boolean initialize() {
-
+
IProject currProject = resource.getProject();
//fWorkingDirectory = resource.getProject().getLocation();
URI workingDirURI = MakeBuilderUtil.getBuildDirectoryURI(currProject, MakeBuilder.BUILDER_ID);
@@ -228,12 +230,12 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
if(pathString != null) {
fWorkingDirectory = new Path(pathString);
}
-
+
else {
// blow up
throw new IllegalStateException();
}
-
+
fCompileCommand = new Path(buildInfo.getProviderRunCommand(providerId));
fCompileArguments = ScannerConfigUtil.tokenizeStringWithQuotes(buildInfo.getProviderRunArguments(providerId), "\"");//$NON-NLS-1$
return (fCompileCommand != null);
@@ -261,7 +263,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
private Properties getEnvMap(ICommandLauncher launcher, Properties initialEnv) {
// Set the environmennt, some scripts may need the CWD var to be set.
Properties props = initialEnv != null ? initialEnv : launcher.getEnvironment();
-
+
if (fWorkingDirectory != null) {
props.put("CWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
props.put("PWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
@@ -309,7 +311,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
/**
* Check preference to stream output of scanner discovery to a console.
- *
+ *
* @return boolean preference value
*/
public static boolean isConsoleEnabled() {
@@ -317,5 +319,5 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
.getBoolean(PREF_CONSOLE_ENABLED, false);
return value;
}
-
+
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java
index 949c16879e..3675378aac 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java
@@ -40,26 +40,28 @@ import org.eclipse.core.runtime.IProgressMonitor;
/**
* New default external scanner info provider of type 'open'
- *
+ *
* @author vhirsl
*/
public class DefaultSIFileReader implements IExternalScannerInfoProvider {
private static final String EXTERNAL_SI_PROVIDER_CONSOLE_ID = MakeCorePlugin.getUniqueIdentifier() + ".ExternalScannerInfoProviderConsole"; //$NON-NLS-1$
private long fileSize = 0;
-
+
private SCMarkerGenerator markerGenerator = new SCMarkerGenerator();
- public boolean invokeProvider(IProgressMonitor monitor, IResource resource,
+ @Override
+ public boolean invokeProvider(IProgressMonitor monitor, IResource resource,
String providerId, IScannerConfigBuilderInfo2 buildInfo,
IScannerInfoCollector collector) {
return invokeProvider(monitor, resource, new InfoContext(resource.getProject()), providerId, buildInfo, collector, null);
}
-
- public boolean invokeProvider(IProgressMonitor monitor,
- IResource resource,
+
+ @Override
+ public boolean invokeProvider(IProgressMonitor monitor,
+ IResource resource,
InfoContext context,
- String providerId,
+ String providerId,
IScannerConfigBuilderInfo2 buildInfo,
IScannerInfoCollector collector,
Properties env) {
@@ -69,7 +71,7 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider {
BufferedReader reader = getStreamReader(buildInfo.getBuildOutputFilePath());
if (reader == null)
return rc;
-
+
try {
// output
IConsole console = CCorePlugin.getDefault().getConsole(EXTERNAL_SI_PROVIDER_CONSOLE_ID);
@@ -81,16 +83,16 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider {
catch (CoreException e) {
ostream = null;
}
-
+
// get build location
IPath buildDirectory = MakeBuilderUtil.getBuildDirectory(project, MakeBuilder.BUILDER_ID);
-
+
ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.
getMakeBuilderOutputSniffer(ostream, null, project, context, buildDirectory, buildInfo, markerGenerator, collector);
if (sniffer != null) {
ostream = sniffer.getOutputStream();
}
-
+
if (ostream != null) {
rc = readFileToOutputStream(monitor, reader, ostream);
}
@@ -100,7 +102,7 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider {
} catch (IOException e) {
MakeCorePlugin.log(e);
}
- }
+ }
return rc;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java
index ab5f2e5ea8..e7881ff98f 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
@@ -20,22 +20,22 @@ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
-import java.util.Map.Entry;
import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.make.core.MakeCorePlugin;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo2;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner;
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
import org.eclipse.cdt.make.core.scannerconfig.PathInfo;
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo2;
import org.eclipse.cdt.make.internal.core.MakeMessages;
import org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore;
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
@@ -57,7 +57,7 @@ import org.w3c.dom.NodeList;
/**
* Per file scanner info collector
- *
+ *
* @author vhirsl
*/
public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoCollectorCleaner {
@@ -65,7 +65,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
protected static final int QUOTE_INCLUDE_PATH = 2;
protected static final int INCLUDE_FILE = 3;
protected static final int MACROS_FILE = 4;
-
+
protected class ScannerInfoData implements IDiscoveredScannerInfoSerializable {
protected final Map<Integer, Set<IFile>> commandIdToFilesMap; // command id and set of files it applies to
protected final Map<IFile, Integer> fileToCommandIdMap; // maps each file to the corresponding command id
@@ -80,30 +80,31 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#serialize(org.w3c.dom.Element)
*/
- public void serialize(Element collectorElem) {
+ @Override
+ public void serialize(Element collectorElem) {
synchronized (PerFileSICollector.this.fLock) {
Document doc = collectorElem.getOwnerDocument();
-
+
List<Integer> commandIds = new ArrayList<Integer>(commandIdCommandMap.keySet());
Collections.sort(commandIds);
for (Integer commandId : commandIds) {
CCommandDSC command = commandIdCommandMap.get(commandId);
-
- Element cmdElem = doc.createElement(CC_ELEM);
+
+ Element cmdElem = doc.createElement(CC_ELEM);
collectorElem.appendChild(cmdElem);
- cmdElem.setAttribute(ID_ATTR, commandId.toString());
+ cmdElem.setAttribute(ID_ATTR, commandId.toString());
cmdElem.setAttribute(FILE_TYPE_ATTR, command.appliesToCPPFileType() ? "c++" : "c"); //$NON-NLS-1$ //$NON-NLS-2$
// write command and scanner info
command.serialize(cmdElem);
// write files command applies to
- Element filesElem = doc.createElement(APPLIES_TO_ATTR);
+ Element filesElem = doc.createElement(APPLIES_TO_ATTR);
cmdElem.appendChild(filesElem);
Set<IFile> files = commandIdToFilesMap.get(commandId);
if (files != null) {
for (IFile file : files) {
- Element fileElem = doc.createElement(FILE_ELEM);
+ Element fileElem = doc.createElement(FILE_ELEM);
IPath path = file.getProjectRelativePath();
- fileElem.setAttribute(PATH_ATTR, path.toString());
+ fileElem.setAttribute(PATH_ATTR, path.toString());
filesElem.appendChild(fileElem);
}
}
@@ -114,10 +115,11 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#deserialize(org.w3c.dom.Element)
*/
- public void deserialize(Element collectorElem) {
+ @Override
+ public void deserialize(Element collectorElem) {
synchronized (PerFileSICollector.this.fLock) {
for (Node child = collectorElem.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeName().equals(CC_ELEM)) {
+ if (child.getNodeName().equals(CC_ELEM)) {
Element cmdElem = (Element) child;
boolean cppFileType = cmdElem.getAttribute(FILE_TYPE_ATTR).equals("c++"); //$NON-NLS-1$
CCommandDSC command = new CCommandDSC(cppFileType, project);
@@ -145,12 +147,13 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoStore.IDiscoveredScannerInfoSerializable#getCollectorId()
*/
- public String getCollectorId() {
+ @Override
+ public String getCollectorId() {
return COLLECTOR_ID;
}
}
-
+
protected static class ProjectScannerInfo {
IPath[] includePaths;
IPath[] quoteIncludePaths;
@@ -165,7 +168,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
definedSymbols.size() == 0);
}
}
-
+
public static final String COLLECTOR_ID = MakeCorePlugin.getUniqueIdentifier() + ".PerFileSICollector"; //$NON-NLS-1$
protected static final String CC_ELEM = "compilerCommand"; //$NON-NLS-1$
protected static final String ID_ATTR = "id"; //$NON-NLS-1$
@@ -173,47 +176,49 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
protected static final String APPLIES_TO_ATTR = "appliesToFiles"; //$NON-NLS-1$
protected static final String FILE_ELEM = "file"; //$NON-NLS-1$
protected static final String PATH_ATTR = "path"; //$NON-NLS-1$
-
+
protected IProject project;
protected InfoContext context;
-
+
protected ScannerInfoData sid; // scanner info data
protected ProjectScannerInfo psi = null; // sum of all scanner info
-
+
// protected List siChangedForFileList; // list of files for which scanner info has changed
protected final Map<IFile, Integer> siChangedForFileMap; // (file, comandId) map for deltas
protected final List<Integer> siChangedForCommandIdList; // list of command ids for which scanner info has changed
-
+
protected final SortedSet<Integer> freeCommandIdPool; // sorted set of free command ids
protected int commandIdCounter = 0;
-
+
/** monitor for data access */
protected final Object fLock = new Object();
/**
- *
+ *
*/
public PerFileSICollector() {
sid = new ScannerInfoData();
-
+
// siChangedForFileList = new ArrayList();
siChangedForFileMap = new HashMap<IFile, Integer>();
siChangedForCommandIdList = new ArrayList<Integer>();
-
+
freeCommandIdPool = new TreeSet<Integer>();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#setProject(org.eclipse.core.resources.IProject)
*/
- public void setProject(IProject project) {
+ @Override
+ public void setProject(IProject project) {
setInfoContext(new InfoContext(project));
}
- public void setInfoContext(InfoContext context) {
+ @Override
+ public void setInfoContext(InfoContext context) {
this.project = context.getProject();
this.context = context;
-
+
try {
// deserialize from SI store
DiscoveredScannerInfoStore.getInstance().loadDiscoveredScannerInfoFromState(project, context, sid);
@@ -230,7 +235,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
*/
- public void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) {
+ @Override
+ public void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) {
// check the resource
String errorMessage = null;
if (resource == null) {
@@ -257,9 +263,9 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
TraceUtil.outputError("PerFileSICollector.contributeToScannerConfig : ", errorMessage); //$NON-NLS-1$
return;
}
-
+
IFile file = (IFile) resource;
-
+
synchronized (fLock) {
@SuppressWarnings("unchecked")
Map<ScannerInfoTypes, List<CCommandDSC>> scanInfo = scannerInfo;
@@ -292,7 +298,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
siItem = CygpathTranslator.translateIncludePaths(project, siItem);
siItem = CCommandDSC.makeRelative(project, siItem);
cmd.setQuoteIncludes(siItem);
-
+
cmd.setDiscovered(true);
}
}
@@ -317,7 +323,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
cmd.setCommandId(commandId);
sid.commandIdCommandMap.put(cmd.getCommandIdAsInteger(), cmd);
}
-
+
generateFileDelta(file, cmd);
}
@@ -342,7 +348,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
for (IFile file : resources) {
Integer commandId = siChangedForFileMap.get(file);
if (commandId != null) {
-
+
// update sid.commandIdToFilesMap
Set<IFile> fileSet = sid.commandIdToFilesMap.get(commandId);
if (fileSet == null) {
@@ -408,8 +414,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
sid.commandIdCommandMap.remove(cmdId);
sid.commandIdToFilesMap.remove(cmdId);
}
- while (!freeCommandIdPool.isEmpty()) {
- Integer last = freeCommandIdPool.last();
+ while (!freeCommandIdPool.isEmpty()) {
+ Integer last = freeCommandIdPool.last();
if (last.intValue() == commandIdCounter) {
freeCommandIdPool.remove(last);
--commandIdCounter;
@@ -417,16 +423,17 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
else break;
}
}
-
+
protected void addScannerInfo(ScannerInfoTypes type, List<CCommandDSC> delta) {
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#updateScannerConfiguration(org.eclipse.core.runtime.IProgressMonitor)
*/
- public void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException {
+ @Override
+ public void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
@@ -464,7 +471,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#createPathInfoObject()
*/
- public IDiscoveredPathInfo createPathInfoObject() {
+ @Override
+ public IDiscoveredPathInfo createPathInfoObject() {
return new PerFileDiscoveredPathInfo();
}
@@ -477,13 +485,14 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#getCollectedScannerInfo(java.lang.Object, org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes)
*/
- public List<CCommandDSC> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
+ @Override
+ public List<CCommandDSC> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
List<CCommandDSC> rv = new ArrayList<CCommandDSC>();
// check the resource
String errorMessage = null;
if (resource == null) {
errorMessage = "resource is null";//$NON-NLS-1$
- }
+ }
else if (!(resource instanceof IResource)) {
errorMessage = "resource is not an IResource";//$NON-NLS-1$
}
@@ -493,7 +502,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
else if (((IResource) resource).getProject() != project) {
errorMessage = "wrong project";//$NON-NLS-1$
}
-
+
if (errorMessage != null) {
TraceUtil.outputError("PerProjectSICollector.getCollectedScannerInfo : ", errorMessage); //$NON-NLS-1$
return rv;
@@ -540,39 +549,44 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deleteAllPaths(org.eclipse.core.resources.IResource)
*/
- public void deleteAllPaths(IResource resource) {
+ @Override
+ public void deleteAllPaths(IResource resource) {
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deleteAllSymbols(org.eclipse.core.resources.IResource)
*/
- public void deleteAllSymbols(IResource resource) {
+ @Override
+ public void deleteAllSymbols(IResource resource) {
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deletePath(org.eclipse.core.resources.IResource, java.lang.String)
*/
- public void deletePath(IResource resource, String path) {
+ @Override
+ public void deletePath(IResource resource, String path) {
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deleteSymbol(org.eclipse.core.resources.IResource, java.lang.String)
*/
- public void deleteSymbol(IResource resource, String symbol) {
+ @Override
+ public void deleteSymbol(IResource resource, String symbol) {
// TODO Auto-generated method stub
-
+
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner#deleteAll(org.eclipse.core.resources.IResource)
*/
- public void deleteAll(IResource resource) {
+ @Override
+ public void deleteAll(IResource resource) {
if (resource.equals(project)) {
synchronized (fLock) {
// siChangedForFileList = new ArrayList();
@@ -583,10 +597,10 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
// siChangedForFileList.add(path);
siChangedForFileMap.put(file, null);
}
-
+
sid = new ScannerInfoData();
psi = null;
-
+
commandIdCounter = 0;
freeCommandIdPool.clear();
}
@@ -595,21 +609,23 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/**
* Per file DPI object
- *
+ *
* @author vhirsl
*/
protected class PerFileDiscoveredPathInfo implements IPerFileDiscoveredPathInfo2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getProject()
*/
- public IProject getProject() {
+ @Override
+ public IProject getProject() {
return project;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getIncludePaths()
*/
- public IPath[] getIncludePaths() {
+ @Override
+ public IPath[] getIncludePaths() {
final IPath[] includepaths;
final IPath[] quotepaths;
synchronized (PerFileSICollector.this.fLock) {
@@ -632,7 +648,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getSymbols()
*/
- public Map<String, String> getSymbols() {
+ @Override
+ public Map<String, String> getSymbols() {
// return new HashMap();
synchronized (PerFileSICollector.this.fLock) {
return getAllSymbols();
@@ -642,7 +659,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getIncludePaths(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getIncludePaths(IPath path) {
+ @Override
+ public IPath[] getIncludePaths(IPath path) {
synchronized (PerFileSICollector.this.fLock) {
// get the command
CCommandDSC cmd = getCommand(path);
@@ -660,7 +678,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getQuoteIncludePaths(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getQuoteIncludePaths(IPath path) {
+ @Override
+ public IPath[] getQuoteIncludePaths(IPath path) {
synchronized (PerFileSICollector.this.fLock) {
// get the command
CCommandDSC cmd = getCommand(path);
@@ -678,7 +697,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getSymbols(org.eclipse.core.runtime.IPath)
*/
- public Map<String, String> getSymbols(IPath path) {
+ @Override
+ public Map<String, String> getSymbols(IPath path) {
synchronized (PerFileSICollector.this.fLock) {
// get the command
CCommandDSC cmd = getCommand(path);
@@ -703,7 +723,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo#getIncludeFiles(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getIncludeFiles(IPath path) {
+ @Override
+ public IPath[] getIncludeFiles(IPath path) {
synchronized (PerFileSICollector.this.fLock) {
// get the command
CCommandDSC cmd = getCommand(path);
@@ -721,7 +742,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getMacroFiles(org.eclipse.core.runtime.IPath)
*/
- public IPath[] getMacroFiles(IPath path) {
+ @Override
+ public IPath[] getMacroFiles(IPath path) {
synchronized (PerFileSICollector.this.fLock) {
// get the command
CCommandDSC cmd = getCommand(path);
@@ -739,7 +761,8 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#getSerializable()
*/
- public IDiscoveredScannerInfoSerializable getSerializable() {
+ @Override
+ public IDiscoveredScannerInfoSerializable getSerializable() {
synchronized (PerFileSICollector.this.fLock) {
return sid;
}
@@ -748,6 +771,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo#isEmpty(org.eclipse.core.runtime.IPath)
*/
+ @Override
public boolean isEmpty(IPath path) {
boolean rc = true;
IResource resource = project.getWorkspace().getRoot().findMember(path);
@@ -764,6 +788,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
return rc;
}
+ @Override
public Map<IResource, PathInfo> getPathInfoMap() {
synchronized (PerFileSICollector.this.fLock) {
//TODO: do we need to cache this?
@@ -772,10 +797,10 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
}
}
-
+
protected Map<IResource, PathInfo> calculatePathInfoMap(){
assert Thread.holdsLock(fLock);
-
+
Map<IResource, PathInfo> map = new HashMap<IResource, PathInfo>(sid.fileToCommandIdMap.size() + 1);
Set<Entry<IFile, Integer>> entrySet = sid.fileToCommandIdMap.entrySet();
for (Entry<IFile, Integer> entry : entrySet) {
@@ -788,19 +813,19 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
}
}
}
-
+
if(project != null){
if(psi == null){
generateProjectScannerInfo();
}
-
+
PathInfo fpi = new PathInfo(psi.includePaths, psi.quoteIncludePaths, psi.definedSymbols, psi.includeFiles, psi.macrosFiles);
map.put(project, fpi);
}
-
+
return map;
}
-
+
protected static PathInfo createFilePathInfo(CCommandDSC cmd){
IPath[] includes = stringListToPathArray(cmd.getIncludes());
IPath[] quotedIncludes = stringListToPathArray(cmd.getQuoteIncludes());
@@ -813,7 +838,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
String value = ScannerConfigUtil.getSymbolValue(symbol);
definedSymbols.put(key, value);
}
-
+
return new PathInfo(includes, quotedIncludes, definedSymbols, incFiles, macroFiles);
}
@@ -845,7 +870,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
* <li><code>QUOTE_INCLUDE_PATH</code>
* <li><code>INCLUDE_FILE</code>
* <li><code>MACROS_FILE</code>
- *
+ *
* @return list of IPath(s).
*/
protected IPath[] getAllIncludePaths(int type) {
@@ -859,7 +884,7 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
case INCLUDE_PATH:
discovered = cmd.getIncludes();
break;
- case QUOTE_INCLUDE_PATH:
+ case QUOTE_INCLUDE_PATH:
discovered = cmd.getQuoteIncludes();
break;
case INCLUDE_FILE:
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
index 09b5dd6655..5b6bdd3b85 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
* Anton Leherbauer (Wind River Systems)
@@ -27,6 +27,8 @@ import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.make.core.MakeCorePlugin;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerProjectDiscoveredPathInfo;
import org.eclipse.cdt.make.core.scannerconfig.IExternalScannerInfoProvider;
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
@@ -35,8 +37,6 @@ import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner;
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerProjectDiscoveredPathInfo;
import org.eclipse.cdt.make.internal.core.MakeMessages;
import org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredPathContainer;
import org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredPathInfo;
@@ -61,7 +61,7 @@ import org.w3c.dom.Element;
/**
* New per project scanner info collector
- *
+ *
* @since 3.0
* @author vhirsl
*/
@@ -71,22 +71,22 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
protected IProject project;
protected InfoContext context;
private boolean isBuiltinConfig= false;
-
+
protected Map<ScannerInfoTypes, List<String>> discoveredSI;
-// private List discoveredIncludes;
+// private List discoveredIncludes;
// private List discoveredSymbols;
// private List discoveredTSO; // target specific options
// cumulative values
- protected List<String> sumDiscoveredIncludes;
+ protected List<String> sumDiscoveredIncludes;
private Map<String, SymbolEntry> sumDiscoveredSymbols;
protected boolean scPersisted = false;
-
+
public PerProjectSICollector() {
discoveredSI = new HashMap<ScannerInfoTypes, List<String>>();
// discoveredIncludes = new ArrayList();
// discoveredSymbols = new ArrayList();
// discoveredTSO = new ArrayList();
-//
+//
sumDiscoveredIncludes = new ArrayList<String>();
sumDiscoveredSymbols = new LinkedHashMap<String, SymbolEntry>();
}
@@ -94,6 +94,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#setProject(org.eclipse.core.resources.IProject)
*/
+ @Override
public void setProject(IProject project) {
this.project = project;
this.context = new InfoContext(project);
@@ -112,12 +113,13 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
*/
+ @Override
public synchronized void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) {
// check the resource
String errorMessage = null;
if (resource == null) {
errorMessage = "resource is null";//$NON-NLS-1$
- }
+ }
else if (!(resource instanceof IResource)) {
errorMessage = "resource is not an IResource";//$NON-NLS-1$
}
@@ -131,7 +133,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
TraceUtil.outputError("PerProjectSICollector.contributeToScannerConfig : ", errorMessage); //$NON-NLS-1$
return;
}
-
+
if (scPersisted) {
// delete discovered scanner config
discoveredSI.clear();
@@ -141,13 +143,13 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
try {
if (/*project.hasNature(MakeProjectNature.NATURE_ID) && */// limits to StandardMake projects
(project.hasNature(CProjectNature.C_NATURE_ID) ||
- project.hasNature(CCProjectNature.CC_NATURE_ID))) {
+ project.hasNature(CCProjectNature.CC_NATURE_ID))) {
for (Object name : scannerInfo.keySet()) {
ScannerInfoTypes siType = (ScannerInfoTypes) name;
@SuppressWarnings("unchecked")
List<String> delta = (List<String>) scannerInfo.get(siType);
-
+
List<String> discovered = discoveredSI.get(siType);
if (discovered == null) {
discovered = new ArrayList<String>(delta);
@@ -159,7 +161,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
}
}
}
- }
+ }
catch (CoreException e) {
MakeCorePlugin.log(e);
}
@@ -179,18 +181,18 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/**
* Adds new items to the already accumulated ones preserving order
- *
+ *
* @param sumIncludes - previously accumulated items
* @param includes - items to be added
* @param ordered - to preserve order or append at the end
* @return boolean - true if added
*/
protected boolean addItemsWithOrder(List<String> sumIncludes, List<String> includes, boolean ordered) {
- if (includes.isEmpty())
+ if (includes.isEmpty())
return false;
-
+
boolean addedIncludes = false;
- int insertionPoint= ordered ? 0 : sumIncludes.size();
+ int insertionPoint= ordered ? 0 : sumIncludes.size();
for (String item : includes) {
int pos= sumIncludes.indexOf(item);
if (pos >= 0) {
@@ -200,7 +202,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
} else {
sumIncludes.add(insertionPoint++, item);
addedIncludes = true;
- }
+ }
}
return addedIncludes;
}
@@ -208,6 +210,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#updateScannerConfiguration(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public synchronized void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException {
if (monitor == null) {
monitor = new NullProgressMonitor();
@@ -215,7 +218,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
IDiscoveredPathInfo pathInfo = MakeCorePlugin.getDefault().getDiscoveryManager().getDiscoveredInfo(project, context);
if (pathInfo instanceof IPerProjectDiscoveredPathInfo) {
IPerProjectDiscoveredPathInfo projectPathInfo = (IPerProjectDiscoveredPathInfo) pathInfo;
-
+
monitor.beginTask(MakeMessages.getString("ScannerInfoCollector.Processing"), 100); //$NON-NLS-1$
monitor.subTask(MakeMessages.getString("ScannerInfoCollector.Processing")); //$NON-NLS-1$
if (scannerConfigNeedsUpdate(projectPathInfo)) {
@@ -242,7 +245,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
private boolean scannerConfigNeedsUpdate(IPerProjectDiscoveredPathInfo discPathInfo) {
boolean addedIncludes = includePathsNeedUpdate(discPathInfo);
boolean addedSymbols = definedSymbolsNeedUpdate(discPathInfo);
-
+
return (addedIncludes | addedSymbols);
}
@@ -253,7 +256,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
boolean addedIncludes = false;
List<String> discoveredIncludes = discoveredSI.get(ScannerInfoTypes.INCLUDE_PATHS);
if (discoveredIncludes != null) {
- // Step 1. Add discovered scanner config to the existing discovered scanner config
+ // Step 1. Add discovered scanner config to the existing discovered scanner config
// add the includes from the latest discovery
// if (sumDiscoveredIncludes == null) {
// sumDiscoveredIncludes = new ArrayList(discoveredIncludes);
@@ -267,15 +270,15 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
// try to translate cygpaths to absolute paths
List<String> finalSumIncludes = CygpathTranslator.translateIncludePaths(project, sumDiscoveredIncludes);
-
+
// Step 2. Get project's scanner config
LinkedHashMap<String, Boolean> persistedIncludes = discPathInfo.getIncludeMap();
-
+
// Step 3. Merge scanner config from steps 1 and 2
// order is important, use list to preserve it
ArrayList<String> persistedKeyList = new ArrayList<String>(persistedIncludes.keySet());
addedIncludes = addItemsWithOrder(persistedKeyList, finalSumIncludes, true);
-
+
LinkedHashMap<String, Boolean> newPersistedIncludes;
if (addedIncludes) {
newPersistedIncludes = new LinkedHashMap<String, Boolean>(persistedKeyList.size());
@@ -287,10 +290,10 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
// the paths may be on EFS resources, not local
Boolean includePathExists = true;
URI projectLocationURI = discPathInfo.getProject().getLocationURI();
-
+
// use the project's location... create a URI that uses the same provider but that points to the include path
URI includeURI = EFSExtensionManager.getDefault().createNewURIFromPath(projectLocationURI, include);
-
+
// ask EFS if the path exists
try {
IFileStore fileStore = EFS.getStore(includeURI);
@@ -301,7 +304,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
} catch (CoreException e) {
MakeCorePlugin.log(e);
}
-
+
// if the include path doesn't exist, then we tell the scanner config system that the folder
// has been "removed", and thus it won't show up in the UI
newPersistedIncludes.put(include, !includePathExists);
@@ -311,13 +314,13 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
else {
newPersistedIncludes = persistedIncludes;
}
-
+
// Step 4. Set resulting scanner config
discPathInfo.setIncludeMap(newPersistedIncludes);
}
return addedIncludes;
}
-
+
/**
* Compare symbol definitions with already discovered.
*/
@@ -325,20 +328,20 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
boolean addedSymbols = false;
List<String> discoveredSymbols = discoveredSI.get(ScannerInfoTypes.SYMBOL_DEFINITIONS);
if (discoveredSymbols != null) {
- // Step 1. Add discovered scanner config to the existing discovered scanner config
+ // Step 1. Add discovered scanner config to the existing discovered scanner config
// add the symbols from the latest discovery
// if (sumDiscoveredSymbols == null) {
// sumDiscoveredSymbols = new LinkedHashMap();
// }
addedSymbols = ScannerConfigUtil.scAddSymbolsList2SymbolEntryMap(sumDiscoveredSymbols, discoveredSymbols, true);
-
+
// Step 2. Get project's scanner config
LinkedHashMap<String, SymbolEntry> persistedSymbols = discPathInfo.getSymbolMap();
-
+
// Step 3. Merge scanner config from steps 1 and 2
LinkedHashMap<String, SymbolEntry> candidateSymbols = new LinkedHashMap<String, SymbolEntry>(persistedSymbols);
addedSymbols |= ScannerConfigUtil.scAddSymbolEntryMap2SymbolEntryMap(candidateSymbols, sumDiscoveredSymbols);
-
+
// Step 4. Set resulting scanner config
discPathInfo.setSymbolMap(candidateSymbols);
}
@@ -348,13 +351,14 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#getCollectedScannerInfo(java.lang.Object, org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes)
*/
- public List<String> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
+ @Override
+ public List<String> getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
List<String> rv = null;
// check the resource
String errorMessage = null;
if (resource == null) {
errorMessage = "resource is null";//$NON-NLS-1$
- }
+ }
else if (!(resource instanceof IResource)) {
errorMessage = "resource is not an IResource";//$NON-NLS-1$
}
@@ -364,7 +368,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
else if (((IResource) resource).getProject() != project) {
errorMessage = "wrong project";//$NON-NLS-1$
}
-
+
if (errorMessage != null) {
TraceUtil.outputError("PerProjectSICollector.getCollectedScannerInfo : ", errorMessage); //$NON-NLS-1$
}
@@ -406,7 +410,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deleteAllPaths(org.eclipse.core.resources.IResource)
*/
- public void deleteAllPaths(IResource resource) {
+ @Override
+ public void deleteAllPaths(IResource resource) {
IProject project = resource.getProject();
if (project != null && project.equals(this.project)) {
sumDiscoveredIncludes.clear();
@@ -416,7 +421,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deleteAllSymbols(org.eclipse.core.resources.IResource)
*/
- public void deleteAllSymbols(IResource resource) {
+ @Override
+ public void deleteAllSymbols(IResource resource) {
IProject project = resource.getProject();
if (project != null && project.equals(this.project)) {
sumDiscoveredSymbols.clear();
@@ -426,7 +432,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deletePath(org.eclipse.core.resources.IResource, java.lang.String)
*/
- public void deletePath(IResource resource, String path) {
+ @Override
+ public void deletePath(IResource resource, String path) {
IProject project = resource.getProject();
if (project != null && project.equals(this.project)) {
sumDiscoveredIncludes.remove(path);
@@ -436,10 +443,11 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorUtil#deleteSymbol(org.eclipse.core.resources.IResource, java.lang.String)
*/
- public void deleteSymbol(IResource resource, String symbol) {
+ @Override
+ public void deleteSymbol(IResource resource, String symbol) {
IProject project = resource.getProject();
if (project != null && project.equals(this.project)) {
- // remove it from the Map of SymbolEntries
+ // remove it from the Map of SymbolEntries
ScannerConfigUtil.removeSymbolEntryValue(symbol, sumDiscoveredSymbols);
}
}
@@ -447,7 +455,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner#deleteAll(org.eclipse.core.resources.IResource)
*/
- public void deleteAll(IResource resource) {
+ @Override
+ public void deleteAll(IResource resource) {
deleteAllPaths(resource);
deleteAllSymbols(resource);
}
@@ -455,7 +464,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2#createPathInfoObject()
*/
- public IDiscoveredPathInfo createPathInfoObject() {
+ @Override
+ public IDiscoveredPathInfo createPathInfoObject() {
DiscoveredPathInfo pathInfo = new DiscoveredPathInfo(project);
try {
DiscoveredScannerInfoStore.getInstance().loadDiscoveredScannerInfoFromState(project, context, pathInfo);
@@ -463,13 +473,13 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
catch (CoreException e) {
MakeCorePlugin.log(e);
}
- return pathInfo;
+ return pathInfo;
}
/**
* Static method to return compiler built-in scanner info.
* Preconditions: resource has to be contained by a project that has following natures:
- * C nature, CC nature (for C++ projects), Make nature and ScannerConfig nature
+ * C nature, CC nature (for C++ projects), Make nature and ScannerConfig nature
*/
public static void calculateCompilerBuiltins(final IProject project) throws CModelException {
createDiscoveredPathContainer(project, new NullProgressMonitor());
@@ -484,10 +494,11 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
((IScannerInfoCollectorCleaner) collector).deleteAll(project);
}
final IExternalScannerInfoProvider esiProvider = profileInstance.createExternalScannerInfoProvider("specsFile");//$NON-NLS-1$
-
+
// Set the arguments for the provider
-
+
ISafeRunnable runnable = new ISafeRunnable() {
+ @Override
public void run() throws CoreException {
IProgressMonitor monitor = new NullProgressMonitor();
esiProvider.invokeProvider(monitor, project, "specsFile", buildInfo, collector);//$NON-NLS-1$
@@ -496,7 +507,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
collector2.updateScannerConfiguration(monitor);
}
}
-
+
+ @Override
public void handleException(Throwable exception) {
if (exception instanceof OperationCanceledException) {
throw (OperationCanceledException) exception;
@@ -505,7 +517,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
};
SafeRunner.run(runnable);
}
-
+
private static void createDiscoveredPathContainer(IProject project, IProgressMonitor monitor) throws CModelException {
IPathEntry container = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
ICProject cProject = CoreModel.getDefault().create(project);
@@ -521,13 +533,14 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(project);
}
+ @Override
public void setInfoContext(InfoContext context) {
this.context = context;
this.project = context.getProject();
}
-
+
public InfoContext getContext(){
return this.context;
}
-
+
}
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 85ebeab08b..719beb22e1 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
@@ -29,13 +29,13 @@ import org.eclipse.core.runtime.jobs.Job;
/**
* Scanner config discovery related marker generator
- *
+ *
* @author vhirsl
*/
public class SCMarkerGenerator implements IMarkerGenerator {
/**
- *
+ *
*/
public SCMarkerGenerator() {
super();
@@ -44,6 +44,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IMarkerGenerator#addMarker(org.eclipse.core.resources.IResource, int, java.lang.String, int, java.lang.String)
*/
+ @Override
public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
ProblemMarkerInfo info = new ProblemMarkerInfo(file, lineNumber, errorDesc, severity, errorVar);
addMarker(info);
@@ -52,6 +53,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IMarkerGenerator#addMarker(org.eclipse.cdt.core.ProblemMarkerInfo)
*/
+ @Override
public void addMarker(final ProblemMarkerInfo problemMarkerInfo) {
// 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
@@ -79,7 +81,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
} catch (CoreException e) {
return new Status(Status.ERROR, MakeCorePlugin.getUniqueIdentifier(), Messages.SCMarkerGenerator_Error_Adding_Markers, e);
}
-
+
try {
marker = problemMarkerInfo.file.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
@@ -87,7 +89,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
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);
}
@@ -95,7 +97,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
} catch (CoreException e) {
return new Status(Status.ERROR, MakeCorePlugin.getUniqueIdentifier(), Messages.SCMarkerGenerator_Error_Adding_Markers, e);
}
-
+
return Status.OK_STATUS;
}
};
@@ -131,7 +133,7 @@ public class SCMarkerGenerator implements IMarkerGenerator {
MakeCorePlugin.log(e.getStatus());
}
}
-
+
int mapMarkerSeverity(int severity) {
switch (severity) {
case SEVERITY_ERROR_BUILD :
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java
index db1b2df83e..bc177dc2ac 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM - Initial API and implementation
* James Blackburn (Broadcom Corp.)
@@ -42,11 +42,11 @@ import org.eclipse.core.runtime.Status;
/**
* New ScannerConfigInfoFactory
- *
+ *
* @author vhirsl
*/
public class ScannerConfigInfoFactory2 {
- // build properties
+ // build properties
private static final String SCANNER_CONFIG = "scannerConfiguration"; //$NON-NLS-1$
private static final String SC_AUTODISCOVERY = "autodiscovery"; //$NON-NLS-1$
private static final String ENABLED = "enabled"; //$NON-NLS-1$
@@ -81,19 +81,19 @@ public class ScannerConfigInfoFactory2 {
private static final String SI_PROVIDER_PARSER_ENABLED = ".parser.enabled";//$NON-NLS-1$
private static final String INFO_INSTANCE_IDS = SCD + "instanceIds";//$NON-NLS-1$
private static final String DELIMITER = ";";//$NON-NLS-1$
-
-
+
+
private static final String ELEMENT_CS_INFO = "scannerConfigBuildInfo";//$NON-NLS-1$
private static final String ATTRIBUTE_CS_INFO_INSTANCE_ID = "instanceId";//$NON-NLS-1$
-
+
private static class ScannerConfigInfoSet extends StoreSet {
private IProject fProject;
-
+
ScannerConfigInfoSet(IProject project, String profileId){
this.fProject = project;
load(profileId);
}
-
+
private void load(String profileId) {
ICDescriptor descriptor;
try {
@@ -124,6 +124,7 @@ public class ScannerConfigInfoFactory2 {
}
}
+ @Override
public void save() throws CoreException {
save(false);
}
@@ -132,19 +133,19 @@ public class ScannerConfigInfoFactory2 {
if (isDirty()) {
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
ICStorageElement sc = descriptor.getProjectStorageElement(SCANNER_CONFIG);
-
+
// Clear all child settings
sc.clear();
-
+
BuildProperty prop = (BuildProperty)fMap.get(new InfoContext(fProject));
prop.store(sc);
-
+
for (Entry<InfoContext, IScannerConfigBuilderInfo2> entry : fMap.entrySet()) {
-
+
InfoContext context = entry.getKey();
if(context.isDefaultContext())
continue;
-
+
String instanceId = context.getInstanceId();
if(instanceId.length() == 0)
continue;
@@ -152,19 +153,20 @@ public class ScannerConfigInfoFactory2 {
BuildProperty p = (BuildProperty)entry.getValue();
if(p == prop)
continue;
-
+
ICStorageElement el = sc.createChild(ELEMENT_CS_INFO);
el.setAttribute(ATTRIBUTE_CS_INFO_INSTANCE_ID, instanceId);
p.store(el);
}
-
+
if(serializeDescriptor)
descriptor.saveProjectData();
-
+
fIsDirty = false;
}
}
-
+
+ @Override
public IProject getProject() {
return fProject;
}
@@ -174,51 +176,52 @@ public class ScannerConfigInfoFactory2 {
return new BuildProperty(this, fProject, context, base, profileId);
}
}
-
+
private static class PreferenceSet extends StoreSet {
- private Preferences prefs;
+ private Preferences prefs;
private boolean useDefaults;
PreferenceSet(Preferences prefs, String profileId, boolean loadDefaults){
this.prefs = prefs;
this.useDefaults = loadDefaults;
load(profileId);
}
-
+
private void load(String profileId) {
InfoContext defaultContext = new InfoContext(null);
String instancesStr = getString(INFO_INSTANCE_IDS);
String[] instanceIds = CDataUtil.stringToArray(instancesStr, DELIMITER);
Preference pref = new Preference(this, prefs, defaultContext, profileId, useDefaults);
fMap.put(defaultContext, pref);
-
+
if(instanceIds != null && instanceIds.length != 0){
for(int i = 0; i < instanceIds.length; i++) {
String id = instanceIds[i];
if(id.length() == 0)
continue;
-
+
InfoContext c = new InfoContext(null, id);
-
+
Preference p = new Preference(this, prefs, c, profileId, useDefaults);
fMap.put(c, p);
}
}
}
-
+
+ @Override
public void save() throws CoreException {
if (isDirty()) {
-
+
Set<String> idSet = new HashSet<String>(fMap.size() - 1);
-
+
Preference pref = (Preference)fMap.get(new InfoContext(null));
pref.store();
-
+
for (Entry<InfoContext, IScannerConfigBuilderInfo2> entry : fMap.entrySet()) {
InfoContext context = entry.getKey();
if(context.isDefaultContext())
continue;
-
+
String instanceId = context.getInstanceId();
if(instanceId.length() == 0)
continue;
@@ -228,20 +231,21 @@ public class ScannerConfigInfoFactory2 {
continue;
p.store();
-
+
idSet.add(instanceId);
}
-
+
if(idSet.size() != 0){
String[] ids = idSet.toArray(new String[idSet.size()]);
String idsString = CDataUtil.arrayToString(ids, DELIMITER);
set(INFO_INSTANCE_IDS, idsString);
}
-
+
fIsDirty = false;
}
}
-
+
+ @Override
public IProject getProject() {
return null;
}
@@ -250,14 +254,14 @@ public class ScannerConfigInfoFactory2 {
protected Store doCreateStore(InfoContext context, Store base, String profileId) {
return new Preference(this, prefs, context, base, profileId, useDefaults);
}
-
+
private String getString(String name) {
if (useDefaults) {
return prefs.getDefaultString(name);
}
return prefs.getString(name);
}
-
+
private void set(String name, String value) {
if (useDefaults) {
prefs.setDefault(name, value);
@@ -268,14 +272,15 @@ public class ScannerConfigInfoFactory2 {
}
}
-
+
private static abstract class StoreSet implements IScannerConfigBuilderInfo2Set {
protected HashMap<InfoContext, IScannerConfigBuilderInfo2> fMap = new HashMap<InfoContext, IScannerConfigBuilderInfo2>();
protected boolean fIsDirty;
-
+
StoreSet(){
}
-
+
+ @Override
public IScannerConfigBuilderInfo2 createInfo(InfoContext context,
IScannerConfigBuilderInfo2 base, String profileId){
fIsDirty = true;
@@ -283,38 +288,43 @@ public class ScannerConfigInfoFactory2 {
fMap.put(context, store);
return store;
}
-
+
protected abstract Store doCreateStore(InfoContext context, Store base, String profileId);
+ @Override
public IScannerConfigBuilderInfo2 createInfo(InfoContext context,
IScannerConfigBuilderInfo2 base){
fIsDirty = true;
return createInfo(context, base, ScannerConfigProfileManager.NULL_PROFILE_ID);
}
+ @Override
public InfoContext[] getContexts() {
return fMap.keySet().toArray(new InfoContext[fMap.size()]);
}
+ @Override
public IScannerConfigBuilderInfo2 getInfo(InfoContext context) {
return fMap.get(context);
}
+ @Override
public Map<InfoContext, IScannerConfigBuilderInfo2> getInfoMap() {
return Collections.unmodifiableMap(fMap);
}
+ @Override
public IScannerConfigBuilderInfo2 removeInfo(InfoContext context) throws CoreException {
checkRemoveInfo(context);
fIsDirty = true;
return fMap.remove(context);
}
-
+
private void checkRemoveInfo(InfoContext context) throws CoreException{
if(context.isDefaultContext())
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.PLUGIN_ID, MakeConfigurationDataProviderMessages.getString("ScannerConfigInfoFactory2.0"))); //$NON-NLS-1$
}
-
+
public boolean isDirty(){
if(fIsDirty)
return true;
@@ -322,15 +332,17 @@ public class ScannerConfigInfoFactory2 {
if(((Store)prop).isDirty)
return true;
}
-
+
return false;
}
+ @Override
public IScannerConfigBuilderInfo2 createInfo(InfoContext context) {
fIsDirty = true;
return createInfo(context, ScannerConfigProfileManager.NULL_PROFILE_ID);
}
+ @Override
public IScannerConfigBuilderInfo2 createInfo(InfoContext context,
String profileId) {
fIsDirty = true;
@@ -346,17 +358,17 @@ public class ScannerConfigInfoFactory2 {
protected boolean autoDiscoveryEnabled;
protected boolean problemReportingEnabled;
protected String selectedProfile = EMPTY_STRING;
- /** Map from profile ID -> default ProfileOptions
+ /** Map from profile ID -> default ProfileOptions
* allows us to avoid storing options to .cproject when they are default .*/
- protected static Map<String, ProfileOptions> defaultProfiles = new ConcurrentHashMap<String, ProfileOptions>();
+ protected static Map<String, ProfileOptions> defaultProfiles = new ConcurrentHashMap<String, ProfileOptions>();
/** Map from profile ID -> ProfileOptions */
- protected Map<String, ProfileOptions> profileOptionsMap = new LinkedHashMap<String, ProfileOptions>();
+ protected Map<String, ProfileOptions> profileOptionsMap = new LinkedHashMap<String, ProfileOptions>();
static class ProfileOptions implements Cloneable {
protected boolean buildOutputFileActionEnabled;
protected String buildOutputFilePath = EMPTY_STRING;
protected boolean buildOutputParserEnabled;
/** Map from provider ID -> providerOptions */
- protected Map<String, ProviderOptions> providerOptionsMap;
+ protected Map<String, ProviderOptions> providerOptionsMap;
static class ProviderOptions implements Cloneable {
protected String providerKind; // derived
protected boolean providerOutputParserEnabled;
@@ -364,7 +376,7 @@ public class ScannerConfigInfoFactory2 {
protected String providerRunCommand = EMPTY_STRING;
protected String providerRunArguments = EMPTY_STRING;
protected String providerOpenFilePath = EMPTY_STRING;
-
+
ProviderOptions(){
}
@@ -428,7 +440,7 @@ public class ScannerConfigInfoFactory2 {
return false;
return true;
}
-
+
@Override
protected ProviderOptions clone() throws CloneNotSupportedException {
return (ProviderOptions)super.clone();
@@ -517,13 +529,14 @@ public class ScannerConfigInfoFactory2 {
ProfileOptions basePo = entry.getValue();
entry.setValue(new ProfileOptions(basePo));
}
-
+
isDirty = true;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#isAutoDiscoveryEnabled()
*/
+ @Override
public boolean isAutoDiscoveryEnabled() {
return autoDiscoveryEnabled;
}
@@ -531,6 +544,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setAutoDiscoveryEnabled(boolean)
*/
+ @Override
public void setAutoDiscoveryEnabled(boolean enable) {
autoDiscoveryEnabled = setDirty(autoDiscoveryEnabled, enable);
}
@@ -538,18 +552,21 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#isSIProblemGenerationEnabled()
*/
+ @Override
public boolean isProblemReportingEnabled() {
return problemReportingEnabled;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setSIProblemGenerationEnabled(boolean)
*/
+ @Override
public void setProblemReportingEnabled(boolean enable) {
problemReportingEnabled = setDirty(problemReportingEnabled, enable);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getSelectedProfileId()
*/
+ @Override
public String getSelectedProfileId() {
return selectedProfile;
}
@@ -557,6 +574,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setSelectedProfileId(java.lang.String)
*/
+ @Override
public void setSelectedProfileId(String profileId) {
selectedProfile = SafeStringInterner.safeIntern(setDirty(selectedProfile, profileId));
// if (isDirty) {
@@ -573,13 +591,15 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getProfileIdList()
*/
- public List<String> getProfileIdList() {
+ @Override
+ public List<String> getProfileIdList() {
return new ArrayList<String>(profileOptionsMap.keySet());
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#isBuildOutputFileActionEnabled()
*/
+ @Override
public boolean isBuildOutputFileActionEnabled() {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
return (po != null) ? po.buildOutputFileActionEnabled : false;
@@ -588,6 +608,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setBuildOutputFileActionEnabled(boolean)
*/
+ @Override
public void setBuildOutputFileActionEnabled(boolean enable) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -598,6 +619,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getBuildOutputFilePath()
*/
+ @Override
public String getBuildOutputFilePath() {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
return (po != null) ? po.buildOutputFilePath : EMPTY_STRING;
@@ -606,6 +628,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setBuildOutputFilePath(java.lang.String)
*/
+ @Override
public void setBuildOutputFilePath(String path) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -616,6 +639,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#isBuildOutputParserEnabled()
*/
+ @Override
public boolean isBuildOutputParserEnabled() {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
return (po != null) ? po.buildOutputParserEnabled : true;
@@ -624,6 +648,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setBuildOutputParserEnabled(boolean)
*/
+ @Override
public void setBuildOutputParserEnabled(boolean enable) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -634,6 +659,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getSIProviderIdList()
*/
+ @Override
public List<String> getProviderIdList() {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
return (po != null) ? new ArrayList<String>(po.providerOptionsMap.keySet()) : new ArrayList<String>(0);
@@ -656,6 +682,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#isSIProviderOutputParserEnabled(java.lang.String)
*/
+ @Override
public boolean isProviderOutputParserEnabled(String providerId) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -668,6 +695,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setSIProviderOutputParserEnabled(java.lang.String, boolean)
*/
+ @Override
public void setProviderOutputParserEnabled(String providerId, boolean enable) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -681,6 +709,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#isUseDefaultProviderCommand(java.lang.String)
*/
+ @Override
public boolean isUseDefaultProviderCommand(String providerId) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -693,6 +722,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setUseDefaultProviderCommand(java.lang.String, boolean)
*/
+ @Override
public void setUseDefaultProviderCommand(String providerId, boolean enable) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -706,6 +736,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getProviderRunCommand(java.lang.String)
*/
+ @Override
public String getProviderRunCommand(String providerId) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -718,6 +749,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setProviderRunCommand(java.lang.String, java.lang.String)
*/
+ @Override
public void setProviderRunCommand(String providerId, String command) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -731,6 +763,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getProviderRunArguments(java.lang.String)
*/
+ @Override
public String getProviderRunArguments(String providerId) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -743,6 +776,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setProviderRunArguments(java.lang.String, java.lang.String)
*/
+ @Override
public void setProviderRunArguments(String providerId, String arguments) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -756,6 +790,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#getProviderOpenFilePath(java.lang.String)
*/
+ @Override
public String getProviderOpenFilePath(String providerId) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -768,6 +803,7 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#setProviderOpenFilePath(java.lang.String, java.lang.String)
*/
+ @Override
public void setProviderOpenFilePath(String providerId, String filePath) {
ProfileOptions po = profileOptionsMap.get(selectedProfile);
if (po != null) {
@@ -777,7 +813,7 @@ public class ScannerConfigInfoFactory2 {
}
}
}
-
+
private boolean setDirty(boolean l, boolean r) {
isDirty = isDirty || (l != r);
return r;
@@ -786,13 +822,13 @@ public class ScannerConfigInfoFactory2 {
isDirty = isDirty || !l.equals(r);
return r;
}
-
+
// protected abstract void load();
// public abstract void store();
/**
* Load defaults for the specified profileId.
- * Returns a clone() of the default profile matching the passed in profileId
+ * Returns a clone() of the default profile matching the passed in profileId
*/
protected static ProfileOptions getDefaultProfile(String profileId) {
if (defaultProfiles.containsKey(profileId))
@@ -811,7 +847,7 @@ public class ScannerConfigInfoFactory2 {
po.buildOutputFileActionEnabled = true;
String buildOutputFilePath = configuredProfile.getBuildOutputProviderElement().
getAction().getAttribute("file");//$NON-NLS-1$
- po.buildOutputFilePath = (buildOutputFilePath != null) ? buildOutputFilePath : EMPTY_STRING;
+ po.buildOutputFilePath = (buildOutputFilePath != null) ? buildOutputFilePath : EMPTY_STRING;
}
}
@@ -826,7 +862,7 @@ public class ScannerConfigInfoFactory2 {
if (ppo.providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.RUN)) {
ppo.providerRunUseDefault = true;
attrValue = configuredProvider.getAction().getAttribute(COMMAND);
- ppo.providerRunCommand = (attrValue != null) ? attrValue : EMPTY_STRING;
+ ppo.providerRunCommand = (attrValue != null) ? attrValue : EMPTY_STRING;
attrValue = configuredProvider.getAction().getAttribute(ARGUMENTS);
ppo.providerRunArguments = (attrValue != null) ? attrValue : EMPTY_STRING;
} else if (ppo.providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.OPEN)) {
@@ -845,7 +881,7 @@ public class ScannerConfigInfoFactory2 {
/**
* Build properties stored in .cproject file
- *
+ *
* Responsible for both load and store. Doesn't store profile settings if they're identical to the default.
*/
private static class BuildProperty extends Store {
@@ -862,7 +898,7 @@ public class ScannerConfigInfoFactory2 {
this.container = container;
load(element);
}
-
+
BuildProperty(ScannerConfigInfoSet container, IProject project, InfoContext context, Store base, String profileId) {
super(base, profileId);
this.project = project;
@@ -896,7 +932,7 @@ public class ScannerConfigInfoFactory2 {
if (sc.getName().equals(SC_AUTODISCOVERY)) {
autoDiscoveryEnabled = Boolean.valueOf(
sc.getAttribute(ENABLED)).booleanValue();
- selectedProfile = (profileId == ScannerConfigProfileManager.NULL_PROFILE_ID)
+ selectedProfile = (profileId == ScannerConfigProfileManager.NULL_PROFILE_ID)
? sc.getAttribute(SELECTED_PROFILE_ID)
: profileId;
selectedProfile = SafeStringInterner.safeIntern(selectedProfile);
@@ -929,11 +965,11 @@ public class ScannerConfigInfoFactory2 {
problemReportingEnabled = oldInfo.isSIProblemGenerationEnabled();
// effectively a PerProject profile
selectedProfile = SafeStringInterner.safeIntern(profileId);
-
+
ProfileOptions po = new ProfileOptions();
po.buildOutputFileActionEnabled = false;
po.buildOutputParserEnabled = oldInfo.isMakeBuilderConsoleParserEnabled();
-
+
ProfileOptions.ProviderOptions ppo = new ProfileOptions.ProviderOptions();
ppo.providerKind = ScannerConfigProfile.ScannerInfoProvider.RUN;
ppo.providerOutputParserEnabled = oldInfo.isESIProviderCommandEnabled();
@@ -947,14 +983,14 @@ public class ScannerConfigInfoFactory2 {
String providerId = configuredProfile.getSIProviderIds().get(0);
po.providerOptionsMap = new LinkedHashMap<String, ProfileOptions.ProviderOptions>(1);
po.providerOptionsMap.put(providerId, ppo);
-
+
profileOptionsMap = new LinkedHashMap<String, ProfileOptions>(1);
profileOptionsMap.put(profileId, po);
-
+
// store migrated data
isDirty = true;
save();
- }
+ }
catch (CoreException e) {
MakeCorePlugin.log(e);
rc = false;
@@ -996,12 +1032,12 @@ public class ScannerConfigInfoFactory2 {
po.providerOptionsMap.put(providerId, ppo);
ppo.providerKind = configuredProfile.getScannerInfoProviderElement(
providerId).getProviderKind();
-
+
for (ICStorageElement grandchild : child.getChildren()) {
// action
if (RUN_ACTION.equals(grandchild.getName())) {
ppo.providerRunUseDefault = Boolean.valueOf(
- grandchild.getAttribute(USE_DEFAULT)).booleanValue();
+ grandchild.getAttribute(USE_DEFAULT)).booleanValue();
ppo.providerRunCommand = grandchild.getAttribute(COMMAND);
ppo.providerRunArguments = grandchild.getAttribute(ARGUMENTS);
}
@@ -1052,7 +1088,7 @@ public class ScannerConfigInfoFactory2 {
/**
* @param profile element
- * @param po options
+ * @param po options
*/
private void store(ICStorageElement profile, ProfileOptions po) {
ICStorageElement child, grandchild;
@@ -1073,19 +1109,19 @@ public class ScannerConfigInfoFactory2 {
for (int i = 0; i < providerIds.size(); ++i) {
String providerId = providerIds.get(i);
ProfileOptions.ProviderOptions ppo = po.providerOptionsMap.get(providerId);
-
+
if (ppo != null) {
child = profile.createChild(SCANNER_INFO_PROVIDER);
child.setAttribute(ID, providerId);
-
+
// action
// String providerKind = configuredProfile.getScannerInfoProviderElement(
// providerId).getProviderKind();
String providerKind = ppo.providerKind;
-
+
if (providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.RUN)) {
grandchild = child.createChild(RUN_ACTION);
- grandchild.setAttribute(USE_DEFAULT, Boolean.toString(ppo.providerRunUseDefault));
+ grandchild.setAttribute(USE_DEFAULT, Boolean.toString(ppo.providerRunUseDefault));
if(ppo.providerRunCommand != null)
grandchild.setAttribute(COMMAND, ppo.providerRunCommand);
if(ppo.providerRunArguments != null)
@@ -1110,14 +1146,16 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#save()
*/
- public synchronized void save() throws CoreException {
+ @Override
+ public synchronized void save() throws CoreException {
if(isDirty){
container.save(true);
isDirty = false;
}
}
-
- public InfoContext getContext(){
+
+ @Override
+ public InfoContext getContext(){
return context;
}
@@ -1125,7 +1163,7 @@ public class ScannerConfigInfoFactory2 {
/**
* Preferences
- *
+ *
* @author vhirsl
*/
private static class Preference extends Store {
@@ -1144,7 +1182,7 @@ public class ScannerConfigInfoFactory2 {
this.context = context;
load();
}
-
+
Preference(PreferenceSet container, Preferences prefs, InfoContext context, Store base, String profileId, boolean useDefaults) {
super(base, profileId);
this.prefs = prefs;
@@ -1169,12 +1207,12 @@ public class ScannerConfigInfoFactory2 {
protected void load() {
String instanceId = context.getInstanceId();
String prefix = instanceId.length() == 0 ? "" : ATTRIBUTE_CS_INFO_INSTANCE_ID + DOT + instanceId + DOT; //$NON-NLS-1$
-
+
autoDiscoveryEnabled = getBoolean(prefix + SCANNER_CONFIG_AUTODISCOVERY_ENABLED_SUFFIX);
- selectedProfile = (ScannerConfigProfileManager.NULL_PROFILE_ID.equals(profileId)) ?
- getString(prefix + SCANNER_CONFIG_SELECTED_PROFILE_ID_SUFFIX) :
+ selectedProfile = (ScannerConfigProfileManager.NULL_PROFILE_ID.equals(profileId)) ?
+ getString(prefix + SCANNER_CONFIG_SELECTED_PROFILE_ID_SUFFIX) :
profileId;
- selectedProfile = SafeStringInterner.safeIntern(selectedProfile);
+ selectedProfile = SafeStringInterner.safeIntern(selectedProfile);
problemReportingEnabled = getBoolean(prefix + SCANNER_CONFIG_PROBLEM_REPORTING_ENABLED_SUFFIX);
if (ScannerConfigProfileManager.NULL_PROFILE_ID.equals(selectedProfile) && !useDefaults) {
// get the default value
@@ -1195,7 +1233,7 @@ public class ScannerConfigInfoFactory2 {
po.buildOutputFileActionEnabled = getBoolean(SCD + prefix + profileId + BUILD_OUTPUT_OPEN_ACTION_ENABLED);
po.buildOutputFilePath = getString(SCD + prefix + profileId + BUILD_OUTPUT_OPEN_ACTION_FILE_PATH);
po.buildOutputParserEnabled = getBoolean(SCD + prefix + profileId + BUILD_OUTPUT_PARSER_ENABLED);
-
+
ScannerConfigProfile configuredProfile = ScannerConfigProfileManager.getInstance().
getSCProfileConfiguration(profileId);
List<String> providerIds = configuredProfile.getSIProviderIds();
@@ -1205,25 +1243,25 @@ public class ScannerConfigInfoFactory2 {
po.providerOptionsMap.put(providerId, ppo);
ppo.providerKind = configuredProfile.getScannerInfoProviderElement(
providerId).getProviderKind();
-
- ppo.providerOutputParserEnabled = getBoolean(SCD + prefix + profileId + DOT +
+
+ ppo.providerOutputParserEnabled = getBoolean(SCD + prefix + profileId + DOT +
providerId + SI_PROVIDER_PARSER_ENABLED);
if (ppo.providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.RUN)) {
- ppo.providerRunUseDefault = getBoolean(SCD + prefix + profileId + DOT + providerId +
- SI_PROVIDER_RUN_ACTION_USE_DEFAULT);
- ppo.providerRunCommand = getString(SCD + prefix + profileId + DOT + providerId +
+ ppo.providerRunUseDefault = getBoolean(SCD + prefix + profileId + DOT + providerId +
+ SI_PROVIDER_RUN_ACTION_USE_DEFAULT);
+ ppo.providerRunCommand = getString(SCD + prefix + profileId + DOT + providerId +
SI_PROVIDER_RUN_ACTION_COMMAND);
- ppo.providerRunArguments = getString(SCD + prefix + profileId + DOT + providerId +
+ ppo.providerRunArguments = getString(SCD + prefix + profileId + DOT + providerId +
SI_PROVIDER_RUN_ACTION_ARGUMENTS);
}
else if (ppo.providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.OPEN)) {
- ppo.providerOpenFilePath = getString(SCD + prefix + profileId + DOT + providerId +
+ ppo.providerOpenFilePath = getString(SCD + prefix + profileId + DOT + providerId +
SI_PROVIDER_OPEN_ACTION_FILE_PATH);
}
}
}
}
-
+
private void store() {
String instanceId = context.getInstanceId();
String prefix = instanceId.length() == 0 ? "" : ATTRIBUTE_CS_INFO_INSTANCE_ID + DOT + instanceId + DOT; //$NON-NLS-1$
@@ -1231,31 +1269,31 @@ public class ScannerConfigInfoFactory2 {
set(prefix + SCANNER_CONFIG_AUTODISCOVERY_ENABLED_SUFFIX, autoDiscoveryEnabled);
set(prefix + SCANNER_CONFIG_SELECTED_PROFILE_ID_SUFFIX, selectedProfile);
set(prefix + SCANNER_CONFIG_PROBLEM_REPORTING_ENABLED_SUFFIX, problemReportingEnabled);
-
+
for (String profileId : profileOptionsMap.keySet()) {
ProfileOptions po = profileOptionsMap.get(profileId);
-
+
set(SCD + prefix + profileId + DOT + ENABLED, !useDefaults);
set(SCD + prefix + profileId + BUILD_OUTPUT_OPEN_ACTION_ENABLED, po.buildOutputFileActionEnabled);
set(SCD + prefix + profileId + BUILD_OUTPUT_OPEN_ACTION_FILE_PATH, po.buildOutputFilePath);
set(SCD + prefix + profileId + BUILD_OUTPUT_PARSER_ENABLED, po.buildOutputParserEnabled);
-
+
ScannerConfigProfile configuredProfile = ScannerConfigProfileManager.getInstance().
getSCProfileConfiguration(profileId);
List<String> providerIds = configuredProfile.getSIProviderIds();
for (String providerId : providerIds) {
ProfileOptions.ProviderOptions ppo = po.providerOptionsMap.get(providerId);
-
+
set(SCD + prefix + profileId + DOT + providerId + SI_PROVIDER_PARSER_ENABLED,
ppo.providerOutputParserEnabled);
// String providerKind = configuredProfile.getScannerInfoProviderElement(
// providerId).getProviderKind();
String providerKind = ppo.providerKind;
-
+
if (providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.RUN)) {
set(SCD + prefix + profileId + DOT + providerId + SI_PROVIDER_RUN_ACTION_USE_DEFAULT,
ppo.providerRunUseDefault);
- set(SCD + prefix + profileId + DOT + providerId + SI_PROVIDER_RUN_ACTION_COMMAND,
+ set(SCD + prefix + profileId + DOT + providerId + SI_PROVIDER_RUN_ACTION_COMMAND,
ppo.providerRunCommand);
set(SCD + prefix + profileId + DOT + providerId + SI_PROVIDER_RUN_ACTION_ARGUMENTS,
ppo.providerRunArguments);
@@ -1266,11 +1304,11 @@ public class ScannerConfigInfoFactory2 {
}
}
}
-
+
isDirty = false;
}
}
-
+
private boolean getBoolean(String name) {
if (useDefaults) {
return prefs.getDefaultBoolean(name);
@@ -1304,12 +1342,14 @@ public class ScannerConfigInfoFactory2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2#save()
*/
- public void save() throws CoreException {
+ @Override
+ public void save() throws CoreException {
if(isDirty)
prefsContainer.save();
}
- public InfoContext getContext(){
+ @Override
+ public InfoContext getContext(){
return context;
}
}

Back to the top