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

Clean up compiler warnings #275

Closed
wants to merge 21 commits into from

Conversation

kohlschuetter
Copy link
Contributor

My Eclipse IDE is full of liqp warnings, making it hard to see the actual problems. Let's clean these up a bit.

Clean up code in src/main/java

  • Infer generic parameters for Map, List, etc.
  • Cease use of deprecated Java API.
  • Suppress "unchecked", "hiding" warnings where appropriate.
  • Add missing serialVersionUID where necessary.
  • Use getRenderSettings()/getParseSettings() instead of deprecated access.
  • Remove unused class members.
  • Remove unused imports.

Clean up code in src/main/test

  • Replace deprecated org.junit.Assert.assertThat with org.hamcrest.MatcherAssert.assertThat.
  • Organize imports.
  • Replace HashMap subclass with Collections.singletonMap where possible.
  • Add SupressWarnings "unused", "deprecation", "serial" where appropriate.
  • DateTest: Add additional checks for vararg method.

This change is rebased upon #274 and https://github.com/bkiers/Liqp/pull/269/commits

msangel and others added 21 commits March 31, 2023 04:44
…e in it, counter should be moved in context (probably as registry)
Expose Filters and Insertions from a TemplateContext, and simplify
creating a new child context by adding a newChildContext() helper
method.
Infer generic parameters for Map, List, etc.
Cease use of deprecated Java API.
Suppress "unchecked", "hiding" warnings where appropriate.
Add missing serialVersionUID where necessary.
Use getRenderSettings()/getParseSettings() instead of deprecated access.
Remove unused class members.
Remove unused imports.
Replace deprecated org.junit.Assert.assertThat with org.hamcrest.MatcherAssert.assertThat.
Organize imports.
Replace HashMap subclass with Collections.singletonMap where possible.
Add SupressWarnings "unused", "deprecation", "serial" where appropriate.
DateTest: Add additional checks for vararg method.
@kohlschuetter kohlschuetter changed the title Ck/warnings cleanup1 Clean up compiler warnings Jun 27, 2023
@msangel msangel mentioned this pull request Jul 30, 2023
@msangel
Copy link
Collaborator

msangel commented Jul 30, 2023

Merged there: #280

@msangel msangel closed this Jul 30, 2023
@msangel
Copy link
Collaborator

msangel commented Jul 30, 2023

My opinions:

  • Infer generic parameters for Map, List, etc. ✔️
  • Cease use of deprecated Java API. ✔️
  • Suppress "unchecked", "hiding" warnings where appropriate. ✔️
  • Add missing serialVersionUID where necessary. ✔️ for adding, ❌ for generated (should be 1L )
  • Use getRenderSettings()/getParseSettings() instead of deprecated access. ✔️
  • Remove unused class members. ✔️
  • Remove unused imports. ✔️
  • Replace wildcard imports with explicit ❌
  • Static imports for variables ❌
  • Static imports for methods ✔️

Clean up code in src/main/test

  • Replace deprecated org.junit.Assert.assertThat with org.hamcrest.MatcherAssert.assertThat. ✔️
  • Organize imports. ✔️
  • Replace HashMap subclass with Collections.singletonMap where possible. ✔️
  • Add SupressWarnings "unused", "deprecation", "serial" where appropriate. ✔️
  • DateTest: Add additional checks for vararg method. ✔️

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