Skip to content

Commit 0987f67

Browse files
committed
Clarify unneeded section.
1 parent 674cfe0 commit 0987f67

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

java/src/processing/mode/java/debug/VariableNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class VariableNode implements MutableTreeNode {
5656
public static final int TYPE_VOID = 11;
5757

5858
private static final Pattern ARRAY_REGEX = Pattern.compile(
59-
"^(?<prefix>[^\\]]+)(?<unbounded>(\\[\\])*)(?<bounded>(\\[\\d+\\])+).*$"
59+
"^(?<prefix>[^\\[]+)(?<unbounded>(\\[\\])*)(?<bounded>(\\[\\d+\\])+)(?<unneeded>[^\\[]*)$"
6060
);
6161

6262
protected String type;

java/test/processing/mode/java/debug/VariableNodeTests.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,16 @@ public void describeNestedArrayMixed() {
7474

7575
@Test
7676
public void describeArrayFailsafe() {
77-
Value value = buildMockValue("instance of int[x][7] (id=998)");
77+
Value value = buildMockValue("instance of int[x][7] (id=98)");
7878
VariableNode node = new VariableNode("test", "int[][][][]", value);
79-
Assert.assertEquals(node.getStringValue(), "instance of int[x][7] (id=998));
79+
Assert.assertEquals(node.getStringValue(), "instance of int[x][7] (id=98)");
80+
}
81+
82+
@Test
83+
public void describeArrayUnexpectedOrder() {
84+
Value value = buildMockValue("instance of int[7][] (id=98)");
85+
VariableNode node = new VariableNode("test", "int[][][][]", value);
86+
Assert.assertEquals(node.getStringValue(), "instance of int[7][] (id=98)");
8087
}
8188

8289
private Value buildMockValue(String toStringValue) {

0 commit comments

Comments
 (0)