Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-10-15 06:06:59 -0400
committerGerrit Code Review @ Eclipse.org2015-10-16 12:07:00 -0400
commit495766631c7ae958e222dbf41d799615ce816450 (patch)
tree0d4a38a02fd83dffbbdc9da51db59235e56fff4a /build/org.eclipse.cdt.autotools.core/src
parent843ecb2adcadb2345059014b46bd2a3e75923429 (diff)
downloadorg.eclipse.cdt-495766631c7ae958e222dbf41d799615ce816450.tar.gz
org.eclipse.cdt-495766631c7ae958e222dbf41d799615ce816450.tar.xz
org.eclipse.cdt-495766631c7ae958e222dbf41d799615ce816450.zip
autotools: Modernize o.e.cdt.autotools.core.
* Enable warnings and save actions. * Replace useless @see comments with proper Override annotations. * Remove redundant type declarations. * Add missing Deprecated annotations. * Remove useless throws declarations. * Remove useless casts. * Remove useless method parameters. Change-Id: I632c1c811b5d01c80279fab30010cec7d285a971 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'build/org.eclipse.cdt.autotools.core/src')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java16
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java3
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java7
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java81
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java12
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java12
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java31
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java1
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java10
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java23
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java31
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java7
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/BinConfigureOption.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java16
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureTool.java9
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java10
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java8
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/MultiArgConfigureOption.java10
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/NewAutotoolsProject.java3
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/SetAutotoolsStringOptionValue.java13
24 files changed, 176 insertions, 153 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java
index 56e31b52d3..a373b52167 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java
@@ -47,33 +47,21 @@ public class AutotoolsNewProjectNature implements IProjectNature {
private IProject project;
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IProjectNature#configure()
- */
@Override
public void configure() throws CoreException {
addAutotoolsBuilder(project, new NullProgressMonitor());
}
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IProjectNature#deconfigure()
- */
@Override
public void deconfigure() throws CoreException {
// TODO remove builder from here
}
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IProjectNature#getProject()
- */
@Override
public IProject getProject() {
return project;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
- */
@Override
public void setProject(IProject project) {
this.project = project;
@@ -161,7 +149,7 @@ public class AutotoolsNewProjectNature implements IProjectNature {
static ICommand[] getBuildCommandsList(IProjectDescription description,
ICommand[] commands) {
- ArrayList<ICommand> commandList = new ArrayList<ICommand>();
+ ArrayList<ICommand> commandList = new ArrayList<>();
// Make sure the Autotools Configuration builder just precedes the Common Builder
for (int i = 0; i < commands.length; i++) {
@@ -257,7 +245,7 @@ public class AutotoolsNewProjectNature implements IProjectNature {
public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
IProjectDescription description = project.getDescription();
String[] prevNatures = description.getNatureIds();
- List<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures));
+ List<String> newNatures = new ArrayList<>(Arrays.asList(prevNatures));
newNatures.remove(natureId);
description.setNatureIds(newNatures.toArray(new String[newNatures.size()]));
project.setDescription(description, monitor);
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java
index 5d27727aff..090378db34 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java
@@ -83,6 +83,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
/**
* This method is called upon plug-in activation
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
@@ -90,6 +91,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
/**
* This method is called when the plug-in is stopped
*/
+ @Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
@@ -229,6 +231,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
display = Display.getDefault();
final IStatus fstatus = status;
display.asyncExec(new Runnable() {
+ @Override
public void run() {
ErrorDialog.openError(null, title, null, fstatus);
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
index 033a8e185f..b423fd05f5 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsConfigurationBuilder.java
@@ -103,7 +103,7 @@ public class AutotoolsConfigurationBuilder extends ACBuilder {
}
@Override
- protected void clean(IProgressMonitor monitor) throws CoreException {
+ protected void clean(IProgressMonitor monitor) {
IProject project = getProject();
final IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
if (shouldBuild(CLEAN_BUILD, info)) {
@@ -123,7 +123,7 @@ public class AutotoolsConfigurationBuilder extends ACBuilder {
}
protected MultiStatus performMakefileGeneration(IProject project, IManagedBuildInfo info,
- IProgressMonitor monitor) throws CoreException {
+ IProgressMonitor monitor) {
MultiStatus result;
try {
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
index 221578fc9d..094e6d1f64 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
@@ -42,14 +42,15 @@ public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvir
: name.equals(VerboseEnvironmentVariable.VERBOSE_VAR_NAME);
}
- private static IBuildEnvironmentVariable create(IConfiguration configuration) {
+ private static IBuildEnvironmentVariable create() {
return new VerboseEnvironmentVariable(VERBOSE_VAR_NAME, VERBOSE_VAR_VALUE, IEnvironmentVariable.ENVVAR_PREPEND, null);
}
}
+ @Override
public IBuildEnvironmentVariable[] getVariables(IConfiguration configuration,
IEnvironmentVariableProvider provider) {
- IBuildEnvironmentVariable path = VerboseEnvironmentVariable.create(configuration);
+ IBuildEnvironmentVariable path = VerboseEnvironmentVariable.create();
return new IBuildEnvironmentVariable[] { path };
}
@@ -57,7 +58,7 @@ public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvir
public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration,
IEnvironmentVariableProvider provider) {
if (VerboseEnvironmentVariable.isVar(variableName)) {
- return VerboseEnvironmentVariable.create(configuration);
+ return VerboseEnvironmentVariable.create();
} else {
return null;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
index ade4cc2224..8777ceccd8 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
@@ -48,7 +48,6 @@ import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.makefile.IMakefile;
import org.eclipse.cdt.make.core.makefile.ITarget;
import org.eclipse.cdt.make.core.makefile.ITargetRule;
-import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -65,7 +64,6 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceStatus;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
@@ -80,8 +78,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteConnectionControlService;
-import org.eclipse.remote.core.IRemoteConnectionPropertyService;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteResource;
import org.eclipse.remote.core.IRemoteServicesManager;
@@ -130,12 +126,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private IBuilder builder;
- public void generateDependencies() throws CoreException {
+ public void generateDependencies() {
// TODO Auto-generated method stub
}
- public MultiStatus generateMakefiles(IResourceDelta delta)
+ public MultiStatus generateMakefiles()
throws CoreException {
return regenerateMakefiles(false);
}
@@ -175,12 +171,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
return project;
}
- public boolean isGeneratedResource(IResource resource) {
+ public boolean isGeneratedResource() {
// TODO Auto-generated method stub
return false;
}
- public void regenerateDependencies(boolean force) throws CoreException {
+ public void regenerateDependencies() {
// TODO Auto-generated method stub
}
@@ -257,8 +253,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
}
private void refresh() throws CoreException{
- IRemoteResource remRes =
- (IRemoteResource)getProject().getAdapter(IRemoteResource.class);
+ IRemoteResource remRes = getProject().getAdapter(IRemoteResource.class);
if (remRes != null) {
remRes.refresh(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
}
@@ -485,12 +480,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
}
}
- ArrayList<String> configureEnvs = new ArrayList<String>();
- ArrayList<String> configureCmdParms = new ArrayList<String>();
+ ArrayList<String> configureEnvs = new ArrayList<>();
+ ArrayList<String> configureCmdParms = new ArrayList<>();
IPath configurePath = getConfigurePath(configureEnvs, configureCmdParms);
String[] configArgs = getConfigArgs(configureCmdParms);
- ArrayList<String> autogenEnvs = new ArrayList<String>();
- ArrayList<String> autogenCmdParms = new ArrayList<String>();
+ ArrayList<String> autogenEnvs = new ArrayList<>();
+ ArrayList<String> autogenCmdParms = new ArrayList<>();
IPath autogenPath = getAutogenPath(autogenEnvs, autogenCmdParms);
// Check if we have a config.status (meaning configure has already run).
@@ -841,10 +836,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
}
// Run a command or executable (e.g. make).
- private int runCommand(IPath commandPath, IPath runPath, String[] args,
- String jobDescription, String errMsg, IConsole console,
- boolean consoleStart) throws BuildException, CoreException,
- NullPointerException, IOException {
+ private int runCommand(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg,
+ IConsole console, boolean consoleStart) throws CoreException, NullPointerException, IOException {
int rc = IStatus.OK;
@@ -876,7 +869,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
"MakeGenerator.make.message", msgs)); //$NON-NLS-1$
- ConsoleOutputStream consoleOutStream = null;
ErrorParserManager epm = null;
StringBuffer buf = new StringBuffer();
@@ -884,8 +876,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (consoleStart)
console.start(project);
- try {
- consoleOutStream = console.getOutputStream();
+ try (ConsoleOutputStream consoleOutStream = console.getOutputStream()) {
String[] consoleHeader = new String[3];
consoleHeader[0] = jobDescription;
@@ -906,7 +897,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
IEnvironmentVariable variables[] =
CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true);
String[] env = null;
- ArrayList<String> envList = new ArrayList<String>();
+ ArrayList<String> envList = new ArrayList<>();
if (variables != null) {
for (int i = 0; i < variables.length; i++) {
envList.add(variables[i].getName()
@@ -917,7 +908,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Hook up an error parser manager
URI uri = URIUtil.toURI(runPath);
- epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID});
+ epm = new ErrorParserManager(project, uri, this);
epm.setOutputStream(consoleOutStream);
epm.addErrorParser(ErrorParser.ID, new ErrorParser(getSourcePath(), getBuildPath()));
@@ -1018,8 +1009,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// epm.reportProblems();
} finally {
- if (consoleOutStream != null)
- consoleOutStream.close();
if (epm != null)
epm.close();
}
@@ -1044,7 +1033,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
IEnvironmentVariable variables[] =
CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true);
String[] env = new String[0];
- ArrayList<String> envList = new ArrayList<String>();
+ ArrayList<String> envList = new ArrayList<>();
if (variables != null) {
for (int i = 0; i < variables.length; i++) {
envList.add(variables[i].getName()
@@ -1070,8 +1059,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Get OS name either remotely or locally, depending on the project
private String getOSName() {
- IRemoteResource remRes =
- (IRemoteResource)getProject().getAdapter(IRemoteResource.class);
+ IRemoteResource remRes = getProject().getAdapter(IRemoteResource.class);
if (remRes != null) {
URI uri = remRes.getActiveLocationURI();
IRemoteServicesManager remoteServiceManager = AutotoolsPlugin.getService(IRemoteServicesManager.class);
@@ -1121,11 +1109,9 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
}
// Run an autotools script (e.g. configure, autogen.sh, config.status).
- private int runScript(IPath commandPath, IPath runPath, String[] args,
- String jobDescription, String errMsg, IConsole console,
- ArrayList<String> additionalEnvs,
- boolean consoleStart) throws BuildException, CoreException,
- NullPointerException, IOException {
+ private int runScript(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg,
+ IConsole console, ArrayList<String> additionalEnvs, boolean consoleStart)
+ throws CoreException, NullPointerException, IOException {
int rc = IStatus.OK;
boolean removePWD = false;
@@ -1190,7 +1176,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
"MakeGenerator.make.message", msgs)); //$NON-NLS-1$
- ConsoleOutputStream consoleOutStream = null;
ErrorParserManager epm = null;
StringBuffer buf = new StringBuffer();
@@ -1198,8 +1183,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (consoleStart)
console.start(project);
- try {
- consoleOutStream = console.getOutputStream();
+ try (ConsoleOutputStream consoleOutStream = console.getOutputStream()) {
String[] consoleHeader = new String[3];
consoleHeader[0] = jobDescription;
@@ -1234,7 +1218,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
IEnvironmentVariable variables[] =
CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true);
String[] env = null;
- ArrayList<String> envList = new ArrayList<String>();
+ ArrayList<String> envList = new ArrayList<>();
if (variables != null) {
for (int i = 0; i < variables.length; i++) {
// For Windows/Mac, check for PWD environment variable being passed.
@@ -1262,7 +1246,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Hook up an error parser manager
URI uri = URIUtil.toURI(runPath);
- epm = new ErrorParserManager(project, uri, this, new String[] {ErrorParser.ID});
+ epm = new ErrorParserManager(project, uri, this);
epm.setOutputStream(consoleOutStream);
epm.addErrorParser(ErrorParser.ID, new ErrorParser(getSourcePath(), getBuildPath()));
@@ -1364,8 +1348,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// .getResourceString(MARKERS));
// epm.reportProblems();
} finally {
- if (consoleOutStream != null)
- consoleOutStream.close();
if (epm != null)
epm.close();
}
@@ -1467,7 +1449,10 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
IMakefile makefile = MakeCorePlugin.createMakefile(makefileFile.toURI(), false, null);
ITargetRule[] targets = makefile.getTargetRules();
ITarget target = null;
- Map<String, IMakeTarget> makeTargets = new HashMap<String, IMakeTarget>(); // use a HashMap so duplicate names are handled
+ Map<String, IMakeTarget> makeTargets = new HashMap<>(); // use a HashMap
+ // so duplicate
+ // names are
+ // handled
String[] id = makeTargetManager.getTargetBuilders(getProject());
if (id.length == 0) {
return;
@@ -1492,7 +1477,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
for (int i = 0; i < targets.length; i++) {
target = targets[i].getTarget();
String targetName = target.toString();
- if (!isValidTarget(targetName, makeTargetManager))
+ if (!isValidTarget(targetName))
continue;
try {
// Bug #351660 - always create a new MakeTarget because an
@@ -1505,15 +1490,15 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
makeTarget.setStopOnError(isStopOnError);
makeTarget.setRunAllBuilders(false);
makeTarget.setUseDefaultBuildCmd(true);
- makeTarget.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, buildArguments);
- makeTarget.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand);
+ makeTarget.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, buildArguments);
+ makeTarget.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, defaultBuildCommand);
makeTarget.setBuildAttribute(GENERATED_TARGET, "true"); //$NON-NLS-1$
makeTarget.setBuildAttribute(IMakeTarget.BUILD_TARGET,
targetName);
//TODO: should this be raw build directory in macro form?
- makeTarget.setBuildAttribute(IMakeTarget.BUILD_LOCATION,
+ makeTarget.setBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION,
buildDir);
makeTargets.put(makeTarget.getName(), makeTarget);
} catch (CoreException e) {
@@ -1523,7 +1508,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()];
Collection<IMakeTarget> values = makeTargets.values();
- ArrayList<IMakeTarget> valueList = new ArrayList<IMakeTarget>(values);
+ ArrayList<IMakeTarget> valueList = new ArrayList<>(values);
valueList.toArray(makeTargetArray);
MakeTargetComparator compareMakeTargets = new MakeTargetComparator();
Arrays.sort(makeTargetArray, compareMakeTargets);
@@ -1552,7 +1537,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
saveTargets(makeTargetArray);
}
- private boolean isValidTarget(String targetName, IMakeTargetManager makeTargetManager) {
+ private boolean isValidTarget(String targetName) {
return !(targetName.endsWith("-am") //$NON-NLS-1$
|| targetName.endsWith("PROGRAMS") //$NON-NLS-1$
|| targetName.endsWith("-generic") //$NON-NLS-1$
@@ -1565,7 +1550,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private String[] makeArray(String string) {
string = string.trim();
char[] array = string.toCharArray();
- ArrayList<String> aList = new ArrayList<String>();
+ ArrayList<String> aList = new ArrayList<>();
StringBuilder buffer = new StringBuilder();
boolean inComment = false;
for (int i = 0; i < array.length; i++) {
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java
index 49f404a190..b2db65c21d 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/DefaultNoDependencyCalculator.java
@@ -25,24 +25,18 @@ import org.eclipse.core.resources.IResource;
@SuppressWarnings("deprecation")
public class DefaultNoDependencyCalculator implements IManagedDependencyGenerator {
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource, org.eclipse.core.resources.IProject)
- */
+ @Override
public IResource[] findDependencies(IResource resource, IProject project) {
// Never answers any dependencies
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getCalculatorType()
- */
+ @Override
public int getCalculatorType() {
return TYPE_NODEPS;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getDependencyCommand(org.eclipse.core.resources.IResource)
- */
+ @Override
public String getDependencyCommand(IResource resource, IManagedBuildInfo info) {
// Never answers this call with an actual value
return null;
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java
index ffd1ef5713..003513ba58 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java
@@ -151,9 +151,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
if (!file.exists())
return null;
- LineNumberReader reader = null;
- try {
- reader = new LineNumberReader(new FileReader(file));
+ try (LineNumberReader reader = new LineNumberReader(new FileReader(file))) {
// look for something like:
// if test "${ac_cv_prog_WINDRES+set}" = set; then :
@@ -184,14 +182,6 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
}
} catch (Exception e) {
throw new RuntimeException(e);
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (IOException e) {
- // Ignore.
- }
- }
}
return null;
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java
index af6ffdf2c6..a07c312923 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParserManager.java
@@ -80,18 +80,7 @@ public class ErrorParserManager extends OutputStream {
* @param markerGenerator - marker generator able to create markers.
*/
public ErrorParserManager(IProject project, MarkerGenerator markerGenerator) {
- this(project, markerGenerator, null);
- }
-
- /**
- * Constructor.
- *
- * @param project - project being built.
- * @param markerGenerator - marker generator able to create markers.
- * @param parsersIDs - array of error parsers' IDs.
- */
- public ErrorParserManager(IProject project, MarkerGenerator markerGenerator, String[] parsersIDs) {
- this(project, project.getLocationURI(), markerGenerator, parsersIDs);
+ this(project, project.getLocationURI(), markerGenerator);
}
@@ -101,15 +90,14 @@ public class ErrorParserManager extends OutputStream {
* @param project - project being built.
* @param baseDirectoryURI - absolute location URI of working directory of where the build is performed.
* @param markerGenerator - marker generator able to create markers.
- * @param parsersIDs - array of error parsers' IDs.
* @since 5.1
*/
- public ErrorParserManager(IProject project, URI baseDirectoryURI, MarkerGenerator markerGenerator, String[] parsersIDs) {
+ public ErrorParserManager(IProject project, URI baseDirectoryURI, MarkerGenerator markerGenerator) {
fProject = project;
fMarkerGenerator = markerGenerator;
- fDirectoryStack = new Vector<URI>();
- fErrors = new ArrayList<ProblemMarkerInfo>();
- fErrorParsers = new LinkedHashMap<String, ErrorParser>();
+ fDirectoryStack = new Vector<>();
+ fErrors = new ArrayList<>();
+ fErrorParsers = new LinkedHashMap<>();
if (baseDirectoryURI != null)
fBaseDirectoryURI = baseDirectoryURI;
@@ -364,7 +352,7 @@ public class ErrorParserManager extends OutputStream {
* close it explicitly
*/
@Override
- public synchronized void close() throws IOException {
+ public synchronized void close() {
if (nOpens > 0 && --nOpens == 0) {
checkLine(true);
fDirectoryStack.removeAllElements();
@@ -380,17 +368,14 @@ public class ErrorParserManager extends OutputStream {
outputStream.flush();
}
- /**
- * @see java.io.OutputStream#write(int)
- */
@Override
- public synchronized void write(int b) throws IOException {
+ public synchronized void write(int b) {
currentLine.append((char) b);
checkLine(false);
}
@Override
- public synchronized void write(byte[] b, int off, int len) throws IOException {
+ public synchronized void write(byte[] b, int off, int len) {
if (b == null) {
throw new NullPointerException();
} else if (off != 0 || (len < 0) || (len > b.length)) {
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java
index d0b3cbeea6..b8a5c3e0cc 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/MarkerResolutionGenerator.java
@@ -16,6 +16,7 @@ import org.eclipse.ui.IMarkerResolutionGenerator;
public class MarkerResolutionGenerator implements IMarkerResolutionGenerator {
+ @Override
public IMarkerResolution[] getResolutions(IMarker marker) {
// System.out.println("in marker resolution, library info is " + marker.getAttribute(IAutotoolsMarker.MARKER_LIBRARY_INFO, ""));
// String libraryInfo = marker.getAttribute(IAutotoolsMarker.MARKER_LIBRARY_INFO, null);
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java
index 125a150a83..c6714b1c37 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java
@@ -42,14 +42,14 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
}
@Override
- public synchronized void write(int c) throws IOException {
+ public synchronized void write(int c) {
byte ascii[] = new byte[1];
ascii[0] = (byte) c;
fBuffer.append(new String(ascii));
}
@Override
- public synchronized void write(byte[] b, int off, int len) throws IOException {
+ public synchronized void write(byte[] b, int off, int len) {
fBuffer.append(new String(b, off, len));
}
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java
index b01d74f8df..bf9fe1e893 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java
@@ -28,10 +28,12 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
this.cfg = cfg;
}
+ @Override
public String getDescription() {
return ConfigureMessages.getConfigureDescription(msgName);
}
+ @Override
public String getToolTip() {
return ConfigureMessages.getConfigureTip(msgName);
}
@@ -40,6 +42,7 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
return msgName;
}
+ @Override
public String getName() {
return name;
}
@@ -48,8 +51,9 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
return cfg;
}
+ @Override
public ArrayList<String> getParameters() {
- ArrayList<String> parameters = new ArrayList<String>();
+ ArrayList<String> parameters = new ArrayList<>();
if (isParmSet())
parameters.add(getParameter());
return parameters;
@@ -59,18 +63,22 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
return "--" + getName();
}
+ @Override
public boolean isCategory() {
return false;
}
+ @Override
public boolean isFlag() {
return false;
}
+ @Override
public boolean isFlagValue() {
return false;
}
+ @Override
public boolean isMultiArg() {
return false;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
index f45d82b32c..a2b65e5380 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
@@ -119,7 +119,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
private boolean isDirty;
private boolean isParmsDirty;
private Map<String, IConfigureOption> configOptions;
- private ArrayList<String> configParms = new ArrayList<String>();
+ private ArrayList<String> configParms = new ArrayList<>();
public AutotoolsConfiguration(String name) {
this(name, true);
@@ -127,7 +127,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
private AutotoolsConfiguration(String name, boolean initialize) {
this.id = name;
- configOptions = new HashMap<String, IConfigureOption>();
+ configOptions = new HashMap<>();
if (initialize)
initConfigOptions();
isParmsDirty = true;
@@ -135,7 +135,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
private void initConfigOptions() {
// Put configure options in hash map. Ignore categories.
- ArrayList<Option> tools = new ArrayList<Option>();
+ ArrayList<Option> tools = new ArrayList<>();
FlagConfigureOption lastFlag = null;
for (int i = 0; i < configOpts.length; ++i) {
Option opt = configOpts[i];
@@ -202,7 +202,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
}
public static Option[] getChildOptions(String name) {
- ArrayList<Option> options = new ArrayList<Option>();
+ ArrayList<Option> options = new ArrayList<>();
for (int i = 0; i < configOpts.length; ++i) {
Option opt = configOpts[i];
if (opt.getName().equals(name)) {
@@ -235,14 +235,17 @@ public class AutotoolsConfiguration implements IAConfiguration {
return toolList.clone();
}
+ @Override
public IConfigureOption getOption(String name) {
return configOptions.get(name);
}
+ @Override
public IAConfiguration copy() {
return copy(id);
}
+ @Override
public IAConfiguration copy(String newId) {
AutotoolsConfiguration cfg = new AutotoolsConfiguration(newId, false);
Collection<IConfigureOption> oldValues = configOptions.values();
@@ -257,24 +260,29 @@ public class AutotoolsConfiguration implements IAConfiguration {
return cfg;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public boolean isDirty() {
return isDirty;
}
+ @Override
public void setDirty(boolean value) {
isDirty = value;
if (isDirty)
isParmsDirty = true;
}
+ @Override
public Map<String, IConfigureOption> getOptions() {
return configOptions;
}
+ @Override
public String getToolParameters(String name) {
StringBuffer buf = new StringBuffer();
Option[] options = getChildOptions(name);
@@ -297,9 +305,10 @@ public class AutotoolsConfiguration implements IAConfiguration {
return buf.toString();
}
+ @Override
public ArrayList<String> getToolArgs(String name) {
if (isParmsDirty) {
- configParms = new ArrayList<String>();
+ configParms = new ArrayList<>();
Option[] options = getChildOptions(name);
for (int i = 0; i < options.length; ++i) {
IConfigureOption option = getOption(options[i].getName());
@@ -319,6 +328,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
return configParms;
}
+ @Override
public void setOption(String name, String value) {
IConfigureOption option = configOptions.get(name);
if (option != null) {
@@ -329,15 +339,18 @@ public class AutotoolsConfiguration implements IAConfiguration {
}
}
+ @Override
public void setConfigToolDirectory(String configToolDirectory) {
setOption("configdir", configToolDirectory);
}
+ @Override
public String getConfigToolDirectory() {
IConfigureOption option = configOptions.get("configdir");
return option.getValue();
}
+ @Override
public void setDefaultOptions() {
initConfigOptions();
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
index a95161fbfb..2299198b3e 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
@@ -28,7 +28,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
-import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
import org.eclipse.cdt.autotools.core.AutotoolsPlugin;
import org.eclipse.cdt.autotools.core.IAutotoolsOption;
import org.eclipse.cdt.core.model.CoreModel;
@@ -85,8 +84,8 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
private static Map<String, Map<String, IAConfiguration>> tmpConfigs;
private AutotoolsConfigurationManager() {
- configs = new HashMap<String, Map<String, IAConfiguration>>();
- tmpConfigs = new HashMap<String, Map<String, IAConfiguration>>();
+ configs = new HashMap<>();
+ tmpConfigs = new HashMap<>();
AutotoolsPlugin.getWorkspace().addResourceChangeListener(this);
}
@@ -98,8 +97,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
}
public synchronized IAConfiguration createDefaultConfiguration(IProject project, String id) {
- IAConfiguration cfg = new AutotoolsConfiguration(id);
- return cfg;
+ return new AutotoolsConfiguration(id);
}
public synchronized IAConfiguration findCfg(IProject p, String id) {
@@ -138,7 +136,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
String projectName = project.getName();
Map<String, IAConfiguration> cfgs = getSavedConfigs(project);
if (cfgs == null) {
- cfgs = new HashMap<String, IAConfiguration>();
+ cfgs = new HashMap<>();
configs.put(projectName, cfgs);
}
cfgs.put(cfg.getId(), cfg);
@@ -167,7 +165,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
clearTmpConfigurations(project);
ICProjectDescription pd = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription[] cfgs = pd.getConfigurations();
- Map <String, IAConfiguration> newCfgList = new HashMap<String, IAConfiguration>();
+ Map<String, IAConfiguration> newCfgList = new HashMap<>();
for (int i = 0; i < cfgs.length; ++i) {
cfgs[i].getConfigurationData();
IAConfiguration acfg = getTmpConfiguration(project, cfgs[i]);
@@ -197,7 +195,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
try {
IPath fileLocation = project.getLocation().append(CFG_FILE_NAME);
File dirFile = fileLocation.toFile();
- Map<String, IAConfiguration> cfgList = new HashMap<String, IAConfiguration>();
+ Map<String, IAConfiguration> cfgList = new HashMap<>();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
if (dirFile.exists()) {
@@ -329,7 +327,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
private Map<String, IAConfiguration> getTmpConfigs(IProject p) {
Map <String, IAConfiguration> tmpList = tmpConfigs.get(p.getName());
if (tmpList == null) {
- tmpList = new HashMap<String, IAConfiguration>();
+ tmpList = new HashMap<>();
tmpConfigs.put(p.getName(), tmpList);
}
return tmpList;
@@ -357,7 +355,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
if (tool.getName().equals("configure")) { //$NON-NLS-1$
IOption option =
tool.getOptionBySuperClassId("org.eclipse.linuxtools.cdt.autotools.core.option.configure.name"); // $NON-NLS-1$
- IHoldsOptions h = (IHoldsOptions)tool;
+ IHoldsOptions h = tool;
try {
IOption optionToSet = h.getOptionToSet(option, false);
optionToSet.setValue(id);
@@ -441,7 +439,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
public synchronized void applyConfigs(String projectName, ICConfigurationDescription[] cfgds) {
try {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IResource res = (IProject)root.findMember(projectName, false);
+ IResource res = root.findMember(projectName, false);
if (res == null || res.getType() != IResource.PROJECT) {
AutotoolsPlugin.logErrorMessage(ConfigureMessages.getFormattedString(CFG_CANT_SAVE,
new String[]{projectName}));
@@ -461,7 +459,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
p.println("<configurations>"); // $NON-NLS-1$
Option[] optionList = AutotoolsConfiguration.getOptionList();
- HashSet<String> savedIds = new HashSet<String>();
+ HashSet<String> savedIds = new HashSet<>();
setSyncing(true);
for (int x = 0; x < cfgds.length; ++x) {
ICConfigurationDescription cfgd = cfgds[x];
@@ -513,12 +511,13 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
public synchronized Map<String, IAConfiguration> getConfigurations(IProject project) {
Map<String, IAConfiguration> list = getSavedConfigs(project);
if (list == null) {
- list = new HashMap<String, IAConfiguration>();
+ list = new HashMap<>();
configs.put(project.getName(), list);
}
return list;
}
+ @Override
public synchronized void resourceChanged(IResourceChangeEvent event) {
IResource res = event.getResource();
if (!(res instanceof IProject))
@@ -628,13 +627,13 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
}
IAConfiguration cfg = getConfiguration(project, cfgId);
- HashMap<String, IAutotoolsOption> options = new HashMap<String, IAutotoolsOption>();
+ HashMap<String, IAutotoolsOption> options = new HashMap<>();
// Get set of configuration options and convert to set of IAutotoolOptions
Map<String, IConfigureOption> cfgOptions = cfg.getOptions();
IAConfiguration dummyCfg = createDefaultConfiguration(project, createDummyId());
for (Iterator<Entry<String, IConfigureOption>> i = cfgOptions.entrySet().iterator(); i.hasNext();) {
- Map.Entry<String, IConfigureOption> entry = (Entry<String, IConfigureOption>) i.next();
+ Map.Entry<String, IConfigureOption> entry = i.next();
String name = entry.getKey();
IAutotoolsOption configOption =
new AutotoolsOption(entry.getValue().copy((AutotoolsConfiguration)dummyCfg));
@@ -665,7 +664,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
// Get set of configuration options and convert to set of IAutotoolOptions
for (Iterator<Entry<String, IAutotoolsOption>> i = options.entrySet().iterator(); i.hasNext();) {
- Map.Entry<String, IAutotoolsOption> entry = (Entry<String, IAutotoolsOption>) i.next();
+ Map.Entry<String, IAutotoolsOption> entry = i.next();
String name = entry.getKey();
IAutotoolsOption option = entry.getValue();
IConfigureOption cfgOption = cfg.getOption(name);
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java
index fc8e793a3e..630b1d4b4b 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java
@@ -27,9 +27,6 @@ import org.eclipse.core.runtime.CoreException;
public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
implements IOptionApplicability {
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#handleValue(IConfiguration,IToolChain,IOption,String,int)
- */
public final static String DEFAULT_BUILD_DIR = "build"; //$NON-NLS-1$
public final static String CONFIGURE_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure"; //$NON-NLS-1$
@@ -40,6 +37,7 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
public final static String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$
//FIXME: Use holder to set option value, not the "option" parameter
+ @Override
public boolean handleValue(IBuildObject buildObject,
IHoldsOptions holder,
IOption option,
@@ -104,16 +102,19 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
// IOptionApplicability methods
+ @Override
public boolean isOptionEnabled(IBuildObject configuration,
IHoldsOptions holder, IOption option) {
return true;
}
+ @Override
public boolean isOptionUsedInCommandLine(IBuildObject configuration,
IHoldsOptions holder, IOption option) {
return false;
}
+ @Override
public boolean isOptionVisible(IBuildObject configuration,
IHoldsOptions holder, IOption option) {
return true;
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/BinConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/BinConfigureOption.java
index b71e48ff28..b1d64c5103 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/BinConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/BinConfigureOption.java
@@ -27,10 +27,12 @@ public class BinConfigureOption extends AbstractConfigurationOption {
this.value = value;
}
+ @Override
public boolean isParmSet() {
return value;
}
+ @Override
public String getParameter() {
if (isParmSet())
return getParameterName();
@@ -38,10 +40,12 @@ public class BinConfigureOption extends AbstractConfigurationOption {
return ""; // $NON-NLS-1$
}
+ @Override
public String getValue() {
return Boolean.toString(value);
}
+ @Override
public void setValue(String value) {
boolean oldValue = this.value;
if (value.equals("true")) // $NON-NLS-1$
@@ -52,10 +56,12 @@ public class BinConfigureOption extends AbstractConfigurationOption {
cfg.setDirty(true);
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
return new BinConfigureOption(name, config, value);
}
+ @Override
public int getType() {
return BIN;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java
index c53713b835..c4791ad070 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java
@@ -20,58 +20,72 @@ public class ConfigureOptionCategory implements IConfigureOption {
this.name = name;
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
return new ConfigureOptionCategory(name);
}
+ @Override
public String getDescription() {
return ConfigureMessages.getConfigureDescription(name);
}
+ @Override
public String getName() {
return name;
}
+ @Override
public String getParameter() {
return "";
}
+ @Override
public ArrayList<String> getParameters() {
- return new ArrayList<String>();
+ return new ArrayList<>();
}
+ @Override
public String getToolTip() {
return "";
}
+ @Override
public String getValue() {
return "null";
}
+ @Override
public boolean isCategory() {
return true;
}
+ @Override
public boolean isParmSet() {
return false;
}
+ @Override
public void setValue(String value) {
// Do nothing..nothing to set
}
+ @Override
public boolean isMultiArg() {
return false;
}
+ @Override
public boolean isFlag() {
return false;
}
+ @Override
public boolean isFlagValue() {
return false;
}
+ @Override
public int getType() {
return CATEGORY;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureTool.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureTool.java
index 1ae34a8c07..b902e95894 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureTool.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureTool.java
@@ -31,10 +31,12 @@ public class ConfigureTool extends AbstractConfigurationOption {
this.value = value;
}
+ @Override
public String getValue() {
return value;
}
+ @Override
public void setValue(String newValue) {
if (!newValue.equals(value)) {
cfg.setDirty(true);
@@ -42,22 +44,27 @@ public class ConfigureTool extends AbstractConfigurationOption {
}
}
+ @Override
public boolean isParmSet() {
return false;
}
+ @Override
public String getParameter() {
return ""; // $NON-NLS-1$
}
+ @Override
public ArrayList<String> getParameters() {
- return new ArrayList<String>();
+ return new ArrayList<>();
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
return new ConfigureTool(name, config, value);
}
+ @Override
public int getType() {
return TOOL;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
index 69be937f23..9be67e8e6d 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
@@ -17,7 +17,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
private String value;
private ArrayList<String> children =
- new ArrayList<String>();
+ new ArrayList<>();
public FlagConfigureOption(String name, AutotoolsConfiguration cfg) {
super(name, cfg);
@@ -37,6 +37,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
this.children = (ArrayList<String>)children.clone();
}
+ @Override
public String getParameter() {
StringBuffer parms = new StringBuffer();
// Multiple flags are designated by putting multiple flags together using "|" as delimiter
@@ -69,10 +70,12 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
return parms.toString();
}
+ @Override
public String getParameterName() {
return getName();
}
+ @Override
public boolean isParmSet() {
for (int i = 0; i < children.size(); ++i) {
String s = children.get(i);
@@ -83,23 +86,28 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
return false;
}
+ @Override
public void setValue(String value) {
this.value = value;
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
FlagConfigureOption f = new FlagConfigureOption(name, config, value, children);
return f;
}
+ @Override
public String getValue() {
return value;
}
+ @Override
public int getType() {
return FLAG;
}
+ @Override
public boolean isFlag() {
return true;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java
index b5b99f7997..e49e72ac9a 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java
@@ -29,26 +29,32 @@ public class FlagValueConfigureOption extends BinConfigureOption implements IFla
this.flags = flags;
}
+ @Override
public ArrayList<String> getParameters() {
- return new ArrayList<String>();
+ return new ArrayList<>();
}
+ @Override
public String getParameter() {
return "";
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration cfg) {
return new FlagValueConfigureOption(name, cfg, getValue(), flags);
}
+ @Override
public int getType() {
return FLAGVALUE;
}
+ @Override
public String getFlags() {
return flags;
}
+ @Override
public boolean isFlagValue() {
return true;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java
index 8b0e4c8965..9a8e15f771 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java
@@ -30,10 +30,12 @@ public class InternalConfigureOption extends AbstractConfigurationOption {
this.value = value;
}
+ @Override
public String getValue() {
return value;
}
+ @Override
public void setValue(String newValue) {
if (!newValue.equals(value)) {
cfg.setDirty(true);
@@ -41,18 +43,22 @@ public class InternalConfigureOption extends AbstractConfigurationOption {
}
}
+ @Override
public boolean isParmSet() {
return false;
}
+ @Override
public String getParameter() {
return "";
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
return new InternalConfigureOption(name, config, value);
}
+ @Override
public int getType() {
return INTERNAL;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/MultiArgConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/MultiArgConfigureOption.java
index 5006fcfd44..cd0d3a5996 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/MultiArgConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/MultiArgConfigureOption.java
@@ -35,10 +35,12 @@ public class MultiArgConfigureOption extends AbstractConfigurationOption {
this.value = value;
}
+ @Override
public String getValue() {
return value;
}
+ @Override
public void setValue(String newValue) {
if (!newValue.equals(value)) {
cfg.setDirty(true);
@@ -47,25 +49,29 @@ public class MultiArgConfigureOption extends AbstractConfigurationOption {
}
}
+ @Override
public boolean isParmSet() {
return value.length() > 0;
}
+ @Override
public boolean isMultiArg() {
return true;
}
+ @Override
public String getParameter() {
return value;
}
+ @Override
public ArrayList<String> getParameters() {
// May be multiple user-specified options in which case we
// need to split them up into individual options
if (!isDirty && userArgs != null)
return userArgs;
// Otherwise, we need to calculate userArgs
- userArgs = new ArrayList<String>();
+ userArgs = new ArrayList<>();
isDirty = false;
int lastArgIndex = -1;
int i = 0;
@@ -109,10 +115,12 @@ public class MultiArgConfigureOption extends AbstractConfigurationOption {
return userArgs;
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
return new MultiArgConfigureOption(name, config, value);
}
+ @Override
public int getType() {
return MULTIARG;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java
index 065cdbf314..d945630ebd 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java
@@ -31,10 +31,12 @@ public class StringConfigureOption extends AbstractConfigurationOption {
this.value = value;
}
+ @Override
public String getValue() {
return value;
}
+ @Override
public void setValue(String newValue) {
if (!newValue.equals(value)) {
cfg.setDirty(true);
@@ -42,20 +44,24 @@ public class StringConfigureOption extends AbstractConfigurationOption {
}
}
+ @Override
public boolean isParmSet() {
return value.length() > 0;
}
+ @Override
public String getParameter() {
if (isParmSet())
return getParameterName() + "=" + getValue(); // $NON-NLS-1$
return "";
}
+ @Override
public IConfigureOption copy(AutotoolsConfiguration config) {
return new StringConfigureOption(name, config, value);
}
+ @Override
public int getType() {
return STRING;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/NewAutotoolsProject.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/NewAutotoolsProject.java
index bb7fc9eef3..94fdf15af2 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/NewAutotoolsProject.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/NewAutotoolsProject.java
@@ -50,6 +50,7 @@ public class NewAutotoolsProject extends ProcessRunner {
pca = new ProjectCreatedActions();
}
+ @Override
public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
String location = args[1].getSimpleValue();
@@ -76,7 +77,7 @@ public class NewAutotoolsProject extends ProcessRunner {
pca.setProject(project);
pca.setProjectLocation(locationPath);
- pca.setConfigs((IConfiguration[]) configs.toArray(new IConfiguration[configs.size()]));
+ pca.setConfigs(configs.toArray(new IConfiguration[configs.size()]));
pca.setArtifactExtension(artifactExtension);
info = pca.createProject(monitor, CCorePlugin.DEFAULT_INDEXER, isCProject);
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/SetAutotoolsStringOptionValue.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/SetAutotoolsStringOptionValue.java
index 9fe1b63fc2..c8742d3b64 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/SetAutotoolsStringOptionValue.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/SetAutotoolsStringOptionValue.java
@@ -12,16 +12,13 @@
package org.eclipse.cdt.internal.autotools.core.wizards;
-import org.eclipse.cdt.autotools.core.AutotoolsPlugin;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
-import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
-import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceDescription;
@@ -31,7 +28,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class SetAutotoolsStringOptionValue extends ProcessRunner {
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ @Override
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -48,11 +46,7 @@ public class SetAutotoolsStringOptionValue extends ProcessRunner {
ProcessArgument[] resourcePathObject = resourcePathObjects[i];
String id = resourcePathObject[0].getSimpleValue();
String value = resourcePathObject[1].getSimpleValue();
- try {
setOptionValue(projectHandle, id, value);
- } catch (BuildException e) {
- throw new ProcessFailureException(AutotoolsPlugin.getFormattedString("SetAutotoolsStringOptionValue.error", new String[]{e.getMessage()}), e); //$NON-NLS-1$
- }
}
workspaceDesc.setAutoBuilding(autoBuilding);
@@ -62,8 +56,7 @@ public class SetAutotoolsStringOptionValue extends ProcessRunner {
}
}
- private void setOptionValue(IProject projectHandle, String id, String
- value) throws BuildException, ProcessFailureException {
+ private void setOptionValue(IProject projectHandle, String id, String value) {
AutotoolsConfigurationManager.getInstance().syncConfigurations(projectHandle);
ICConfigurationDescription[] cfgds =

Back to the top