Webindex PageLoader null handling
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 38/100
Research direction
Start with PageLoader.updatePage, specifically the implementation shown in the issue, and the supplied PageLoaderTest. Run the null-page and empty-page tests to establish current behavior; done means null input is handled without dereferencing it while the existing empty-page IllegalArgumentException behavior remains covered.
Written by the indexing model from the issue text.
Description
webindex.data.fluo.PageLoader does not check for null inputs. When dereferencing the object to see if it is empty it doesn't first check to make sure the object exists. I wrote a simple test to show this below.
This is line 45 - 50 that shows why it happens
public static PageLoader updatePage(Page page) {
Preconditions.checkArgument(!page.isEmpty(), "Page cannot be empty");
PageLoader update = new PageLoader();
update.action = Action.UPDATE;
update.page = page;
return update;
}
package webindex.fluo;
import org.junit.Test;
import webindex.core.models.Page;
import webindex.data.fluo.PageLoader;
public class PageLoaderTest {
@Test
public void testNullPage() {
Page p = null;
PageLoader loader = PageLoader.updatePage(p);
}
@Test(expected = IllegalArgumentException.class)
public void testEmptyPageThrowsIllegalArgument() {
Page p = Page.EMPTY;
PageLoader loader = PageLoader.updatePage(p);
}
}
- Dominant language
- Java
- Stars
- 2
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/accumulo-fluo-examples
-
blocker
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Improve README Open
Difficulty 1/5 1-3 hours Newbie friendliness 42/100
All issues in apache/accumulo-fluo-examples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100