1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 02:05:39 +02:00

autotools: Another round of core bundle cleanups.

* Use try-with-resources.
* More efficient cycles.
* Use collections interfaces instead of concrete classes.
* Turn non-javadoc with actual comments into javadoc.
* Adapt to proper Java naming conventions.
* Modifiers order.
* Unused modifiers.

Change-Id: I5e4ca3e5f2900b72b53338a455dbaaa65273d812
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2015-10-28 09:12:08 +02:00 committed by Gerrit Code Review @ Eclipse.org
parent 0a04f1aba9
commit 904d0df63d
17 changed files with 200 additions and 216 deletions

View file

@ -38,12 +38,12 @@ public class AutotoolsNewProjectNature implements IProjectNature {
public static final String AUTOTOOLS_NATURE_ID = "org.eclipse.cdt.autotools.core.autotoolsNatureV2"; //$NON-NLS-1$ public static final String AUTOTOOLS_NATURE_ID = "org.eclipse.cdt.autotools.core.autotoolsNatureV2"; //$NON-NLS-1$
public static final String OLD_AUTOTOOLS_NATURE_ID = "org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"; //$NON-NLS-1$ public static final String OLD_AUTOTOOLS_NATURE_ID = "org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"; //$NON-NLS-1$
public final static String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".genmakebuilder"; //$NON-NLS-1$ public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".genmakebuilder"; //$NON-NLS-1$
/** /**
* @since 1.3 * @since 1.3
*/ */
public final static String REMOTE_BUILDER_ID = "org.eclipse.ptp.rdt.sync.cdt.core.SyncBuilder"; // $NON-NLS-1$ public static final String REMOTE_BUILDER_ID = "org.eclipse.ptp.rdt.sync.cdt.core.SyncBuilder"; // $NON-NLS-1$
public final static String OLD_AUTOTOOLS_BUILDER_ID = "org.eclipse.linuxtools.cdt.autotools.genmakebuilder"; //$NON-NLS-1$ public static final String OLD_AUTOTOOLS_BUILDER_ID = "org.eclipse.linuxtools.cdt.autotools.genmakebuilder"; //$NON-NLS-1$
private IProject project; private IProject project;

View file

@ -5,51 +5,51 @@ package org.eclipse.cdt.autotools.core;
*/ */
public class AutotoolsOptionConstants { public class AutotoolsOptionConstants {
// IAutotoolOption Names // IAutotoolOption Names
public final static String TOOL_CONFIGURE = "configure"; // $NON-NLS-1$ public static final String TOOL_CONFIGURE = "configure"; // $NON-NLS-1$
public final static String CATEGORY_GENERAL = "general"; // $NON-NLS-1$ public static final String CATEGORY_GENERAL = "general"; // $NON-NLS-1$
public final static String OPT_CONFIGDIR = "configdir"; // $NON-NLS-1$ public static final String OPT_CONFIGDIR = "configdir"; // $NON-NLS-1$
public final static String OPT_CACHE_FILE = "cache-file"; // $NON-NLS-1$ public static final String OPT_CACHE_FILE = "cache-file"; // $NON-NLS-1$
public final static String OPT_HELP = "help"; // $NON-NLS-1$ public static final String OPT_HELP = "help"; // $NON-NLS-1$
public final static String OPT_NO_CREATE = "no-create"; // $NON-NLS-1$ public static final String OPT_NO_CREATE = "no-create"; // $NON-NLS-1$
public final static String OPT_QUIET = "quiet"; // $NON-NLS-1$ public static final String OPT_QUIET = "quiet"; // $NON-NLS-1$
public final static String OPT_VERSION = "version"; // $NON-NLS-1$ public static final String OPT_VERSION = "version"; // $NON-NLS-1$
public final static String CATEGORY_PLATFORM = "platform"; // $NON-NLS-1$ public static final String CATEGORY_PLATFORM = "platform"; // $NON-NLS-1$
public final static String OPT_HOST = "host"; // $NON-NLS-1$ public static final String OPT_HOST = "host"; // $NON-NLS-1$
public final static String OPT_BUILD = "build"; // $NON-NLS-1$ public static final String OPT_BUILD = "build"; // $NON-NLS-1$
public final static String OPT_TARGET = "target"; // $NON-NLS-1$ public static final String OPT_TARGET = "target"; // $NON-NLS-1$
public final static String CATEGORY_DIRECTORIES = "directories"; // $NON-NLS-1$ public static final String CATEGORY_DIRECTORIES = "directories"; // $NON-NLS-1$
public final static String OPT_PREFIX = "prefix"; // $NON-NLS-1$ public static final String OPT_PREFIX = "prefix"; // $NON-NLS-1$
public final static String OPT_EXEC_PREFIX = "exec-prefix"; // $NON-NLS-1$ public static final String OPT_EXEC_PREFIX = "exec-prefix"; // $NON-NLS-1$
public final static String OPT_LIBDIR = "libdir"; // $NON-NLS-1$ public static final String OPT_LIBDIR = "libdir"; // $NON-NLS-1$
public final static String OPT_BINDIR = "bindir"; // $NON-NLS-1$ public static final String OPT_BINDIR = "bindir"; // $NON-NLS-1$
public final static String OPT_SBINDIR = "sbindir"; // $NON-NLS-1$ public static final String OPT_SBINDIR = "sbindir"; // $NON-NLS-1$
public final static String OPT_INCLUDEDIR = "includedir"; // $NON-NLS-1$ public static final String OPT_INCLUDEDIR = "includedir"; // $NON-NLS-1$
public final static String OPT_DATADIR = "datadir"; // $NON-NLS-1$ public static final String OPT_DATADIR = "datadir"; // $NON-NLS-1$
public final static String OPT_SYSCONFDIR = "sysconfdir"; // $NON-NLS-1$ public static final String OPT_SYSCONFDIR = "sysconfdir"; // $NON-NLS-1$
public final static String OPT_INFODIR = "infodir"; // $NON-NLS-1$ public static final String OPT_INFODIR = "infodir"; // $NON-NLS-1$
public final static String OPT_MANDIR = "mandir"; // $NON-NLS-1$ public static final String OPT_MANDIR = "mandir"; // $NON-NLS-1$
public final static String OPT_SRCDIR = "srcdir"; // $NON-NLS-1$ public static final String OPT_SRCDIR = "srcdir"; // $NON-NLS-1$
public final static String OPT_LOCALSTATEDIR = "localstatedir"; // $NON-NLS-1$ public static final String OPT_LOCALSTATEDIR = "localstatedir"; // $NON-NLS-1$
public final static String OPT_SHAREDSTATEDIR = "sharedstatedir"; // $NON-NLS-1$ public static final String OPT_SHAREDSTATEDIR = "sharedstatedir"; // $NON-NLS-1$
public final static String OPT_LIBEXECDIR = "libexecdir"; // $NON-NLS-1$ public static final String OPT_LIBEXECDIR = "libexecdir"; // $NON-NLS-1$
public final static String OPT_OLDINCLUDEDIR = "oldincludedir"; // $NON-NLS-1$ public static final String OPT_OLDINCLUDEDIR = "oldincludedir"; // $NON-NLS-1$
public final static String CATEGORY_FILENAMES = "filenames"; // $NON-NLS-1$ public static final String CATEGORY_FILENAMES = "filenames"; // $NON-NLS-1$
public final static String OPT_PROGRAM_PREFIX = "program-prefix"; // $NON-NLS-1$ public static final String OPT_PROGRAM_PREFIX = "program-prefix"; // $NON-NLS-1$
public final static String OPT_PROGRAM_SUFFIX = "program-suffix"; // $NON-NLS-1$ public static final String OPT_PROGRAM_SUFFIX = "program-suffix"; // $NON-NLS-1$
public final static String OPT_PROGRAM_TRANSFORM_NAME = "program-transform-name"; // $NON-NLS-1$ public static final String OPT_PROGRAM_TRANSFORM_NAME = "program-transform-name"; // $NON-NLS-1$
public final static String CATEGORY_FEATURES = "features"; // $NON-NLS-1$ public static final String CATEGORY_FEATURES = "features"; // $NON-NLS-1$
public final static String OPT_ENABLE_MAINTAINER_MODE = "enable-maintainer-mode"; // $NON-NLS-1$ public static final String OPT_ENABLE_MAINTAINER_MODE = "enable-maintainer-mode"; // $NON-NLS-1$
public final static String FLAG_CFLAGS = "CFLAGS"; // $NON-NLS-1$ public static final String FLAG_CFLAGS = "CFLAGS"; // $NON-NLS-1$
/** /**
* @since 1.4 * @since 1.4
*/ */
public final static String FLAG_CFLAGS_FLAGS = "CFLAGS|CXXFLAGS"; // $NON-NLS-1$ public static final String FLAG_CFLAGS_FLAGS = "CFLAGS|CXXFLAGS"; // $NON-NLS-1$
public final static String OPT_CFLAGS_DEBUG = "cflags-debug"; // $NON-NLS-1$ public static final String OPT_CFLAGS_DEBUG = "cflags-debug"; // $NON-NLS-1$
public final static String OPT_CFLAGS_GPROF = "cflags-gprof"; // $NON-NLS-1$ public static final String OPT_CFLAGS_GPROF = "cflags-gprof"; // $NON-NLS-1$
public final static String OPT_CFLAGS_GCOV = "cflags-gcov"; // $NON-NLS-1$ public static final String OPT_CFLAGS_GCOV = "cflags-gcov"; // $NON-NLS-1$
public final static String OPT_USER = "user"; // $NON-NLS-1$ public static final String OPT_USER = "user"; // $NON-NLS-1$
public final static String TOOL_AUTOGEN = "autogen"; // $NON-NLS-1$ public static final String TOOL_AUTOGEN = "autogen"; // $NON-NLS-1$
public final static String CATEGORY_OPTIONS = "options"; // $NON-NLS-1$ public static final String CATEGORY_OPTIONS = "options"; // $NON-NLS-1$
public final static String OPT_AUTOGENOPTS = "autogenOpts"; // $NON-NLS-1$ public static final String OPT_AUTOGENOPTS = "autogenOpts"; // $NON-NLS-1$
} }

View file

@ -80,14 +80,6 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
return getDefault().getBundle().getSymbolicName(); return getDefault().getBundle().getSymbolicName();
} }
/**
* This method is called upon plug-in activation
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
/** /**
* This method is called when the plug-in is stopped * This method is called when the plug-in is stopped
*/ */
@ -182,8 +174,6 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
return true; return true;
} }
} }
} catch (CoreException e) {
// Don't care...fall through to not found.
} catch (Exception f) { } catch (Exception f) {
// Don't care...fall through to not found. // Don't care...fall through to not found.
} }
@ -230,12 +220,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
if (display == null) if (display == null)
display = Display.getDefault(); display = Display.getDefault();
final IStatus fstatus = status; final IStatus fstatus = status;
display.asyncExec(new Runnable() { display.asyncExec(() -> ErrorDialog.openError(null, title, null, fstatus));
@Override
public void run() {
ErrorDialog.openError(null, title, null, fstatus);
}
});
} }
public static void logException(Throwable e) { public static void logException(Throwable e) {

View file

@ -7,16 +7,20 @@ import org.eclipse.core.runtime.CoreException;
* @since 1.2 * @since 1.2
*/ */
public interface IAutotoolsOption { public interface IAutotoolsOption {
public final static int CATEGORY = 0; int CATEGORY = 0;
public final static int BIN = 1; int BIN = 1;
public final static int STRING = 2; int STRING = 2;
public final static int INTERNAL = 3; int INTERNAL = 3;
public final static int MULTIARG = 4; int MULTIARG = 4;
public final static int TOOL = 5; int TOOL = 5;
public final static int FLAG = 6; int FLAG = 6;
public final static int FLAGVALUE = 7; int FLAGVALUE = 7;
public int getType();
public boolean canUpdate(); int getType();
public void setValue(String value) throws CoreException;
public String getValue(); boolean canUpdate();
void setValue(String value) throws CoreException;
String getValue();
} }

View file

@ -24,6 +24,7 @@ import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -86,16 +87,16 @@ import org.eclipse.remote.core.exception.RemoteConnectionException;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class AutotoolsNewMakeGenerator extends MarkerGenerator { public class AutotoolsNewMakeGenerator extends MarkerGenerator {
public final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$ public static final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
public final String MAKEFILE = "Makefile"; //$NON-NLS-1$ public static final String MAKEFILE = "Makefile"; //$NON-NLS-1$
public final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$ public static final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
public final String SETTINGS_FILE_NAME = ".cdtconfigure"; //$NON-NLS-1$ public static final String SETTINGS_FILE_NAME = ".cdtconfigure"; //$NON-NLS-1$
public final String SHELL_COMMAND = "sh"; //$NON-NLS-1$ public static final String SHELL_COMMAND = "sh"; //$NON-NLS-1$
public final String AUTOGEN_TOOL_ID = "autogen"; //$NON-NLS-1$ public static final String AUTOGEN_TOOL_ID = "autogen"; //$NON-NLS-1$
public final String CONFIGURE_TOOL_ID = "configure"; //$NON-NLS-1$ public static final String CONFIGURE_TOOL_ID = "configure"; //$NON-NLS-1$
public final String GENERATED_TARGET = AutotoolsPlugin.PLUGIN_ID + ".generated.MakeTarget"; //$NON-NLS-1$ public static final String GENERATED_TARGET = AutotoolsPlugin.PLUGIN_ID + ".generated.MakeTarget"; //$NON-NLS-1$
private static final String MAKE_TARGET_KEY = MakeCorePlugin.getUniqueIdentifier() + ".buildtargets"; //$NON-NLS-1$ private static final String MAKE_TARGET_KEY = MakeCorePlugin.getUniqueIdentifier() + ".buildtargets"; //$NON-NLS-1$
private static final String BUILD_TARGET_ELEMENT = "buildTargets"; //$NON-NLS-1$ private static final String BUILD_TARGET_ELEMENT = "buildTargets"; //$NON-NLS-1$
@ -127,7 +128,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
public void generateDependencies() { public void generateDependencies() {
// TODO Auto-generated method stub
} }
@ -178,7 +178,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
* @since 2.0 * @since 2.0
*/ */
public boolean isGeneratedResource() { public boolean isGeneratedResource() {
// TODO Auto-generated method stub
return false; return false;
} }
@ -186,13 +185,13 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
* @since 2.0 * @since 2.0
*/ */
public void regenerateDependencies() { public void regenerateDependencies() {
// TODO Auto-generated method stub
} }
/* /**
* (non-Javadoc) Check whether the build has been cancelled. Cancellation * Check whether the build has been cancelled. Cancellation requests
* requests propagated to the caller by throwing <code>OperationCanceledException</code>. * propagated to the caller by throwing
* <code>OperationCanceledException</code>.
* *
* @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException() * @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException()
*/ */
@ -202,13 +201,13 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} }
} }
/* /**
* (non-Javadoc) Return or create the makefile needed for the build. If we * Return or create the makefile needed for the build. If we are creating
* are creating the resource, set the derived bit to true so the CM system * the resource, set the derived bit to true so the CM system ignores the
* ignores the contents. If the resource exists, respect the existing * contents. If the resource exists, respect the existing derived setting.
* derived setting.
* *
* @param makefilePath @return IFile * @param makefilePath
* @return IFile
*/ */
protected IFile createFile(IPath makefilePath) throws CoreException { protected IFile createFile(IPath makefilePath) throws CoreException {
// Create or get the handle for the makefile // Create or get the handle for the makefile
@ -238,10 +237,11 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
return newFile; return newFile;
} }
/* /**
* Create a directory * Create a directory.
* *
* @param boolean @return whether the directory was created * @param boolean
* @return whether the directory was created
*/ */
private boolean createDirectory(String dirName) throws CoreException { private boolean createDirectory(String dirName) throws CoreException {
// Create or get the handle for the build directory // Create or get the handle for the build directory
@ -268,9 +268,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} }
} }
/* /**
* (non-Javadoc)
*
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#getMakefileName() * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#getMakefileName()
*/ */
public String getMakefileName() { public String getMakefileName() {
@ -331,7 +329,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException { private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
MultiStatus status; MultiStatus status;
int rc = IStatus.OK; int rc = IStatus.OK;
String errMsg = new String(); String errMsg = "";
boolean needFullConfigure = false; boolean needFullConfigure = false;
// See if the user has cancelled the build // See if the user has cancelled the build
@ -489,12 +487,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} }
} }
ArrayList<String> configureEnvs = new ArrayList<>(); List<String> configureEnvs = new ArrayList<>();
ArrayList<String> configureCmdParms = new ArrayList<>(); List<String> configureCmdParms = new ArrayList<>();
IPath configurePath = getConfigurePath(configureEnvs, configureCmdParms); IPath configurePath = getConfigurePath(configureEnvs, configureCmdParms);
String[] configArgs = getConfigArgs(configureCmdParms); String[] configArgs = getConfigArgs(configureCmdParms);
ArrayList<String> autogenEnvs = new ArrayList<>(); List<String> autogenEnvs = new ArrayList<>();
ArrayList<String> autogenCmdParms = new ArrayList<>(); List<String> autogenCmdParms = new ArrayList<>();
IPath autogenPath = getAutogenPath(autogenEnvs, autogenCmdParms); IPath autogenPath = getAutogenPath(autogenEnvs, autogenCmdParms);
// Check if we have a config.status (meaning configure has already run). // Check if we have a config.status (meaning configure has already run).
@ -638,7 +636,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
rc = IStatus.ERROR; rc = IStatus.ERROR;
errMsg = AutotoolsPlugin.getResourceString("MakeGenerator.didnt.generate"); //$NON-NLS-1$ errMsg = AutotoolsPlugin.getResourceString("MakeGenerator.didnt.generate"); //$NON-NLS-1$
} }
} catch (Exception e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
// forgetLastBuiltState(); // forgetLastBuiltState();
rc = IStatus.ERROR; rc = IStatus.ERROR;
@ -665,7 +663,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
* @param envVars - ArrayList to add environment variables to * @param envVars - ArrayList to add environment variables to
* @return stripped command * @return stripped command
*/ */
public static String stripEnvVars(String command, ArrayList<String> envVars) { public static String stripEnvVars(String command, List<String> envVars) {
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*"); Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*");
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*"); Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*");
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*"); Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*");
@ -727,7 +725,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
* @param envVars - ArrayList to add environment variables to * @param envVars - ArrayList to add environment variables to
* @return stripped option * @return stripped option
*/ */
public static String stripEnvVarsFromOption(String str, ArrayList<String> envVars) { public static String stripEnvVarsFromOption(String str, List<String> envVars) {
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*"); Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*");
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*"); Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*");
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*"); Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*");
@ -780,7 +778,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
return sourcePath; return sourcePath;
} }
protected IPath getConfigurePath(ArrayList<String> envVars, ArrayList<String> cmdParms) { protected IPath getConfigurePath(List<String> envVars, List<String> cmdParms) {
IPath configPath; IPath configPath;
IConfigureOption configOption = toolsCfg.getOption(CONFIGURE_TOOL_ID); IConfigureOption configOption = toolsCfg.getOption(CONFIGURE_TOOL_ID);
String command = "configure"; // $NON-NLS-1$ String command = "configure"; // $NON-NLS-1$
@ -812,7 +810,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
return makefileCVSPath.toFile().exists(); return makefileCVSPath.toFile().exists();
} }
protected IPath getAutogenPath(ArrayList<String> envVars, ArrayList<String> cmdParms) { protected IPath getAutogenPath(List<String> envVars, List<String> cmdParms) {
IPath autogenPath; IPath autogenPath;
IConfigureOption autogenOption = toolsCfg.getOption(AUTOGEN_TOOL_ID); IConfigureOption autogenOption = toolsCfg.getOption(AUTOGEN_TOOL_ID);
String command = "autogen.sh"; // $NON-NLS-1$ String command = "autogen.sh"; // $NON-NLS-1$
@ -830,16 +828,16 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
return autogenPath; return autogenPath;
} }
private String[] getAutogenArgs(ArrayList<String> cmdParms) { private String[] getAutogenArgs(List<String> cmdParms) {
// Get the arguments to be passed to config from build model // Get the arguments to be passed to config from build model
ArrayList<String> autogenArgs = toolsCfg.getToolArgs(AUTOGEN_TOOL_ID); List<String> autogenArgs = toolsCfg.getToolArgs(AUTOGEN_TOOL_ID);
cmdParms.addAll(autogenArgs); cmdParms.addAll(autogenArgs);
return cmdParms.toArray(new String[cmdParms.size()]); return cmdParms.toArray(new String[cmdParms.size()]);
} }
private String[] getConfigArgs(ArrayList<String> cmdParms) { private String[] getConfigArgs(List<String> cmdParms) {
// Get the arguments to be passed to config from build model // Get the arguments to be passed to config from build model
ArrayList<String> configArgs = toolsCfg.getToolArgs(CONFIGURE_TOOL_ID); List<String> configArgs = toolsCfg.getToolArgs(CONFIGURE_TOOL_ID);
cmdParms.addAll(configArgs); cmdParms.addAll(configArgs);
return cmdParms.toArray(new String[cmdParms.size()]); return cmdParms.toArray(new String[cmdParms.size()]);
} }
@ -1117,7 +1115,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Run an autotools script (e.g. configure, autogen.sh, config.status). // Run an autotools script (e.g. configure, autogen.sh, config.status).
private int runScript(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg, private int runScript(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg,
IConsole console, ArrayList<String> additionalEnvs, boolean consoleStart) IConsole console, List<String> additionalEnvs, boolean consoleStart)
throws CoreException, NullPointerException, IOException { throws CoreException, NullPointerException, IOException {
int rc = IStatus.OK; int rc = IStatus.OK;
@ -1514,7 +1512,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()]; IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()];
Collection<IMakeTarget> values = makeTargets.values(); Collection<IMakeTarget> values = makeTargets.values();
ArrayList<IMakeTarget> valueList = new ArrayList<>(values); List<IMakeTarget> valueList = new ArrayList<>(values);
valueList.toArray(makeTargetArray); valueList.toArray(makeTargetArray);
MakeTargetComparator compareMakeTargets = new MakeTargetComparator(); MakeTargetComparator compareMakeTargets = new MakeTargetComparator();
Arrays.sort(makeTargetArray, compareMakeTargets); Arrays.sort(makeTargetArray, compareMakeTargets);
@ -1530,13 +1528,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class); Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class);
m.invoke(makeTargetManager, project, makeTargetArray); m.invoke(makeTargetManager, project, makeTargetArray);
targetsAdded = true; targetsAdded = true;
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException
// ignore and use fail-safe saveTargets method | InvocationTargetException e) {
} catch (IllegalArgumentException e) {
// ignore and use fail-safe saveTargets method
} catch (IllegalAccessException e) {
// ignore and use fail-safe saveTargets method
} catch (InvocationTargetException e) {
// ignore and use fail-safe saveTargets method // ignore and use fail-safe saveTargets method
} }
if (!targetsAdded) if (!targetsAdded)

