mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Fix unindented if block (no functional change)
This commit is contained in:
parent
d2cd2d381f
commit
97acd431e0
1 changed files with 54 additions and 54 deletions
|
@ -817,69 +817,69 @@ public class CMainTab extends CLaunchConfigurationTab {
|
||||||
|
|
||||||
if (!dontCheckProgram) {
|
if (!dontCheckProgram) {
|
||||||
|
|
||||||
String name = fProjText.getText().trim();
|
String name = fProjText.getText().trim();
|
||||||
if (name.length() == 0) {
|
if (name.length() == 0) {
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Project_not_specified")); //$NON-NLS-1$
|
setErrorMessage(LaunchMessages.getString("CMainTab.Project_not_specified")); //$NON-NLS-1$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
|
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
|
||||||
setErrorMessage(LaunchMessages.getString("Launch.common.Project_does_not_exist")); //$NON-NLS-1$
|
setErrorMessage(LaunchMessages.getString("Launch.common.Project_does_not_exist")); //$NON-NLS-1$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
||||||
if (!project.isOpen()) {
|
if (!project.isOpen()) {
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Project_must_be_opened")); //$NON-NLS-1$
|
setErrorMessage(LaunchMessages.getString("CMainTab.Project_must_be_opened")); //$NON-NLS-1$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
name = fProgText.getText().trim();
|
name = fProgText.getText().trim();
|
||||||
if (name.length() == 0) {
|
if (name.length() == 0) {
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_not_specified")); //$NON-NLS-1$
|
setErrorMessage(LaunchMessages.getString("CMainTab.Program_not_specified")); //$NON-NLS-1$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
|
if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
IPath exePath = new Path(name);
|
|
||||||
if (!exePath.isAbsolute()) {
|
|
||||||
IPath location = project.getLocation();
|
|
||||||
if (location == null) {
|
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
IPath exePath = new Path(name);
|
||||||
exePath = location.append(name);
|
if (!exePath.isAbsolute()) {
|
||||||
if (!exePath.toFile().exists()) {
|
IPath location = project.getLocation();
|
||||||
// Try the old way, which is required to support linked resources.
|
if (location == null) {
|
||||||
IFile projFile = null;
|
|
||||||
try {
|
|
||||||
projFile = project.getFile(name);
|
|
||||||
}
|
|
||||||
catch (IllegalArgumentException exc) {} // thrown if relative path that resolves to a root file ("..\somefile")
|
|
||||||
if (projFile == null || !projFile.exists()) {
|
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
exePath = projFile.getLocation();
|
exePath = location.append(name);
|
||||||
|
if (!exePath.toFile().exists()) {
|
||||||
|
// Try the old way, which is required to support linked resources.
|
||||||
|
IFile projFile = null;
|
||||||
|
try {
|
||||||
|
projFile = project.getFile(name);
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException exc) {} // thrown if relative path that resolves to a root file ("..\somefile")
|
||||||
|
if (projFile == null || !projFile.exists()) {
|
||||||
|
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
exePath = projFile.getLocation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!exePath.toFile().exists()) {
|
||||||
if (!exePath.toFile().exists()) {
|
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
try {
|
||||||
try {
|
if (!isBinary(project, exePath)) {
|
||||||
if (!isBinary(project, exePath)) {
|
setErrorMessage(LaunchMessages.getString("CMainTab.Program_is_not_a_recongnized_executable")); //$NON-NLS-1$
|
||||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_is_not_a_recongnized_executable")); //$NON-NLS-1$
|
return false;
|
||||||
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
LaunchUIPlugin.log(e);
|
||||||
|
setErrorMessage(e.getLocalizedMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
|
||||||
LaunchUIPlugin.log(e);
|
|
||||||
setErrorMessage(e.getLocalizedMessage());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fCoreText != null) {
|
if (fCoreText != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue