Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-07-08 20:06:19 +0000
committerAndrew Gvozdev2012-07-08 20:06:19 +0000
commit058f96dd9eb199e3f45c14ab1d40e242fd6a2f0d (patch)
treec75ea27981a1186bc2dd6b9ac462ae77f87fb6a4 /build/org.eclipse.cdt.managedbuilder.gnu.ui/src
parent1b620f2fec66352735db3286daff3ce10cf35f6e (diff)
downloadorg.eclipse.cdt-058f96dd9eb199e3f45c14ab1d40e242fd6a2f0d.tar.gz
org.eclipse.cdt-058f96dd9eb199e3f45c14ab1d40e242fd6a2f0d.tar.xz
org.eclipse.cdt-058f96dd9eb199e3f45c14ab1d40e242fd6a2f0d.zip
Cosmetics - JavaDoc and code formatting
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.gnu.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java23
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java13
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java4
4 files changed, 36 insertions, 51 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
index 9599f41fbb4..4460a4d7c76 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
@@ -63,16 +63,13 @@ public class CygwinPathResolver implements IBuildPathResolver {
private static String rootCygwin = null;
private static String etcCygwin = null;
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IBuildPathResolver#resolveBuildPaths(int, java.lang.String, java.lang.String, org.eclipse.cdt.managedbuilder.core.IConfiguration)
- */
@Override
public String[] resolveBuildPaths(int pathType, String variableName,
String variableValue, IConfiguration configuration) {
- if(!isWindows()){
+ if(!isWindows()) {
return variableValue.split(DELIMITER_UNIX);
- } else if(isMinGW(configuration)){
+ } else if(isMinGW(configuration)) {
return variableValue.split(DELIMITER_WIN);
}
@@ -92,7 +89,8 @@ public class CygwinPathResolver implements IBuildPathResolver {
}
return result;
}
- /*
+
+ /**
* returns "/etc" path in Windows format
*/
public static String getEtcPath() {
@@ -100,17 +98,17 @@ public class CygwinPathResolver implements IBuildPathResolver {
return etcCygwin;
}
- /*
+ /**
* returns "/usr/bin" path in Windows format
*/
public static String getBinPath() {
if (!checked) findPaths();
return binCygwin;
}
- /*
+
+ /**
* returns Cygwin root ("/") path in Windows format
*/
-
public static String getRootPath() {
if (!checked) findPaths();
return rootCygwin;
@@ -140,6 +138,7 @@ public class CygwinPathResolver implements IBuildPathResolver {
}
return null;
}
+
/**
* Returns the absolute path of the pattern by
* simply appending the pattern to the root
@@ -233,7 +232,7 @@ public class CygwinPathResolver implements IBuildPathResolver {
try {
IEnvironmentVariable vars[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(cfg,true);
String env[] = new String[vars.length];
- for(int i = 0; i < env.length; i++){
+ for(int i = 0; i < env.length; i++) {
env[i] = vars[i].getName() + "="; //$NON-NLS-1$
String value = vars[i].getValue();
if(value != null)
@@ -258,10 +257,10 @@ public class CygwinPathResolver implements IBuildPathResolver {
return null;
}
- public static boolean isMinGW(IConfiguration cfg){
+ public static boolean isMinGW(IConfiguration cfg) {
String versionInfo[] = exec(GCC_VERSION_CMD, cfg);
if(versionInfo != null) {
- for(int i = 0; i < versionInfo.length; i++){
+ for(int i = 0; i < versionInfo.length; i++) {
if(versionInfo[i].indexOf(MINGW_SPECIAL) != -1)
return true;
else if(versionInfo[i].indexOf(CYGWIN_SPECIAL) != -1)
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java
index dafa734e209..ae08fcf841d 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java
@@ -16,13 +16,10 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.cdt.managedbuilder.internal.envvar.BuildEnvVar;
-
/**
* @noextend This class is not intended to be subclassed by clients.
*/
-public class GnuCygwinConfigurationEnvironmentSupplier implements
- IConfigurationEnvironmentVariableSupplier {
-
+public class GnuCygwinConfigurationEnvironmentSupplier implements IConfigurationEnvironmentVariableSupplier {
private static final String PATH = "PATH"; //$NON-NLS-1$
private static final String DELIMITER_UNIX = ":"; //$NON-NLS-1$
private static final String PROPERTY_DELIMITER = "path.separator"; //$NON-NLS-1$
@@ -32,53 +29,49 @@ public class GnuCygwinConfigurationEnvironmentSupplier implements
private static final String LC_ALL = "LC_ALL"; //$NON-NLS-1$
private static final String LC_MESSAGES = "LC_MESSAGES"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier#getVariable(java.lang.String, org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider)
- */
@Override
- public IBuildEnvironmentVariable getVariable(String variableName,
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
-
- if (variableName == null)
+ public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ if (variableName == null) {
return null;
+ }
- if (!System.getProperty(PROPERTY_OSNAME).toLowerCase().startsWith("windows ")) //$NON-NLS-1$
+ if (!System.getProperty(PROPERTY_OSNAME).toLowerCase().startsWith("windows ")) { //$NON-NLS-1$
return null;
-
+ }
+
if (variableName.equalsIgnoreCase(PATH)) {
String p = CygwinPathResolver.getBinPath();
- if (p != null)
+ if (p != null) {
return new BuildEnvVar(PATH, p.replace('/','\\'), IBuildEnvironmentVariable.ENVVAR_PREPEND, System.getProperty(PROPERTY_DELIMITER, DELIMITER_UNIX));
+ }
} else if (variableName.equalsIgnoreCase(LANG)) {
// Workaround for not being able to select encoding for CDT console -> change codeset to Latin1
- String langValue = System.getenv(LANG);
- if (langValue == null || langValue.length() == 0)
+ String langValue = System.getenv(LANG);
+ if (langValue == null || langValue.length() == 0) {
langValue = System.getenv(LC_ALL);
- if (langValue == null || langValue.length() == 0)
+ }
+ if (langValue == null || langValue.length() == 0) {
langValue = System.getenv(LC_MESSAGES);
- if (langValue != null && langValue.length() > 0)
+ }
+ if (langValue != null && langValue.length() > 0) {
// langValue is [language[_territory][.codeset][@modifier]], i.e. "en_US.UTF-8@dict"
// we replace codeset with Latin1 as CDT console garbles UTF
// and ignore modifier which is not used by LANG
langValue = langValue.replaceFirst("([^.@]*)(\\..*)?(@.*)?", "$1.ISO-8859-1"); //$NON-NLS-1$ //$NON-NLS-2$
- else
+ } else {
langValue = "C.ISO-8859-1"; //$NON-NLS-1$
+ }
- return new BuildEnvVar(LANG, langValue);
+ return new BuildEnvVar(LANG, langValue);
}
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier#getVariables(org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider)
- */
@Override
- public IBuildEnvironmentVariable[] getVariables(
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
-
+ public IBuildEnvironmentVariable[] getVariables(IConfiguration configuration, IEnvironmentVariableProvider provider) {
IBuildEnvironmentVariable varLang = getVariable(LANG, configuration, provider);
IBuildEnvironmentVariable varPath = getVariable(PATH, configuration, provider);
-
+
if (varPath != null) {
return new IBuildEnvironmentVariable[] {varLang, varPath};
} else {
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java
index f3c9541db45..cf7d2816c2c 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java
@@ -32,24 +32,17 @@ import org.osgi.framework.Version;
*
* @noextend This class is not intended to be subclassed by clients.
*/
-public class IsGnuCygwinToolChainSupported implements
- IManagedIsToolChainSupported {
-
+public class IsGnuCygwinToolChainSupported implements IManagedIsToolChainSupported {
static final String[] CHECKED_NAMES = {"gcc", "binutils", "make"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static boolean suppChecked = false;
static boolean toolchainIsSupported = false;
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported#isSupported(org.eclipse.cdt.managedbuilder.core.IToolChain, org.eclipse.core.runtime.PluginVersionIdentifier, java.lang.String)
- */
/**
* @since 8.0
*/
@Override
public boolean isSupported(IToolChain toolChain, Version version, String instance) {
-
if (suppChecked) return toolchainIsSupported;
String etcCygwin = CygwinPathResolver.getEtcPath();
@@ -80,7 +73,9 @@ public class IsGnuCygwinToolChainSupported implements
String s;
while ((s = data.readLine()) != null ) {
for (int j = 0; j < CHECKED_NAMES.length; j++) {
- if (s.startsWith(CHECKED_NAMES[j])) {found[j] = true;}
+ if (s.startsWith(CHECKED_NAMES[j])) {
+ found[j] = true;
+ }
}
}
arePackagesInstalled = true;
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java
index 940ca95cb59..65313653e39 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java
@@ -25,9 +25,7 @@ import org.eclipse.core.runtime.Platform;
*
* @noextend This class is not intended to be subclassed by clients.
*/
-public class MingwEnvironmentVariableSupplier implements
- IConfigurationEnvironmentVariableSupplier {
-
+public class MingwEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
private static boolean checked = false;
private static IPath binDir = null;

Back to the top