JadiraOrg/jadira

Odd compilation issue leads to failure to call JavaMoney method

Closed this issue · 2 comments

This example snippet will throw a method not found exception in the fromNonNullValue method as it attempts to invoke MonetaryCurrencies.getCurrency(...).

However if I copy StringColumnCurrencyUnitMapper as it is and use my copy of the class instead it will work so I'm guessing there's something going on during the packaging. My environment: java 1.8.

import org.jadira.usertype.moneyandcurrency.moneta.columnmapper.StringColumnCurrencyUnitMapper;
import javax.money.MonetaryCurrencies;

public class FooBar {

    public static void main(String[] args)  {
        MonetaryCurrencies.getCurrency("USD"); // this works so class and method are in place

        // throws method not found exception
        new StringColumnCurrencyUnitMapper().fromNonNullValue("EUR"); 

    }

    }

build.gradle:

apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.8
version = '1.0'

repositories {
    mavenCentral()
}

dependencies {
    compile "org.javamoney:moneta:0.9"
    compile "org.jadira.usertype:usertype.extended:3.2.0.GA"
}

HEAD is being updated shortly to 1.0-RC3. If the issue remains, please advise