question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EmptyPlaceHolder causes IndexOutOfBoundsException on MaterialListValueBox#getValue

See original GitHub issue

Selecting the very last item in the list and then calling MaterialListValueBox#getValue causes IndexOutOfBoundsException. This is because MaterialListValueBox#setEmptyPlaceHolder adds a new item into the list but does not add a new value into the array of the underlying model.

MaterialListValueBox#setEmptyPlaceHolder:

    public void setEmptyPlaceHolder(String value) {
        listBox.insertItem(value, 0);

        getOptionElement(0).setDisabled(true);
    }

I did not think this through at all, but maybe adding a null value at the 0-index of the underlying array could work? (Unless someone will beat me to it I shall look into it during this upcoming week.)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kevzlou7979commented, Jan 4, 2018

@jzaruba Can you please add a test case for any new features to avoid regressions in the future.

0reactions
jzarubacommented, Jan 4, 2018

@kevzlou7979 I did not consider this one a new feature, rather a bug-fix. (If you referred to #753 then ignore this comment.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to fix java.lang.IndexOutOfBoundsException
By executing this for loop , the loop will execute with a thrown exception as IndexOutOfBoundException cause, suppose list size is 10 ...
Read more >
toPandas() causes IndexOutOfBoundsException in Apache ...
Using DBR 10.0. When calling toPandas() the worker fails with IndexOutOfBoundsException. It seems like ArrowWriter.
Read more >
IndexOutOfBoundsException (Java Platform SE 8 )
Class IndexOutOfBoundsException​​ Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found