Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Piskarev2017-11-07 11:32:40 +0000
committerVladimir Piskarev2017-11-07 11:32:40 +0000
commita08168def310be497ba822909ca1a4c696bf4811 (patch)
tree11e234dc8bf3dc14cc27c14f11ee871836e83f04
parent743b6cfd21ffe8946708d43e6e50482797899275 (diff)
downloadorg.eclipse.handly-a08168def310be497ba822909ca1a4c696bf4811.tar.gz
org.eclipse.handly-a08168def310be497ba822909ca1a4c696bf4811.tar.xz
org.eclipse.handly-a08168def310be497ba822909ca1a4c696bf4811.zip
Bug 526929 - Remove Body.NO_CHILDREN
-rw-r--r--org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooFileStructureBuilder.java3
-rw-r--r--org.eclipse.handly/src/org/eclipse/handly/model/ElementDeltas.java2
-rw-r--r--org.eclipse.handly/src/org/eclipse/handly/model/Elements.java2
-rw-r--r--org.eclipse.handly/src/org/eclipse/handly/model/impl/support/Body.java8
4 files changed, 6 insertions, 9 deletions
diff --git a/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooFileStructureBuilder.java b/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooFileStructureBuilder.java
index fef0f7bc..8c0045ff 100644
--- a/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooFileStructureBuilder.java
+++ b/org.eclipse.handly.examples.basic.ui/src/org/eclipse/handly/internal/examples/basic/ui/model/FooFileStructureBuilder.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.handly.examples.basic.foo.Def;
import org.eclipse.handly.examples.basic.foo.Module;
import org.eclipse.handly.examples.basic.foo.Var;
+import org.eclipse.handly.model.Elements;
import org.eclipse.handly.model.IElement;
import org.eclipse.handly.model.impl.support.Body;
import org.eclipse.handly.model.impl.support.SourceElementBody;
@@ -88,7 +89,7 @@ class FooFileStructureBuilder
monitor.worked(1);
}
body.setChildren(helper.popChildren(body).toArray(
- Body.NO_CHILDREN));
+ Elements.EMPTY_ARRAY));
}
finally
{
diff --git a/org.eclipse.handly/src/org/eclipse/handly/model/ElementDeltas.java b/org.eclipse.handly/src/org/eclipse/handly/model/ElementDeltas.java
index 971db1ef..286aa888 100644
--- a/org.eclipse.handly/src/org/eclipse/handly/model/ElementDeltas.java
+++ b/org.eclipse.handly/src/org/eclipse/handly/model/ElementDeltas.java
@@ -58,7 +58,7 @@ import org.eclipse.handly.model.impl.IElementDeltaImpl;
public class ElementDeltas
{
/**
- * Zero length array of runtime type {@link IElementDelta}.
+ * A zero-length array of the runtime type <code>IElementDelta[]</code>.
*/
public static final IElementDelta[] EMPTY_ARRAY = new IElementDelta[0];
diff --git a/org.eclipse.handly/src/org/eclipse/handly/model/Elements.java b/org.eclipse.handly/src/org/eclipse/handly/model/Elements.java
index e235806c..677cbf07 100644
--- a/org.eclipse.handly/src/org/eclipse/handly/model/Elements.java
+++ b/org.eclipse.handly/src/org/eclipse/handly/model/Elements.java
@@ -63,7 +63,7 @@ import org.eclipse.handly.util.TextRange;
public class Elements
{
/**
- * Zero length array of runtime type {@link IElement}.
+ * A zero-length array of the runtime type <code>IElement[]</code>.
*/
public static final IElement[] EMPTY_ARRAY = new IElement[0];
diff --git a/org.eclipse.handly/src/org/eclipse/handly/model/impl/support/Body.java b/org.eclipse.handly/src/org/eclipse/handly/model/impl/support/Body.java
index a44606f5..e75128b0 100644
--- a/org.eclipse.handly/src/org/eclipse/handly/model/impl/support/Body.java
+++ b/org.eclipse.handly/src/org/eclipse/handly/model/impl/support/Body.java
@@ -13,6 +13,7 @@ package org.eclipse.handly.model.impl.support;
import java.lang.reflect.Array;
+import org.eclipse.handly.model.Elements;
import org.eclipse.handly.model.IElement;
/**
@@ -32,16 +33,11 @@ import org.eclipse.handly.model.IElement;
*/
public class Body
{
- /**
- * A zero-length array of the runtime type <code>IElement[]</code>.
- */
- public static final IElement[] NO_CHILDREN = new IElement[0];
-
/*
* Handles of immediate children of the element.
* This is an empty array if the element has no children.
*/
- private volatile IElement[] children = NO_CHILDREN;
+ private volatile IElement[] children = Elements.EMPTY_ARRAY;
/**
* Returns the immediate children of the element.

Back to the top