1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Use jdk 5 for-each loop

Replace simple uses of Iterator with a corresponding for-loop. Also add
missing braces on loops as necessary.

Change-Id: I7e158278fd2042b527f76b100815cf385b79ea20
Signed-off-by: chammer <carsten.hammer@t-online.de>
This commit is contained in:
chammer 2019-11-22 14:49:25 +01:00
parent 3ba744c9c8
commit 6001af3797
11 changed files with 16 additions and 31 deletions

View file

@ -8,11 +8,10 @@
SPDX-License-Identifier: EPL-2.0
-->
<feature
id="org.eclipse.tm.terminal.feature"
label="%featureName"
version="4.5.100.qualifier"
version="4.5.200.qualifier"
provider-name="%providerName"
plugin="org.eclipse.tm.terminal.view.core"
license-feature="org.eclipse.license"

View file

@ -21,6 +21,7 @@
</parent>
<artifactId>org.eclipse.tm.terminal.feature</artifactId>
<version>4.5.200-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<properties>

View file

@ -8,11 +8,10 @@
SPDX-License-Identifier: EPL-2.0
-->
<feature
id="org.eclipse.tm.terminal.view.feature"
label="%featureName"
version="4.5.100.qualifier"
version="4.5.200.qualifier"
provider-name="%providerName"
plugin="org.eclipse.tm.terminal.view.core"
license-feature="org.eclipse.license"

View file

@ -21,6 +21,7 @@
</parent>
<artifactId>org.eclipse.tm.terminal.view.feature</artifactId>
<version>4.5.200-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<properties>

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.view.ui;singleton:=true
Bundle-Version: 4.5.102.qualifier
Bundle-Version: 4.5.200.qualifier
Bundle-Activator: org.eclipse.tm.terminal.view.ui.activator.UIPlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",

View file

@ -22,6 +22,6 @@
</parent>
<artifactId>org.eclipse.tm.terminal.view.ui</artifactId>
<version>4.5.102-SNAPSHOT</version>
<version>4.5.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -237,8 +237,8 @@ public class ConfigurationPanelControl implements IConfigurationPanelContainer,
Assert.isNotNull(parent);
if (configurationPanelKeys != null) {
for (int i = 0; i < configurationPanelKeys.length; i++) {
IConfigurationPanel configPanel = getConfigurationPanel(configurationPanelKeys[i]);
for (String configurationPanelKey : configurationPanelKeys) {
IConfigurationPanel configPanel = getConfigurationPanel(configurationPanelKey);
Assert.isNotNull(configPanel);
configPanel.setupPanel(parent);
}

View file

@ -47,9 +47,7 @@ public class NoteCompositeHelper {
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
Control[] childs = getChildren();
for (int iChild = 0; iChild < childs.length; iChild++) {
Control child = childs[iChild];
for (Control child : getChildren()) {
child.setEnabled(enabled);
}
}

View file

@ -234,11 +234,7 @@ public class ConsoleManager {
private IViewPart getTerminalsViewWithSecondaryId(String id, String secondaryId, boolean restore) {
Assert.isNotNull(id);
IWorkbenchPage page = getActiveWorkbenchPage();
IViewReference[] refs = page.getViewReferences();
for (int i = 0; i < refs.length; i++) {
IViewReference ref = refs[i];
for (IViewReference ref : getActiveWorkbenchPage().getViewReferences()) {
if (ref.getId().equals(id)) {
if (ANY_SECONDARY_ID.equals(secondaryId)
|| secondaryId == null && ref.getSecondaryId() == null
@ -289,13 +285,10 @@ public class ConsoleManager {
public String getNextTerminalSecondaryId(String id) {
Assert.isNotNull(id);
IWorkbenchPage page = getActiveWorkbenchPage();
Map<String, IViewReference> terminalViews = new HashMap<String, IViewReference>();
int maxNumber = 0;
IViewReference[] refs = page.getViewReferences();
for (int i = 0; i < refs.length; i++) {
IViewReference ref = refs[i];
for (IViewReference ref : getActiveWorkbenchPage().getViewReferences()) {
if (ref.getId().equals(id)) {
if (ref.getSecondaryId() != null) {
terminalViews.put(ref.getSecondaryId(), ref);
@ -533,9 +526,7 @@ public class ConsoleManager {
IWorkbenchPage page = getActiveWorkbenchPage();
if (page != null) {
IViewReference[] refs = page.getViewReferences();
for (int i = 0; i < refs.length; i++) {
IViewReference ref = refs[i];
for (IViewReference ref : page.getViewReferences()) {
IViewPart part = ref != null ? ref.getView(false) : null;
if (part instanceof ITerminalsView) {
CTabFolder tabFolder = (CTabFolder) part.getAdapter(CTabFolder.class);
@ -576,8 +567,7 @@ public class ConsoleManager {
IWorkbenchPage page = getActiveWorkbenchPage();
if (page != null) {
IViewReference[] refs = page.getViewReferences();
for (int i = 0; i < refs.length; i++) {
IViewReference ref = refs[i];
for (IViewReference ref : refs) {
if (ref.getId().equals(id)) {
IViewPart part = ref.getView(true);
if (part instanceof ITerminalsView) {

View file

@ -132,8 +132,7 @@ public abstract class AbstractExtendedConfigurationPanel extends AbstractConfigu
String[] hosts = settings.getArray(HOSTS_TAG);
if (hosts != null) {
for (int i = 0; i < hosts.length; i++) {
String hostEntry = hosts[i];
for (String hostEntry : hosts) {
String[] hostString = hostEntry.split("\\|");//$NON-NLS-1$
String hostName = hostString[0];
if (hostString.length == 2) {

View file

@ -42,7 +42,7 @@ public class TerminalService implements ITerminalService {
/**
* The registered terminal tab dispose listeners.
*/
private final ListenerList terminalTabListeners = new ListenerList();
private final ListenerList<ITerminalTabListener> terminalTabListeners = new ListenerList<ITerminalTabListener>();
// Flag to remember if the terminal view has been restored or not.
private boolean fRestoringView;
@ -120,10 +120,8 @@ public class TerminalService implements ITerminalService {
if (terminalTabListeners.isEmpty()) return;
// Get the list or currently registered listeners
Object[] l = terminalTabListeners.getListeners();
// Loop the registered terminal tab listeners and invoke the proper method
for (int i = 0; i < l.length; i++) {
final ITerminalTabListener listener = (ITerminalTabListener) l[i];
for (final ITerminalTabListener listener : terminalTabListeners) {
ISafeRunnable job = new ISafeRunnable() {
@Override
public void handleException(Throwable exception) {