View file

@ -213,7 +213,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
return Integer.parseInt(m.group(1)); return Integer.parseInt(m.group(1));
} }
} }
} catch (Exception e) { } catch (IOException e) {
return -1; return -1;
} finally { } finally {
if (reader != null) { if (reader != null) {

View file

@ -19,13 +19,12 @@ import java.io.OutputStream;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Vector; import java.util.Vector;
import org.eclipse.cdt.autotools.core.AutotoolsPlugin; import org.eclipse.cdt.autotools.core.AutotoolsPlugin;
import org.eclipse.cdt.core.IErrorParser;
import org.eclipse.cdt.core.IErrorParser2; import org.eclipse.cdt.core.IErrorParser2;
import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.core.ProblemMarkerInfo; import org.eclipse.cdt.core.ProblemMarkerInfo;
import org.eclipse.cdt.internal.core.IErrorMarkeredOutputStream; import org.eclipse.cdt.internal.core.IErrorMarkeredOutputStream;
import org.eclipse.cdt.utils.EFSExtensionManager; import org.eclipse.cdt.utils.EFSExtensionManager;
@ -54,7 +53,7 @@ public class ErrorParserManager extends OutputStream {
* Delimiter for error parsers presented in one string. * Delimiter for error parsers presented in one string.
* @since 5.2 * @since 5.2
*/ */
public final static char ERROR_PARSER_DELIMITER = ';'; public static final char ERROR_PARSER_DELIMITER = ';';
private int nOpens; private int nOpens;
private int lineCounter=0; private int lineCounter=0;
@ -63,7 +62,7 @@ public class ErrorParserManager extends OutputStream {
private final MarkerGenerator fMarkerGenerator; private final MarkerGenerator fMarkerGenerator;
private Map<String, ErrorParser> fErrorParsers; private Map<String, ErrorParser> fErrorParsers;
private ArrayList<ProblemMarkerInfo> fErrors; private List<ProblemMarkerInfo> fErrors;
private Vector<URI> fDirectoryStack; private Vector<URI> fDirectoryStack;
private final URI fBaseDirectoryURI; private final URI fBaseDirectoryURI;
@ -247,8 +246,10 @@ public class ErrorParserManager extends OutputStream {
* supports error markers, use it, otherwise use conventional stream * supports error markers, use it, otherwise use conventional stream
*/ */
private void outputLine(String line, ProblemMarkerInfo marker) { private void outputLine(String line, ProblemMarkerInfo marker) {
String l = line + "\n"; //$NON-NLS-1$ String l = line + '\n';
if ( outputStream == null ) return; if (outputStream == null) {
return;
}
try { try {
if (marker != null) { if (marker != null) {
if (outputStream instanceof IErrorMarkeredOutputStream) { if (outputStream instanceof IErrorMarkeredOutputStream) {
@ -322,7 +323,7 @@ public class ErrorParserManager extends OutputStream {
* @return the previous line, save in the working buffer. * @return the previous line, save in the working buffer.
*/ */
public String getPreviousLine() { public String getPreviousLine() {
return new String((previousLine) == null ? "" : previousLine); //$NON-NLS-1$ return previousLine == null ? "" : previousLine; //$NON-NLS-1$
} }
/** /**

View file

@ -33,7 +33,6 @@ public abstract class MarkerGenerator {
* Constructor for MarkerGenerator * Constructor for MarkerGenerator
*/ */
public MarkerGenerator() { public MarkerGenerator() {
super();
} }
/* /*
@ -157,14 +156,16 @@ public abstract class MarkerGenerator {
return IMarker.SEVERITY_ERROR; return IMarker.SEVERITY_ERROR;
} }
/* (non-Javadoc) /**
* Removes the IMarkers for the project specified in the argument if the * Removes the IMarkers for the project specified in the argument if the
* project exists, and is open. * project exists, and is open.
* *
* @param project * @param project
*/ */
public void removeAllMarkers(IProject project) { public void removeAllMarkers(IProject project) {
if (project == null || !project.isAccessible()) return; if (project == null || !project.isAccessible()) {
return;
}
// Clear out the problem markers // Clear out the problem markers
IWorkspace workspace = project.getWorkspace(); IWorkspace workspace = project.getWorkspace();

View file

@ -27,7 +27,7 @@ import org.eclipse.ui.IMarkerResolution;
public class PkgconfigErrorResolution implements IMarkerResolution { public class PkgconfigErrorResolution implements IMarkerResolution {
private class ConsoleOutputStream extends OutputStream { private static class ConsoleOutputStream extends OutputStream {
protected StringBuffer fBuffer; protected StringBuffer fBuffer;
@ -54,7 +54,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
} }
} }
private final static String PKG_UPDATE_MSG = "UpdatePackage.msg"; //$NON-NLS-1$ private static final String PKG_UPDATE_MSG = "UpdatePackage.msg"; //$NON-NLS-1$
private String pkgName; private String pkgName;
public PkgconfigErrorResolution(String pkgconfigRequirement) { public PkgconfigErrorResolution(String pkgconfigRequirement) {
@ -68,7 +68,6 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
@Override @Override
public String getLabel() { public String getLabel() {
// TODO Auto-generated method stub
return AutotoolsPlugin.getFormattedString(PKG_UPDATE_MSG, new String[] {pkgName}); return AutotoolsPlugin.getFormattedString(PKG_UPDATE_MSG, new String[] {pkgName});
} }
@ -118,9 +117,8 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
} }
} catch (CoreException e) { } catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} //$NON-NLS-1$ }
} }
} }

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.internal.autotools.core.configure; package org.eclipse.cdt.internal.autotools.core.configure;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
public abstract class AbstractConfigurationOption implements IConfigureOption { public abstract class AbstractConfigurationOption implements IConfigureOption {
@ -52,8 +53,8 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
} }
@Override @Override
public ArrayList<String> getParameters() { public List<String> getParameters() {
ArrayList<String> parameters = new ArrayList<>(); List<String> parameters = new ArrayList<>();
if (isParmSet()) if (isParmSet())
parameters.add(getParameter()); parameters.add(getParameter());
return parameters; return parameters;

View file

@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants; import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
@ -306,7 +307,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
} }
@Override @Override
public ArrayList<String> getToolArgs(String name) { public List<String> getToolArgs(String name) {
if (isParmsDirty) { if (isParmsDirty) {
configParms = new ArrayList<>(); configParms = new ArrayList<>();
Option[] options = getChildOptions(name); Option[] options = getChildOptions(name);
@ -316,11 +317,11 @@ public class AutotoolsConfiguration implements IAConfiguration {
Option[] childOptions = getChildOptions(option.getName()); Option[] childOptions = getChildOptions(option.getName());
for (int j = 0; j < childOptions.length; ++j) { for (int j = 0; j < childOptions.length; ++j) {
IConfigureOption childOption = getOption(childOptions[j].getName()); IConfigureOption childOption = getOption(childOptions[j].getName());
ArrayList<String> parameters = childOption.getParameters(); List<String> parameters = childOption.getParameters();
configParms.addAll(parameters); configParms.addAll(parameters);
} }
} else { } else {
ArrayList<String> parameters = option.getParameters(); List<String> parameters = option.getParameters();
configParms.addAll(parameters); configParms.addAll(parameters);
} }
} }

View file

@ -15,10 +15,10 @@ import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Random; import java.util.Random;
@ -62,8 +62,8 @@ import org.xml.sax.SAXException;
public class AutotoolsConfigurationManager implements IResourceChangeListener { public class AutotoolsConfigurationManager implements IResourceChangeListener {
public final static String CFG_FILE_NAME = ".autotools"; //$NON-NLS-1$ public static final String CFG_FILE_NAME = ".autotools"; //$NON-NLS-1$
private final static String CFG_CANT_SAVE = "Configure.Error.NoProjectToSave"; //$NON-NLS-1$ private static final String CFG_CANT_SAVE = "Configure.Error.NoProjectToSave"; //$NON-NLS-1$
/** /**
* @since 1.2 * @since 1.2
@ -383,12 +383,13 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
if (!f.exists()) if (!f.exists())
f.createNewFile(); f.createNewFile();
if (f.exists()) { if (f.exists()) {
PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f))); try (PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)))) {
Map<String, IAConfiguration> cfgs = configs.get(projectName); Map<String, IAConfiguration> cfgs = configs.get(projectName);
p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$ p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
p.println("<configurations>"); // $NON-NLS-1$ p.println("<configurations>"); // $NON-NLS-1$
Option[] optionList = AutotoolsConfiguration.getOptionList(); Option[] optionList = AutotoolsConfiguration.getOptionList();
// Before saving, force any cloning to occur via the option value handler. // Before saving, force any cloning to occur via the option
// value handler.
setSyncing(true); setSyncing(true);
for (int i = 0; i < cfgds.length; ++i) { for (int i = 0; i < cfgds.length; ++i) {
@SuppressWarnings("unused") @SuppressWarnings("unused")
@ -407,25 +408,28 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
Option option = optionList[j]; Option option = optionList[j];
IConfigureOption opt = cfg.getOption(option.getName()); IConfigureOption opt = cfg.getOption(option.getName());
if (opt.isFlag()) { if (opt.isFlag()) {
p.println("<flag id=\"" + option.getName() + "\" value=\"" + xmlEscape(option.getDefaultValue()) + "\">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ p.println("<flag id=\"" + option.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
+ xmlEscape(option.getDefaultValue()) + "\">"); //$NON-NLS-1$
FlagConfigureOption fco = (FlagConfigureOption) opt; FlagConfigureOption fco = (FlagConfigureOption) opt;
ArrayList<String> children = fco.getChildren(); List<String> children = fco.getChildren();
for (int k = 0; k < children.size(); ++k) { for (int k = 0; k < children.size(); ++k) {
String childName = children.get(k); String childName = children.get(k);
IConfigureOption childopt = cfg.getOption(childName); IConfigureOption childopt = cfg.getOption(childName);
p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" + xmlEscape(childopt.getValue()) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$ p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
+ xmlEscape(childopt.getValue()) + "\"/>"); // $NON-NLS-3$
} }
p.println("</flag>"); //$NON-NLS-1$ p.println("</flag>"); //$NON-NLS-1$
} } else if (!opt.isCategory() && !opt.isFlagValue())
else if (!opt.isCategory() && !opt.isFlagValue()) p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) //$NON-NLS-1$ //$NON-NLS-2$
p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$ + "\"/>"); // $NON-NLS-3$
} }
p.println("</configuration>"); //$NON-NLS-1$ p.println("</configuration>"); //$NON-NLS-1$
// Sync name field as this configuration is now officially saved // Sync name field as this configuration is now
// officially saved
syncNameField(cfgd); syncNameField(cfgd);
} }
p.println("</configurations>"); p.println("</configurations>");
p.close(); }
} }
} catch (IOException e) { } catch (IOException e) {
AutotoolsPlugin.log(e); AutotoolsPlugin.log(e);
@ -451,8 +455,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
if (!f.exists()) if (!f.exists())
f.createNewFile(); f.createNewFile();
if (f.exists()) { if (f.exists()) {
PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f))); try (PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)))) {
try {
Map<String, IAConfiguration> cfgs = getSavedConfigs(project); Map<String, IAConfiguration> cfgs = getSavedConfigs(project);
if (cfgs == null) if (cfgs == null)
return; return;
@ -483,11 +486,11 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
// Put all the remaining configurations already saved back into the file. // Put all the remaining configurations already saved back into the file.
// These represent deleted configurations, but confirmation has not occurred. // These represent deleted configurations, but confirmation has not occurred.
for (Iterator<String> i = cfgs.keySet().iterator(); i.hasNext(); ) { for (Entry<String, IAConfiguration> i : cfgs.entrySet()) {
String id = i.next(); String id = i.getKey();
// A remaining id won't appear in our savedIds list. // A remaining id won't appear in our savedIds list.
if (!savedIds.contains(id)) { if (!savedIds.contains(id)) {
IAConfiguration cfg = cfgs.get(id); IAConfiguration cfg = i.getValue();
p.println("<configuration id=\"" + id + "\">"); //$NON-NLS-1$ //$NON-NLS-2$ p.println("<configuration id=\"" + id + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
for (int j = 0; j < optionList.length; ++j) { for (int j = 0; j < optionList.length; ++j) {
Option option = optionList[j]; Option option = optionList[j];
@ -499,8 +502,6 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
} }
} }
p.println("</configurations>"); p.println("</configurations>");
} finally {
p.close();
} }
} }
} catch (IOException e) { } catch (IOException e) {
@ -547,7 +548,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
} }
} }
private class AutotoolsOption implements IAutotoolsOption { private static class AutotoolsOption implements IAutotoolsOption {
private IConfigureOption option; private IConfigureOption option;
private final static String UNMODIFIABLE_CONFIG_OPTION = "CfgOptions.Unmodifiable.Option"; //$NON-NLS-1$ private final static String UNMODIFIABLE_CONFIG_OPTION = "CfgOptions.Unmodifiable.Option"; //$NON-NLS-1$

View file

@ -28,13 +28,13 @@ import org.eclipse.core.runtime.CoreException;
public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
implements IOptionApplicability { implements IOptionApplicability {
public final static String DEFAULT_BUILD_DIR = "build"; //$NON-NLS-1$ public static final 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$ public static final String CONFIGURE_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure"; //$NON-NLS-1$
public final static String BUILD_DIR_OPTION_ID = "org.eclipse.linuxtools.cdt.autotools.core.option.configure.builddir"; //$NON-NLS-1$ public static final String BUILD_DIR_OPTION_ID = "org.eclipse.linuxtools.cdt.autotools.core.option.configure.builddir"; //$NON-NLS-1$
public final static String BUILD_DIR_APPLY = "BuildDir.apply"; //$NON-NLS-1$ public static final String BUILD_DIR_APPLY = "BuildDir.apply"; //$NON-NLS-1$
public final static String BUILD_DIR_DEFAULT_QUESTION = "BuildDir.default"; //$NON-NLS-1$ public static final String BUILD_DIR_DEFAULT_QUESTION = "BuildDir.default"; //$NON-NLS-1$
public final static String BUILD_DIR_YES = "BuildDir.yes"; //$NON-NLS-1$ public static final String BUILD_DIR_YES = "BuildDir.yes"; //$NON-NLS-1$
public final static String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$ public static final String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$
//FIXME: Use holder to set option value, not the "option" parameter //FIXME: Use holder to set option value, not the "option" parameter
@Override @Override

View file

@ -12,12 +12,12 @@
package org.eclipse.cdt.internal.autotools.core.configure; package org.eclipse.cdt.internal.autotools.core.configure;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
public class FlagConfigureOption extends AbstractConfigurationOption { public class FlagConfigureOption extends AbstractConfigurationOption {
private String value; private String value;
private ArrayList<String> children = private ArrayList<String> children = new ArrayList<>();
new ArrayList<>();
public FlagConfigureOption(String name, AutotoolsConfiguration cfg) { public FlagConfigureOption(String name, AutotoolsConfiguration cfg) {
super(name, cfg); super(name, cfg);
@ -30,8 +30,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private FlagConfigureOption(String name, AutotoolsConfiguration cfg, private FlagConfigureOption(String name, AutotoolsConfiguration cfg, String value, ArrayList<String> children) {
String value, ArrayList<String> children) {
super(name, cfg); super(name, cfg);
this.value = value; this.value = value;
this.children = (ArrayList<String>) children.clone(); this.children = (ArrayList<String>) children.clone();
@ -93,8 +92,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
@Override @Override
public IConfigureOption copy(AutotoolsConfiguration config) { public IConfigureOption copy(AutotoolsConfiguration config) {
FlagConfigureOption f = new FlagConfigureOption(name, config, value, children); return new FlagConfigureOption(name, config, value, children);
return f;
} }
@Override @Override
@ -116,7 +114,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
children.add(name); children.add(name);
} }
public ArrayList<String> getChildren() { public List<String> getChildren() {
return children; return children;
} }

View file

@ -10,7 +10,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.autotools.core.configure; package org.eclipse.cdt.internal.autotools.core.configure;
import java.util.ArrayList; import java.util.List;
import java.util.Map; import java.util.Map;
public interface IAConfiguration { public interface IAConfiguration {
@ -26,7 +26,7 @@ public interface IAConfiguration {
String getToolParameters(String name); String getToolParameters(String name);
ArrayList<String> getToolArgs(String name); List<String> getToolArgs(String name);
void setOption(String name, String value); void setOption(String name, String value);

View file

@ -10,7 +10,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.autotools.core.configure; package org.eclipse.cdt.internal.autotools.core.configure;
import java.util.ArrayList; import java.util.List;
import org.eclipse.cdt.autotools.core.IAutotoolsOption; import org.eclipse.cdt.autotools.core.IAutotoolsOption;
@ -29,7 +29,7 @@ public interface IConfigureOption {
String getParameter(); String getParameter();
ArrayList<String> getParameters(); List<String> getParameters();
boolean isParmSet(); boolean isParmSet();

View file

@ -11,12 +11,13 @@
package org.eclipse.cdt.internal.autotools.core.configure; package org.eclipse.cdt.internal.autotools.core.configure;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
public class MultiArgConfigureOption extends AbstractConfigurationOption { public class MultiArgConfigureOption extends AbstractConfigurationOption {
private String value; private String value;
private ArrayList<String> userArgs; private List<String> userArgs;
private boolean isDirty; private boolean isDirty;
public MultiArgConfigureOption(String name, AutotoolsConfiguration cfg) { public MultiArgConfigureOption(String name, AutotoolsConfiguration cfg) {
@ -65,7 +66,7 @@ public class MultiArgConfigureOption extends AbstractConfigurationOption {
} }
@Override @Override
public ArrayList<String> getParameters() { public List<String> getParameters() {
// May be multiple user-specified options in which case we // May be multiple user-specified options in which case we
// need to split them up into individual options // need to split them up into individual options
if (!isDirty && userArgs != null) if (!isDirty && userArgs != null)