Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2015-01-08 19:07:01 +0000
committerSergey Prigogin2015-01-09 00:14:17 +0000
commit2dbdd831ec6cafd92830a200739139e14e2645bd (patch)
tree7cc8302f873a8209aa83c6560bd581080aed5066 /core
parent07997cb72a3be0ce98c8b31979bf106e5eec597a (diff)
downloadorg.eclipse.cdt-2dbdd831ec6cafd92830a200739139e14e2645bd.tar.gz
org.eclipse.cdt-2dbdd831ec6cafd92830a200739139e14e2645bd.tar.xz
org.eclipse.cdt-2dbdd831ec6cafd92830a200739139e14e2645bd.zip
Cosmetics.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java4
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java5
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java3
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/BracketInserterTest.java3
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/HyperlinkTest.java3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/folderwizard/NewSourceFolderWizardPage.java32
8 files changed, 23 insertions, 31 deletions
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java
index 94cbe031908..c19401c2f7a 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java
@@ -361,8 +361,8 @@ public class CModelTests extends TestCase {
// bug 179474
public void testSourceExclusionFilters_179474() throws Exception {
ICProject testProject;
- testProject=CProjectHelper.createCProject("bug179474", "none", IPDOMManager.ID_NO_INDEXER);
- if (testProject==null)
+ testProject= CProjectHelper.createCProject("bug179474", "none", IPDOMManager.ID_NO_INDEXER);
+ if (testProject == null)
fail("Unable to create project");
IFolder subFolder = testProject.getProject().getFolder("sub");
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java
index d0ca06519c7..5c4eaf85efb 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java
@@ -30,7 +30,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICProject extends IParent, IOpenable, ICElement {
-
/**
* Returns the <code>ICElement</code> corresponding to the given
* path, or <code>null</code> if no such
@@ -67,8 +66,7 @@ public interface ICProject extends IParent, IOpenable, ICElement {
* Returns all of the existing source roots that exist
* on the project, in the order they are defined by the ".cdtproject".
*
- * @return all of the existing package fragment roots that exist
- * on the classpath
+ * @return all of the existing source roots
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
*/
@@ -243,5 +241,4 @@ public interface ICProject extends IParent, IOpenable, ICElement {
* exception occurs while accessing its corresponding resource
*/
Object[] getNonCResources() throws CModelException;
-
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java
index 1b1ed0c0947..789435c896e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java
@@ -23,7 +23,7 @@ public class SourceEntry extends APathEntry implements ISourceEntry {
@Override
public boolean equals (Object obj) {
if (obj instanceof ISourceEntry) {
- ISourceEntry otherEntry = (ISourceEntry)obj;
+ ISourceEntry otherEntry = (ISourceEntry) obj;
if (!super.equals(otherEntry)) {
return false;
}
@@ -40,5 +40,4 @@ public class SourceEntry extends APathEntry implements ISourceEntry {
}
return super.equals(obj);
}
-
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/BracketInserterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/BracketInserterTest.java
index a255c58552d..98f81b5970c 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/BracketInserterTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/BracketInserterTest.java
@@ -16,7 +16,6 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -104,7 +103,7 @@ public class BracketInserterTest extends TestCase {
private void setUpProject() throws CoreException {
fProject= CProjectHelper.createCProject(getName(), "bin", IPDOMManager.ID_NO_INDEXER);
ICContainer cContainer= CProjectHelper.addCContainer(fProject, SRC);
- IFile file= EditorTestHelper.createFile((IContainer)cContainer.getResource(), TU_NAME, TU_CONTENTS, new NullProgressMonitor());
+ IFile file= EditorTestHelper.createFile(cContainer.getResource(), TU_NAME, TU_CONTENTS, new NullProgressMonitor());
assertNotNull(file);
assertTrue(file.exists());
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/HyperlinkTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/HyperlinkTest.java
index ce0c65544fd..e1ecdf816af 100644
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/HyperlinkTest.java
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/HyperlinkTest.java
@@ -14,7 +14,6 @@ package org.eclipse.cdt.ui.tests.text;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -102,7 +101,7 @@ public class HyperlinkTest extends TestCase {
super.setUp();
project= CProjectHelper.createCCProject(super.getName(), "unused", IPDOMManager.ID_NO_INDEXER);
ICContainer cContainer= CProjectHelper.addCContainer(project, "src");
- IFile file= EditorTestHelper.createFile((IContainer) cContainer.getResource(), fileName, code, new NullProgressMonitor());
+ IFile file= EditorTestHelper.createFile(cContainer.getResource(), fileName, code, new NullProgressMonitor());
assertNotNull(file);
assertTrue(file.exists());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
index 12e108ec359..410251bed0a 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
@@ -604,7 +604,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
List<ICElement> missingElements = new ArrayList<ICElement>();
try {
List<IResource> missingContainers = new ArrayList<IResource>();
- IResource[] allChildren = ((IContainer) container.getResource()).members();
+ IResource[] allChildren = container.getResource().members();
for (IResource child : allChildren) {
if (!(child instanceof IContainer))
continue;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java
index 15f803aed94..40ac64bb250 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java
@@ -24,7 +24,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.internal.ui.wizards.CWizardRegistry;
public class CPerspectiveFactory implements IPerspectiveFactory {
-
/**
* Constructs a new Default layout engine.
*/
@@ -96,6 +95,5 @@ public class CPerspectiveFactory implements IPerspectiveFactory {
for (int i = 0; i < wizIDs.length; ++i) {
layout.addNewWizardShortcut(wizIDs[i]);
}
-
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/folderwizard/NewSourceFolderWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/folderwizard/NewSourceFolderWizardPage.java
index 095f6f60e4d..da6ed5a6afb 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/folderwizard/NewSourceFolderWizardPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/folderwizard/NewSourceFolderWizardPage.java
@@ -147,12 +147,12 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
String projPath= null;
if (selectedElement instanceof IResource) {
- IProject proj= ((IResource)selectedElement).getProject();
+ IProject proj= ((IResource) selectedElement).getProject();
if (proj != null) {
projPath= proj.getFullPath().makeRelative().toString();
}
} else if (selectedElement instanceof ICElement) {
- ICProject jproject= ((ICElement)selectedElement).getCProject();
+ ICProject jproject= ((ICElement) selectedElement).getCProject();
if (jproject != null) {
projPath= jproject.getProject().getFullPath().makeRelative().toString();
}
@@ -336,7 +336,7 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
return;
}
}
- ArrayList<IPathEntry> newEntries= new ArrayList<IPathEntry>(fEntries.length + 1);
+ ArrayList<IPathEntry> newEntries= new ArrayList<>(fEntries.length + 1);
int projectEntryIndex= -1;
for (int i= 0; i < fEntries.length; i++) {
@@ -355,7 +355,7 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
IPathEntry newEntry= CoreModel.newSourceEntry(path);
- Set<IPathEntry> modified= new HashSet<IPathEntry>();
+ Set<IPathEntry> modified= new HashSet<>();
if (fExcludeInOthersFields.isSelected()) {
addExclusionPatterns(newEntry, newEntries, modified);
newEntries.add(CoreModel.newSourceEntry(path));
@@ -390,13 +390,13 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
}
}
- private void addExclusionPatterns(IPathEntry newEntry, List<IPathEntry> existing, Set<IPathEntry> modifiedEntries) {
+ private static void addExclusionPatterns(IPathEntry newEntry, List<IPathEntry> existing, Set<IPathEntry> modifiedEntries) {
IPath entryPath= newEntry.getPath();
for (int i= 0; i < existing.size(); i++) {
IPathEntry curr= existing.get(i);
IPath currPath= curr.getPath();
if (curr.getEntryKind() == IPathEntry.CDT_SOURCE && currPath.isPrefixOf(entryPath)) {
- IPath[] exclusionFilters= ((ISourceEntry)curr).getExclusionPatterns();
+ IPath[] exclusionFilters= ((ISourceEntry) curr).getExclusionPatterns();
if (!CoreModelUtil.isExcludedPath(entryPath, exclusionFilters)) {
IPath pathToExclude= entryPath.removeFirstSegments(currPath.segmentCount()).addTrailingSeparator();
IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1];
@@ -427,7 +427,6 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
}
monitor.beginTask(NewFolderWizardMessages.NewSourceFolderWizardPage_operation, 3);
try {
-// IPath projPath= fCurrCProject.getProject().getFullPath();
String relPath= fRootDialogField.getText();
IFolder folder= fCurrCProject.getProject().getFolder(relPath);
@@ -438,7 +437,7 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
throw new InterruptedException();
}
- if(CCorePlugin.getDefault().isNewStyleProject(fCurrCProject.getProject())){
+ if (CCorePlugin.getDefault().isNewStyleProject(fCurrCProject.getProject())) {
ICSourceEntry newEntry = new CSourceEntry(folder, null, 0);
ICProjectDescription des = CCorePlugin.getDefault().getProjectDescription(fCurrCProject.getProject(), true);
addEntryToAllCfgs(des, newEntry, fIsProjectAsSourceFolder);
@@ -453,23 +452,24 @@ public class NewSourceFolderWizardPage extends NewElementWizardPage {
}
}
- private void addEntryToAllCfgs(ICProjectDescription des, ICSourceEntry entry, boolean removeProj) throws WriteAccessException, CoreException{
+ private void addEntryToAllCfgs(ICProjectDescription des, ICSourceEntry entry, boolean removeProj)
+ throws WriteAccessException, CoreException{
ICConfigurationDescription cfgs[] = des.getConfigurations();
- for(ICConfigurationDescription cfg : cfgs){
+ for (ICConfigurationDescription cfg : cfgs) {
ICSourceEntry[] entries = cfg.getSourceEntries();
entries = addEntry(entries, entry, removeProj);
cfg.setSourceEntries(entries);
}
}
- private ICSourceEntry[] addEntry(ICSourceEntry[] entries, ICSourceEntry entry, boolean removeProj){
- Set<ICSourceEntry> set = new HashSet<ICSourceEntry>();
- for(ICSourceEntry se : entries){
- if(removeProj && new Path(se.getValue()).segmentCount() == 1)
+ private ICSourceEntry[] addEntry(ICSourceEntry[] entries, ICSourceEntry sourceEntry, boolean removeProj) {
+ Set<ICSourceEntry> set = new HashSet<>();
+ for (ICSourceEntry entry : entries) {
+ if (removeProj && new Path(entry.getValue()).segmentCount() == 1)
continue;
- set.add(se);
+ set.add(entry);
}
- set.add(entry);
+ set.add(sourceEntry);
return set.toArray(new ICSourceEntry[set.size()]);
}

Back to the top