Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #890 #903

Merged
merged 3 commits into from
Mar 6, 2016
Merged

Fixed #890 #903

merged 3 commits into from
Mar 6, 2016

Conversation

oscargus
Copy link
Contributor

@oscargus oscargus commented Mar 4, 2016

This should fix #890

  • Change in CHANGELOG.md described?
  • Changes in pull request outlined? (What, why, ...)
  • Tests created for changes? Not relevant
  • Tests green?

@oscargus oscargus added bug Confirmed bugs or reports that are very likely to be bugs status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Mar 4, 2016
@simonharrer
Copy link
Contributor

👍

@tobiasdiez
Copy link
Member

I think the method

public String doLayout(BibEntry bibtex, BibDatabase database) {
        return doLayout(bibtex, database, null);
    }

in layout.java should be changed too.

And then there is

@Test
    public void testHighlightingInvalidParameter() {
        String content = "Test Word Content";

        TextArea ta = new TextArea("", content);

        //should not matter at all
        ta.highlightPattern(null);
    }

which also sets the highlightPattern to null...thus I would expect (i.e. add test for it) that an NPE is thrown.

Otherwise 👍

@oscargus
Copy link
Contributor Author

oscargus commented Mar 4, 2016

I think that is the method I changed. Is there another method (I searched, but rather quickly)?

Yes, the layout package could benefit from more testing...

@tobiasdiez
Copy link
Member

No you are right...you exactly changed the method I mentioned. My bad 😄.
What I meant in the second part is that setting the higlightPattern to null does not throw an exception (since the test pass) although I would have expected one. So probably a Objects.requireNonNull is missing somewhere.

@oscargus
Copy link
Contributor Author

oscargus commented Mar 4, 2016

But there is a corresponding method in LayoutEntry, which I think should be fixed as well.

Ah, OK! I'll have a look (or maybe the highlighter is never invoked in the test case?).

@oscargus
Copy link
Contributor Author

oscargus commented Mar 4, 2016

I fixed the other place as well, but happened to change to more use of switching... In the long term it would make sense to change the integers now used to an enumeration.

I also realized that all \n are stripped from the fields when doing a layout, so even though e.g. HTMLChars will convert the line breaks to something clever, they are not there anymore once the formatter is invoked... Not sure where they go missing though...

@tobiasdiez
Copy link
Member

👍

oscargus added a commit that referenced this pull request Mar 6, 2016
@oscargus oscargus merged commit 5b8d818 into master Mar 6, 2016
@oscargus oscargus deleted the fix890 branch March 8, 2016 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE when renaming a file
3 participants