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

Cleaning up warnings #14

Open
kjkrum opened this issue Jan 20, 2013 · 0 comments
Open

Cleaning up warnings #14

kjkrum opened this issue Jan 20, 2013 · 0 comments

Comments

@kjkrum
Copy link
Contributor

kjkrum commented Jan 20, 2013

There are 37 pieces of dead code, 4 unused local vars, and 59 Serializable classes with no serialVersionUID.

All but one of the dead code warnings is in the generated prefuse.data.expression.parser.ExpressionParser. They take the form of 'break' statements after 'return' statements or 'throw' statements after 'return' statements preceded by useless 'if(true)' conditions. I know very little about JavaCC, so I have no idea why it generated all this dead and useless code. I fixed it by hand in this commit: https://github.com/kjkrum/Prefuse/commit/59bb669d695f12c65930c08517bec9564a657a1e

I also added a default serialVersionUID to all Serializable classes: https://github.com/kjkrum/Prefuse/commit/64f2c97fac060af6d81fb41fcf2119791b1d1363

I was more cautious about fixing the unused local vars and the one remaining piece of dead code. I didn't want to just go in and remove them without understanding the author's intent, because the dead code may point to a bug. Only one of the unused local vars seemed to have an obvious intent: https://github.com/kjkrum/Prefuse/commit/b740787e59b0d88d01eab52586e4d8aa8b365b4a

I'd appreciate some help understanding the intention behind the remaining four.

prefuse.data.util.BreadthFirstIterator line 168: The increment part of the 'for' is dead code because the method always returns on the first iteration of loop.

prefuse.data.tree.Tree line 587: 'ncount' is incremented but never used.

prefuse.action.layout.StackedAreaChart line 261: 'sum' is incremented but never used.

prefuse.action.layout.graph.SquarifiedTreeMapLayout line 135: 'leafCount' is incremented but never used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant