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.

PiranhaJava - Doesn't add required space while removing parentheses

See original GitHub issue

Piranha changed return(true); to returntrue;. This is sort of related to #35 - in the sense that PiranhaJava doesn’t validate the parens/spaces of the output generated.

This error probably would not have occured if the code had been Google Java formatted.

However, I thought I will bring it to your attention, since this is a case of Piranha introducing a “bug” instead of erring on the side of caution, like #35

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
msridharcommented, May 14, 2020

Thanks for the report! Seems like we should either fix this bug or document that we assume proper (GJF) formatting

0reactions
swayamrainacommented, Jun 23, 2020

agreed. But this isaue is valid when the app is passed through piranha multiple times.

on first pass, piranha reduces the feature flag in a method to a method that returns true (reducing to the above code) or false. on second pass, piranha resuces the above code to produce an output which produces compilation error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove parentheses, dashes, and spaces from phone number
This should work: String phNo = "(123) 456-7890".replaceAll("[()\\s-]+", "");. In your regex: \s should be \\s; Hyphen should be first or last in...
Read more >
space-in-parens - ESLint - Pluggable JavaScript Linter
This rule will enforce consistent spacing directly inside of parentheses, by disallowing or requiring one or more spaces to the right of (...
Read more >
Should I fully parenthesize expressions or rely on precedence ...
Good developers strive to write code that is clear and correct. Parentheses in conditionals, even if they are not strictly required, help with...
Read more >
User-defined types
If we add more data about the fish, or remove the data: ... the array, while struct variable is a name for a...
Read more >
Is a space between a function's name and the open ...
As Aryaman alludes to it's pretty common to not place a space between the function name and the parenthesis, if you want your...
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