Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2012-05-04 05:14:06 -0400
committerMarkus Schorn2012-05-04 05:14:06 -0400
commitfefa6b2c297752503991dec6dd779c7be6e8ce56 (patch)
tree6ba2911faa62b39a08ace5b24545d54693ae8d25 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parentb562fc5469193079a98eb002580d428a5c1a3d26 (diff)
downloadorg.eclipse.cdt-fefa6b2c297752503991dec6dd779c7be6e8ce56.tar.gz
org.eclipse.cdt-fefa6b2c297752503991dec6dd779c7be6e8ce56.tar.xz
org.eclipse.cdt-fefa6b2c297752503991dec6dd779c7be6e8ce56.zip
Fix some compiler warnings, remove unused code.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
index 61c61b34c2..072c70f234 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
@@ -447,8 +447,11 @@ public class ChangeGenerator extends ASTVisitor {
while ((piece = clippedEdit(edit2, region)) != null) {
format.addChild(piece);
// The warning "The variable edit2 may be null at this location" is bogus.
- if (edit2.getExclusiveEnd() >= end || j >= formatEdits.length) {
- break;
+ // Make the compiler happy:
+ if (edit2 != null) {
+ if (edit2.getExclusiveEnd() >= end || j >= formatEdits.length) {
+ break;
+ }
}
edit2 = formatEdits[j++];
}
@@ -817,8 +820,7 @@ public class ChangeGenerator extends ASTVisitor {
siblings = parent.getChildren();
}
boolean beforeNode = false;
- for (int i = 0; i < siblings.length; i++) {
- IASTNode sibling = siblings[i];
+ for (IASTNode sibling : siblings) {
if (sibling == node) {
beforeNode = true;
} else if (beforeNode) {

Back to the top