pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/commonmark/commonmark-java/pull/425

https://github.githubassets.com/assets/actions-902e75f4f51a80db.css" /> Clean ups by miasma · Pull Request #425 · commonmark/commonmark-java · GitHub
Skip to content

Clean ups#425

Open
miasma wants to merge 12 commits intocommonmark:mainfrom
miasma:clean-ups
Open

Clean ups#425
miasma wants to merge 12 commits intocommonmark:mainfrom
miasma:clean-ups

Conversation

@miasma
Copy link
Copy Markdown

@miasma miasma commented Apr 1, 2026

I've analyzed the code with IntelliJ's inspections and applied a couple of common refactorings.

  • redundant overrides add bloat and don't have any functional effect
  • redundant variable is used as return value and can be inlined
  • redundant label does not improve readability when there is only one label
  • nested classes with static operate more efficiently
  • method references are potentially more efficient and more readable than anonymous classes
  • refactored API calls document the intent better (and can be used since the pom.xml defaults to jdk11)
  • redundant imports slow down build process

@robinst
Copy link
Copy Markdown
Collaborator

robinst commented Apr 10, 2026

Hey! Thanks for raising this. It currently doesn't pass the Android compat build:

/home/runner/work/commonmark-java/commonmark-java/commonmark/src/main/java/org/commonmark/internal/LinkReferenceDefinitionParser.java:106: error: cannot find symbol
> Task :app:compileDebugJavaWithJavac
        var removedSpans = List.copyOf(sourceSpans.subList(Math.max(sourceSpans.size() - lines, 0), sourceSpans.size()));
                               ^
  symbol:   method copyOf(List<SourceSpan>)
  location: interface List

Can you undo that particular change?

@robinst
Copy link
Copy Markdown
Collaborator

robinst commented Apr 23, 2026

@miasma ^?

@miasma
Copy link
Copy Markdown
Author

miasma commented Apr 24, 2026

@robinst Hi, sorry, was a bit busy for the last 2 weeks. I updated the branch and deleted that problematic commit. I wasn't sure which API level of Android is supported so it's maybe better to leave out those API changes for now.

@miasma
Copy link
Copy Markdown
Author

miasma commented Apr 29, 2026

I don't think I have any additions to this anymore.

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

Successfully merging this pull request may close these issues.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy