1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

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>
This commit is contained in:
Alexander Kurtakov 2015-12-01 14:04:39 +02:00
parent ca3aa5de95
commit 7f30fb8efa
5 changed files with 7 additions and 27 deletions

View file

@ -93,7 +93,6 @@ public class AutotoolsConfigurationBuilder extends ACBuilder {
cos.flush(); cos.flush();
cos.close(); cos.close();
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block
AutotoolsPlugin.log(e); AutotoolsPlugin.log(e);
} }
} }

View file

@ -127,10 +127,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private IBuilder builder; private IBuilder builder;
public void generateDependencies() {
}
/** /**
* @since 2.0 * @since 2.0
*/ */
@ -766,7 +762,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private IPath getSourcePath(){ private IPath getSourcePath(){
IPath sourcePath; IPath sourcePath;
if (srcDir.equals("")) if (srcDir.isEmpty())
sourcePath = getProjectLocation(); sourcePath = getProjectLocation();
else { // find location of source directory which may be a virtual folder else { // find location of source directory which may be a virtual folder
IResource sourceResource = project.findMember(srcDir); IResource sourceResource = project.findMember(srcDir);
@ -946,7 +942,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
try { try {
proc.waitFor(); proc.waitFor();
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
exitValue = proc.exitValue(); 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 // Method to get the Win OS Type to distinguish between Cygwin and MingW
private String getWinOSType() { private String getWinOSType() {
if (winOSType.equals("")) { if (winOSType.isEmpty()) {
try { try {
RemoteCommandLauncher launcher = new RemoteCommandLauncher(); RemoteCommandLauncher launcher = new RemoteCommandLauncher();
launcher.setProject(getProject()); launcher.setProject(getProject());
@ -1285,7 +1280,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
try { try {
proc.waitFor(); proc.waitFor();
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
exitValue = proc.exitValue(); exitValue = proc.exitValue();

View file

@ -79,9 +79,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} catch (SecurityException e) { } catch (SecurityException | NoSuchMethodException e) {
return false;
} catch (NoSuchMethodException e) {
return false; return false;
} }
} }

View file

@ -261,14 +261,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
list = cfgList; list = cfgList;
} }
} }
} catch (ParserConfigurationException e) { } catch (ParserConfigurationException | SAXException | IOException 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
e.printStackTrace(); e.printStackTrace();
} }
} }

View file

@ -71,7 +71,7 @@ public class NewAutotoolsProject extends ProcessRunner {
} }
List<?> configs = template.getTemplateInfo().getConfigurations(); 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$ throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
} }
@ -98,14 +98,10 @@ public class NewAutotoolsProject extends ProcessRunner {
restoreAutoBuild(workspace); restoreAutoBuild(workspace);
} } else {
else {
AutotoolsNewProjectNature.addAutotoolsNature(project, monitor); AutotoolsNewProjectNature.addAutotoolsNature(project, monitor);
// throw new ProcessFailureException(Messages.getString("NewAutotoolsProject.5") + projectName); //$NON-NLS-1$
} }
} catch (CoreException e) { } catch (CoreException | BuildException e) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
} catch (BuildException e) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$ throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
} }
} }