`default` interface methods in JDK8 are overriden #94

Closed
caarlos0 opened this Issue Sep 10, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@caarlos0

If I use an interface like this:

public interface AWSConfig extends Config {
  @Key("aws.bucketname")
  String bucketname();

  default Region region() {
    return Region.getRegion( Regions.fromName( regionName() ) );
  }
}

The region method is overridden by Owner, and always return null.

@lviggiano

This comment has been minimized.

Show comment
Hide comment
@lviggiano

lviggiano Sep 11, 2014

Owner

Thanks.

I'm going to address this and do a maintenance release asap.

Owner

lviggiano commented Sep 11, 2014

Thanks.

I'm going to address this and do a maintenance release asap.

@caarlos0

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 Sep 11, 2014

nice, thanks!

nice, thanks!

@lviggiano

This comment has been minimized.

Show comment
Hide comment
@lviggiano

lviggiano Oct 15, 2014

Owner

Did some research on how to call default methods, without compromising backward (jdk < 1.8) compatibility: http://rmannibucau.wordpress.com/2014/03/27/java-8-default-interface-methods-and-jdk-dynamic-proxies/

Owner

lviggiano commented Oct 15, 2014

Did some research on how to call default methods, without compromising backward (jdk < 1.8) compatibility: http://rmannibucau.wordpress.com/2014/03/27/java-8-default-interface-methods-and-jdk-dynamic-proxies/

@lviggiano

This comment has been minimized.

Show comment
Hide comment
@lviggiano

lviggiano Oct 21, 2014

Owner

committed on master branch a new module called owner-java8. To compile it, you need JDK 8. To use it, you need to declare a maven dependency to it:

<dependencies>
        <dependency>
            <groupId>org.aeonbits.owner</groupId>
            <artifactId>owner-java8</artifactId>
            <version>1.0.6-SNAPSHOT</version>
        </dependency>
</dependencies>

owner-java8 has a transitive dependency to the artifact owner, so you don't need to specify both in your maven dependencies.

I'll release this asap. For now you can find the implementation on master branch. See Building from sources if you want to test this before the official release.

Owner

lviggiano commented Oct 21, 2014

committed on master branch a new module called owner-java8. To compile it, you need JDK 8. To use it, you need to declare a maven dependency to it:

<dependencies>
        <dependency>
            <groupId>org.aeonbits.owner</groupId>
            <artifactId>owner-java8</artifactId>
            <version>1.0.6-SNAPSHOT</version>
        </dependency>
</dependencies>

owner-java8 has a transitive dependency to the artifact owner, so you don't need to specify both in your maven dependencies.

I'll release this asap. For now you can find the implementation on master branch. See Building from sources if you want to test this before the official release.

@caarlos0

This comment has been minimized.

Show comment
Hide comment
@caarlos0

caarlos0 Oct 21, 2014

NICE!

Please let us know when the new version is maven central!

Cheers!

NICE!

Please let us know when the new version is maven central!

Cheers!

@velo

This comment has been minimized.

Show comment
Hide comment
@velo

velo Oct 21, 2014

glorious!

velo commented Oct 21, 2014

glorious!

@lviggiano

This comment has been minimized.

Show comment
Hide comment
@lviggiano

lviggiano Oct 22, 2014

Owner

I need to write some documentation on this, then I'll release a new minor release on maven central repo.

Owner

lviggiano commented Oct 22, 2014

I need to write some documentation on this, then I'll release a new minor release on maven central repo.

@lviggiano lviggiano added the resolved label Oct 23, 2014

@lviggiano lviggiano closed this Nov 18, 2014

@lviggiano

This comment has been minimized.

Show comment
Hide comment
@lviggiano

lviggiano Nov 19, 2014

Owner

Sorry for the long delay, owner-1.0.6 is available with this fix/enhancement on maven central repository.

Owner

lviggiano commented Nov 19, 2014

Sorry for the long delay, owner-1.0.6 is available with this fix/enhancement on maven central repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment