Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java14
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java10
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java33
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java7
4 files changed, 31 insertions, 33 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java
index 617f8f069..fee3349c4 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java
@@ -183,9 +183,9 @@ public class GenericFileBufferOperationRunner {
private IFileBuffer[] findSynchronizedFileBuffers(IFileBuffer[] fileBuffers) {
ArrayList<IFileBuffer> list= new ArrayList<>();
- for (int i= 0; i < fileBuffers.length; i++) {
- if (fileBuffers[i].isSynchronizationContextRequested())
- list.add(fileBuffers[i]);
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ if (fileBuffer.isSynchronizationContextRequested())
+ list.add(fileBuffer);
}
return list.toArray(new IFileBuffer[list.size()]);
}
@@ -220,8 +220,8 @@ public class GenericFileBufferOperationRunner {
private IFileBuffer[] findFileBuffersToSave(IFileBuffer[] fileBuffers) {
ArrayList<IFileBuffer> list= new ArrayList<>();
- for (int i= 0; i < fileBuffers.length; i++) {
- IFileBuffer buffer= fileBuffers[i];
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ IFileBuffer buffer= fileBuffer;
if (!buffer.isDirty())
list.add(buffer);
}
@@ -238,8 +238,8 @@ public class GenericFileBufferOperationRunner {
protected ISchedulingRule computeCommitRule(IFileBuffer[] fileBuffers) {
ArrayList<ISchedulingRule> list= new ArrayList<>();
- for (int i= 0; i < fileBuffers.length; i++) {
- ISchedulingRule rule= fileBuffers[i].computeCommitRule();
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ ISchedulingRule rule= fileBuffer.computeCommitRule();
if (rule != null)
list.add(rule);
}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
index 4e5e483f6..68e64fbdd 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
@@ -196,11 +196,11 @@ public class ExtensionsRegistry {
}
IConfigurationElement[] elements= extensionPoint.getConfigurationElements();
- for (int i= 0; i < elements.length; i++) {
+ for (IConfigurationElement element : elements) {
if (isContentTypeId)
- readContentType(childElementName, elements[i], descriptors);
+ readContentType(childElementName, element, descriptors);
else
- read(childElementName, elements[i], descriptors);
+ read(childElementName, element, descriptors);
}
}
@@ -453,8 +453,8 @@ public class ExtensionsRegistry {
*/
private IContentType[] computeBaseContentTypes(IContentType[] contentTypes) {
List<IContentType> baseTypes= new ArrayList<>();
- for (int i= 0; i < contentTypes.length; i++) {
- IContentType baseType= contentTypes[i].getBaseType();
+ for (IContentType contentType : contentTypes) {
+ IContentType baseType= contentType.getBaseType();
if (baseType != null)
baseTypes.add(baseType);
}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java
index 0f183eb5c..983ef5e03 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBufferManager.java
@@ -83,8 +83,8 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
IContentTypeManager manager= Platform.getContentTypeManager();
IContentType[] contentTypes= manager.findContentTypesFor(file.getName());
if (contentTypes != null && contentTypes.length > 0) {
- for (int i= 0; i < contentTypes.length; i++)
- if (contentTypes[i].isKindOf(TEXT_CONTENT_TYPE))
+ for (IContentType contentType : contentTypes)
+ if (contentType.isKindOf(TEXT_CONTENT_TYPE))
return true;
return false;
}
@@ -137,8 +137,7 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
final IDocumentSetupParticipant[] participants= ((ResourceExtensionRegistry)fRegistry).getDocumentSetupParticipants(file);
if (participants != null) {
- for (int i= 0; i < participants.length; i++) {
- final IDocumentSetupParticipant participant= participants[i];
+ for (final IDocumentSetupParticipant participant : participants) {
ISafeRunnable runnable= new ISafeRunnable() {
@Override
public void run() throws Exception {
@@ -237,8 +236,8 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
private IStatus validateEdit(IFileBuffer[] fileBuffers, Object computationContext) {
ArrayList<IFile> list= new ArrayList<>();
- for (int i= 0; i < fileBuffers.length; i++) {
- IFile file= getWorkspaceFile(fileBuffers[i]);
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ IFile file= getWorkspaceFile(fileBuffer);
if (file != null)
list.add(file);
}
@@ -257,27 +256,27 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
}
private void validationStateAboutToBeChanged(IFileBuffer[] fileBuffers) {
- for (int i= 0; i < fileBuffers.length; i++) {
- if (fileBuffers[i] instanceof IStateValidationSupport) {
- IStateValidationSupport support= (IStateValidationSupport) fileBuffers[i];
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ if (fileBuffer instanceof IStateValidationSupport) {
+ IStateValidationSupport support= (IStateValidationSupport) fileBuffer;
support.validationStateAboutToBeChanged();
}
}
}
private void validationStateChanged(IFileBuffer[] fileBuffers, boolean validationState, IStatus status) {
- for (int i= 0; i < fileBuffers.length; i++) {
- if (fileBuffers[i] instanceof IStateValidationSupport) {
- IStateValidationSupport support= (IStateValidationSupport) fileBuffers[i];
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ if (fileBuffer instanceof IStateValidationSupport) {
+ IStateValidationSupport support= (IStateValidationSupport) fileBuffer;
support.validationStateChanged(validationState, status);
}
}
}
private void validationStateChangedFailed(IFileBuffer[] fileBuffers) {
- for (int i= 0; i < fileBuffers.length; i++) {
- if (fileBuffers[i] instanceof IStateValidationSupport) {
- IStateValidationSupport support= (IStateValidationSupport) fileBuffers[i];
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ if (fileBuffer instanceof IStateValidationSupport) {
+ IStateValidationSupport support= (IStateValidationSupport) fileBuffer;
support.validationStateChangeFailed();
}
}
@@ -289,8 +288,8 @@ public class ResourceTextFileBufferManager extends TextFileBufferManager {
private ISchedulingRule computeValidateStateRule(IFileBuffer[] fileBuffers) {
ArrayList<IResource> list= new ArrayList<>();
- for (int i= 0; i < fileBuffers.length; i++) {
- IResource resource= getWorkspaceFile(fileBuffers[i]);
+ for (IFileBuffer fileBuffer : fileBuffers) {
+ IResource resource= getWorkspaceFile(fileBuffer);
if (resource != null)
list.add(resource);
}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
index 89c446b73..c307c3807 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
@@ -285,8 +285,8 @@ public class TextFileBufferManager implements ITextFileBufferManager {
IContentType[] contentTypes= manager.findContentTypesFor(fileStore.getName());
if (contentTypes != null && contentTypes.length > 0) {
- for (int i= 0; i < contentTypes.length; i++)
- if (contentTypes[i].isKindOf(TEXT_CONTENT_TYPE))
+ for (IContentType contentType : contentTypes)
+ if (contentType.isKindOf(TEXT_CONTENT_TYPE))
return true;
return false;
}
@@ -450,8 +450,7 @@ public class TextFileBufferManager implements ITextFileBufferManager {
final IDocumentSetupParticipant[] participants= fRegistry.getDocumentSetupParticipants(location, locationKind);
if (participants != null) {
- for (int i= 0; i < participants.length; i++) {
- final IDocumentSetupParticipant participant= participants[i];
+ for (final IDocumentSetupParticipant participant : participants) {
ISafeRunnable runnable= new ISafeRunnable() {
@Override
public void run() throws Exception {

Back to the top