Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-12-01 07:04:39 -0500
committerAlexander Kurtakov2015-12-01 08:08:05 -0500
commit7f30fb8efac5f2cfa9ea7ec5bd9decd6e5b797cc (patch)
tree9514128507644f6cc0b41b5b02a8b1870ffca6f4 /build/org.eclipse.cdt.autotools.core/src
parentca3aa5de95293b1ed54074d95175d7dcad11e286 (diff)
downloadorg.eclipse.cdt-7f30fb8efac5f2cfa9ea7ec5bd9decd6e5b797cc.tar.gz
org.eclipse.cdt-7f30fb8efac5f2cfa9ea7ec5bd9decd6e5b797cc.tar.xz
org.eclipse.cdt-7f30fb8efac5f2cfa9ea7ec5bd9decd6e5b797cc.zip
cosmetics: Autotools core bundle cleanups.
Various improvements: * Remove useless comments * Remove unused methods * Use String.isEmpty * Multi-catch Change-Id: I5d4e6ca5d4bcc925aad4db5c47f82d5d51d24522 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/internal/autotools/core/AutotoolsConfigurationBuilder.java1
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java10
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java9
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/wizards/NewAutotoolsProject.java10
5 files changed, 7 insertions, 27 deletions
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 b423fd05f5..a28ae58b4d 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
@@ -93,7 +93,6 @@ public class AutotoolsConfigurationBuilder extends ACBuilder {
cos.flush();
cos.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
AutotoolsPlugin.log(e);
}
}
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 f5b742d62d..45dcdd5ea5 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
@@ -127,10 +127,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private IBuilder builder;
- public void generateDependencies() {
-
- }
-
/**
* @since 2.0
*/
@@ -766,7 +762,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private IPath getSourcePath(){
IPath sourcePath;
- if (srcDir.equals(""))
+ if (srcDir.isEmpty())
sourcePath = getProjectLocation();
else { // find location of source directory which may be a virtual folder
IResource sourceResource = project.findMember(srcDir);
@@ -946,7 +942,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
try {
proc.waitFor();
} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
e1.printStackTrace();
}
exitValue = proc.exitValue();
@@ -1028,7 +1023,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Method to get the Win OS Type to distinguish between Cygwin and MingW
private String getWinOSType() {
- if (winOSType.equals("")) {
+ if (winOSType.isEmpty()) {
try {
RemoteCommandLauncher launcher = new RemoteCommandLauncher();
launcher.setProject(getProject());
@@ -1285,7 +1280,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
try {
proc.waitFor();
} catch (InterruptedException e1) {
- // TODO Auto-generated catch block
e1.printStackTrace();
}
exitValue = proc.exitValue();
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 62af8dbfff..1fab1c2a9e 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
@@ -79,9 +79,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
} catch (Exception e) {
throw new RuntimeException(e);
}
- } catch (SecurityException e) {
- return false;
- } catch (NoSuchMethodException e) {
+ } catch (SecurityException | NoSuchMethodException e) {
return false;
}
}
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 189fa47d10..e82d0ebfea 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
@@ -261,14 +261,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
list = cfgList;
}
}
- } catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
+ } catch (ParserConfigurationException | SAXException | IOException e) {
e.printStackTrace();
}
}
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 94fdf15af2..7e3b2a46e2 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
@@ -71,7 +71,7 @@ public class NewAutotoolsProject extends ProcessRunner {
}
List<?> configs = template.getTemplateInfo().getConfigurations();
- if (configs == null || configs.size() == 0) {
+ if (configs == null || configs.isEmpty()) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
}
@@ -98,14 +98,10 @@ public class NewAutotoolsProject extends ProcessRunner {
restoreAutoBuild(workspace);
- }
- else {
+ } else {
AutotoolsNewProjectNature.addAutotoolsNature(project, monitor);
- // throw new ProcessFailureException(Messages.getString("NewAutotoolsProject.5") + projectName); //$NON-NLS-1$
}
- } catch (CoreException e) {
- throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
- } catch (BuildException e) {
+ } catch (CoreException | BuildException e) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
}
}

Back to the top