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.

2.0.0 Redesign branch discussion

See original GitHub issue

2.0.0 - Redesign

In this branch Recaf is being rewritten from the ground up. The main goals can be found on the 2.0.0 project board.

I’d like to hear any thoughts on what should go into this redesign. What functionality should be factored in to the core design? What use cases would you like to see covered?

Feel free to respond here or create new issues on this topic, I’d like to hear your opinions.


Temporary release binary 01/31/2020: recaf-2.0.0.jar.zip (remove .zip to run)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
andylizicommented, Jul 19, 2019

Use proper exception handling

https://github.com/Col-E/Recaf/blob/257783d54713d9cd352c19ad93a11cb79a5670ba/src/main/java/me/coley/recaf/util/Reflect.java#L26-L29

https://github.com/Col-E/Recaf/blob/257783d54713d9cd352c19ad93a11cb79a5670ba/src/main/java/me/coley/recaf/util/Parse.java#L18-L23

https://github.com/Col-E/Recaf/blob/257783d54713d9cd352c19ad93a11cb79a5670ba/src/main/java/me/coley/recaf/ui/FxAssembler.java#L378-L381

  1. Pass exceptions to a proper handler using throws, don’t just log it on the spot and do nothing. return null isn’t the answer to everything either.
  2. Prefer specific exceptions instead of catching generic Exceptions and Throwables everywhere.
  3. Only ignore exceptions when you’re 100% sure about how it would happen and it really is a good idea. And never silently swallow Exception or Throwable without anything indicates it happened or later it’ll be extremely confusing to debug anything in it for anyone except you (and even that’s true only if you hadn’t forget that there’s a catch-all-and-ignore here…)

Fix confusing and inconsistent utility classes

(Utility class as in “a stateless class or enum that’s used to group several utility methods together and cannot be instantiated”, not every class under the util package)

  1. Most of them are under me.coley.recaf.util package, but some of them are not. For example me.coley.recaf.bytecode.TypeUtil. And I guess AccessFlag counts as a utility class too?
  2. Some of their names end with “Util” but some of them are not. For example ScreenUtil and Lang. This causes difficulty deciding which class is designed to used as an instance (e.g. Pair and RollingList), and which class is designed to act as a group for static methods (e.g. Classpath and Clipboard).
  3. The grouping of utility methods are confusing. It’s hard to decide what method should goes into what utility class. Can’t find a good example for this but some of them definitely feel inconsistent.

Use method references when applicable

https://github.com/Col-E/Recaf/blob/257783d54713d9cd352c19ad93a11cb79a5670ba/src/main/java/me/coley/recaf/ui/FxWindow.java#L52-L56

Pros:

  1. Cleaner-looking code.
  2. javac will generate a synthetic bridge method for every lambda expression regardless of whether it can be folded to a method reference (therefor skipping the redundant bridge method). Manually fold it can result in:
    • lambda execution being (a little) faster (at least before JIT kicks in, then it should be the same)
    • reduce a tiny bit of code size. Recaf uses a LOT of lambdas, so as the saying goes “from small increments comes abundance” (or something like that. Not a native speaker.)

Cons:

  1. Sometimes a method reference could be less direct and harder to read than lambda expression. But this kind of circumstance is (IMO) rather rare.

Oh, and s -> s can be replaced with Function.identity().


Remove empty javadoc tags

https://github.com/Col-E/Recaf/blob/257783d54713d9cd352c19ad93a11cb79a5670ba/src/main/java/me/coley/recaf/Input.java#L534-L536

As the title says.

0reactions
Col-Ecommented, Aug 11, 2019

I must be careful about triggering IDE’s auto-reformatting when editing existing code

I used to be auto-format trigger-happy but have been training myself not to use it so often. I really hate how it handles streams and some certain line-wrapping cases.

Typically I only highlight specific blocks and auto-format that small portion.

Suggestion - enforce WhitespaceAround in checkstyle

I didn’t include it (and a few other settings) so far because I found working on a project with it to be very annoying. Small style differences like this aren’t that big of a deal to me so I thought it would just be an annoyance to anyone looking to contribute.

Now things like brace placement, tabs vs spaces, line length, etc. that’s different. The potential differences in style for those are significant enough to warrant checkstyle enforcement in my opinion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

can you still get achivments in beta branch 2.02?
I've got a couple of music packs installed, but I got all my other achievements with them installed as well under 2.0.0.
Read more >
Business Process Model and Notation (BPMN), Version 2.0
Thus, BPMN creates a standardized bridge for the gap between the business process design and process implementation. Another goal, but no less important, ......
Read more >
Openfire 4.0 (Draft for discussion) - Community Planning
Most of our bugfixes have also ended up on the 3.10 branch, where @Daryl ... Versioning 2.0.0, so once released we shouldn't change...
Read more >
GitLab: is there a way to assign a status/comment to a branch?
branch maintainer; short branch description (e.g. "started from rev 2.0.0, feature branch to implement i2c2 driver on custom hostboard X") ...
Read more >
Release notes | U.S. Web Design System (USWDS) - Digital.gov
This release is the second Sass Module release on the 3.0 Beta Branch. - Updating package structure - ⚠️ Starting with this Beta...
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