aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Maksimczyk2014-01-24 16:16:24 (EST)
committerMarek Maksimczyk2014-01-24 16:19:37 (EST)
commitf6b22a9756e0ef9f04518d9172b25c3ac141d9ef (patch)
treefb65ba4d8a1f2120ed8014f97adbcb6aa81a7827
parent11a7448486c1740329092e204fdf0e46d895e450 (diff)
downloadorg.eclipse.pdt-f6b22a9756e0ef9f04518d9172b25c3ac141d9ef.zip
org.eclipse.pdt-f6b22a9756e0ef9f04518d9172b25c3ac141d9ef.tar.gz
org.eclipse.pdt-f6b22a9756e0ef9f04518d9172b25c3ac141d9ef.tar.bz2
Bugfix, ASTRewriteFlattener generated wrong result forrefs/changes/67/21067/1
InterfaceDeclaration ASTNode. It was always "extends" key word even there weren't any parent interfaces. Signed-off-by: Marek Maksimczyk <marek.maksimczyk@mandos.net.pl>
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteFlattener.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteFlattener.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteFlattener.java
index 7846432..1438eb5 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteFlattener.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/ast/rewrite/ASTRewriteFlattener.java
@@ -745,15 +745,18 @@ public class ASTRewriteFlattener extends AbstractVisitor {
public boolean visit(InterfaceDeclaration interfaceDeclaration) {
result.append("interface "); //$NON-NLS-1$
interfaceDeclaration.getName().accept(this);
- result.append(" extends "); //$NON-NLS-1$
- boolean isFirst = true;
- Identifier[] interfaces = interfaceDeclaration.getInterfaces();
- for (int i = 0; interfaces != null && i < interfaces.length; i++) {
- if (!isFirst) {
- result.append(", "); //$NON-NLS-1$
+ List<Identifier> interfaces;
+ if (interfaceDeclaration.interfaces().size() > 0) {
+ result.append(" extends "); //$NON-NLS-1$
+ boolean isFirst = true;
+ interfaces = interfaceDeclaration.interfaces();
+ for (Identifier interfaceItem : interfaces) {
+ if (!isFirst) {
+ result.append(", "); //$NON-NLS-1$
+ }
+ interfaceItem.accept(this);
+ isFirst = false;
}
- interfaces[i].accept(this);
- isFirst = false;
}
interfaceDeclaration.getBody().accept(this);
return false;