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

Target Java 8 for compilation #2672

Merged
merged 9 commits into from
Dec 31, 2020
Merged

Target Java 8 for compilation #2672

merged 9 commits into from
Dec 31, 2020

Conversation

jwgmeligmeyling
Copy link
Member

@jwgmeligmeyling jwgmeligmeyling commented Oct 26, 2020

Changelog

5.0.0

Breaking changes

  • Java 8 minimal requirement. If you still rely on Java <7, please use the latest 4.x.x version.
  • Removed bridge method that were in place for backwards compatibility of legacy API's. This may lead to some breaking API changes.

New features

  • Added Fetchable#stream() which returns a Stream<T>. Make sure that the returned stream is always closed to free up resources, for example using try-with-resources. It does not suffice to rely on a terminating operation on the stream for this (i.e. forEach, collect).

Dependency updates

  • cglib to 3.3.0 for Java 8+ support
  • asm to 9.0 for Java 8+ support
  • DataNucleus 5.2.x for Java 8+ support
    • JDO now uses org.datanucleus:javax.jdo instead of javax.jdo:jdo-api. Seems more widely used and also got more recently updated.

Plans

  • Require Java 8
  • Optimize code for Java 8 (use new API's)
  • Switch out Guava's Optional with Java 8's Optional.
  • Add Fetchable#stream
  • Add tests for Fetchable#stream (in particular Hibernate and plain JPA)

@@ -15,8 +15,8 @@
@Test
public void sum() throws Exception {
NumberPath<BigDecimal> num = Expressions.numberPath(BigDecimal.class, "num");
CollQuery<?> query = CollQueryFactory.from(num, Arrays.asList(new BigDecimal("1.6"), new BigDecimal("1.3")));
CollQuery<BigDecimal> query = CollQueryFactory.<BigDecimal> from(num, Arrays.<BigDecimal> asList(new BigDecimal("1.6"), new BigDecimal("1.3")));
Copy link
Member Author

@jwgmeligmeyling jwgmeligmeyling Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CollQueryFactory suffers from https://stackoverflow.com/a/32294457/2104280.

This is technically not a breaking API change: users that already were on Java 8, struggled with the exact same issue in their own codebase already.

@@ -48,17 +48,6 @@
</dependency>

<!-- backwards compatibility -->
<dependency>
<groupId>com.infradna.tool</groupId>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bridge-method-annotation is unmaintained and doesn't support Java 8 bytecode.

The bridge methods are also not needed anymore: its safe to remove backwards compatibility methods in a major release.

</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<version>3.8.1</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't causing issues, but I don't think it hurts to keep this up-to-date for the best compatiblility.

@@ -221,12 +223,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<version>3.3.0</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't causing issues, but I don't think it hurts to keep this up-to-date for the best compatiblility.

@jwgmeligmeyling jwgmeligmeyling added this to In progress in 5.x via automation Oct 26, 2020
@jwgmeligmeyling jwgmeligmeyling added this to the 5.0 milestone Oct 26, 2020
@jwgmeligmeyling jwgmeligmeyling self-assigned this Oct 26, 2020
@jwgmeligmeyling jwgmeligmeyling marked this pull request as ready for review December 31, 2020 14:24
@jwgmeligmeyling jwgmeligmeyling merged commit 9560e01 into master Dec 31, 2020
5.x automation moved this from In progress to Done Dec 31, 2020
@jwgmeligmeyling jwgmeligmeyling deleted the java-8 branch December 31, 2020 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5.x
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant