Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Werner Keil
    @keilw
    This is not subject to the API. Please check https://github.com/unitsofmeasurement/uom-domain/tree/master/retail, we might cover something similar there, units like CRATE were already started. Happy to use your help on that if you want to contribute.
    Chris Hennick
    @Pr0methean
    Hi! One of the complaints about JSR 275 was that it didn't integrate with
    JSR-310, which became the Java 8 date/time API
    In the next few days, I could create and pull-request methods for converting a java.time.Duration to Quantity<Time> and vice-versa, plus reference implementations. Do you folks agree this would be useful?
    Werner Keil
    @keilw
    Hi, JSR 310 was started long after 275 and took at least 3 more years after 275 was stopped (310 had been completely stalled at the time, so it played no role in the EC's decision to reject 275) before it was usable to Java SE 8. There is no API relevance by Java SE 8 or JSR 310, but please see https://gitter.im/unitsofmeasurement/uom-se and the respective implementation for Date/Time integration. It's all been done there already, using TemporalQuantity. So no PRs in the API project please, but if you want to help uom-se to improve the quantity.time package and its elements, please feel free to do so.
    Kyle Falconer
    @Kyle-Falconer

    Is there a reason Unit doesn't have a method that returns Q?
    Something like:

    public Q getUnit(){...}

    It would be helpful because we create Quantities and pass in some Unit type such as LITER (which is Q in this case) but there's no way to get LITER back out of Unit

    Werner Keil
    @keilw
    Because Q is not available at runtime. It's lost until Java allows reified types ;-/
    Werner Keil
    @keilw
    Looks odd. AbstractUnit already tries to return the actual type via reflection. I created a task unitsofmeasurement/indriya#8 in the new Indriya prototype.
    The constructor of BaseUnit has an additional argument Q, but I see no realistic way to pass that when constructing the class, nor to retrieve it later. Using the Class maybe, that's already done in other places like unit systems.
    Werner Keil
    @keilw
    JSR 385 was approved earlier this week: https://jcp.org/en/jsr/detail?id=385
    Thodoris Bais
    @thodorisbais
    Hello!
    it's the first try I try to clean install and I'm getting this failure:
    Fatal error compiling: invalid flag: --release
    Has anybody experienced it in the past? Or shall I indeed spend time on it cuz it should compile as is
    ?
    Thodoris Bais
    @thodorisbais
    (I have also not used any jdk>8 till now)
    Werner Keil
    @keilw
    Which JDK did you use here? It works with 9 and above but the API is backward compatible with at least Java 8 in V2.
    Thodoris Bais
    @thodorisbais
    That's what I also thought, that I should download jdk 9
    But in the oracle page I only see jdk 11 (when it comes to jdk downloads above 8). Am I left that behind? :P
    Thodoris Bais
    @thodorisbais
    It wasn't only my old JDK (8). After upgrading to JDK 11, I had to also update my IntelliJ to the latest (2018.2.5) in order to have a successful build. My tests are still failing, but I will investigate this further soon (probably not next weekend, since we have the Glbal Day of Coderetreat here in Utrecht :) )
    Daniel Dias
    @Daniel-Dos
    Hi ,
    How strange that. here in my is working good with JDK 11.
    Thodoris Bais
    @thodorisbais
    So, @Daniel-Dos , mvn clean install is running successfully for you?
    Daniel Dias
    @Daniel-Dos

    Hi @thodorisbais , sorry for delay in response.

    I forgot to update the unit-api jacoco, so it is not compiled with jdk11.

    Thodoris Bais
    @thodorisbais
    Hey Daniel, I'd like to help there, so that I can learn faster ;)
    is it just about updating the dependency's version
    ?
    Daniel Dias
    @Daniel-Dos
    You can still compile with mvn clean install, but you will have 1 or 2 unit tests failing.
    @thodorisbais yes, just update from 0.8.1 to 0.8.2 .
    in this you will find other issues with javadoc to update, same as the last PR of indriya.
    Thodoris Bais
    @thodorisbais
    @Daniel-Dos oh, you're right, no JVM issues at all after updating the dependency! I'll commit it right now like that, and then we can close #148 !
    Daniel Dias
    @Daniel-Dos
    wonderful : )
    Thodoris Bais
    @thodorisbais
    wow, it's great to see it green after quite a bit of struggle, I learned something today, thanks @Daniel-Dos !
    #149 ready!
    Daniel Dias
    @Daniel-Dos
    How wonderful, how good I was able to help. : )
    Thodoris Bais
    @thodorisbais
    All, could someone help me on my JCP membership? It's been pending for more than 2 months now
    I've also been in touch with the admin mail group of jcp, but they also stopped responding to my mails after some time
    Beau Tremblay
    @trembb01

    Hello, I'm trying to use this api to manage material quantities. I'm trying to parse string units from a DB to a Unit. Can someone advise? I tried this approach, but it seems the ServiceProvider needs to be configured with services. Is there an easier approach to identifying a unit? In this case, I'm assuming it's mass but it could also be a volume.

        private void parseMeasurement() {
            if (available > 0 && availableUnit != null) {
                try {
                    UnitFormat format = ServiceProvider.current().getFormatService().getUnitFormat();
                    Unit<?> unit = format.parse(availableUnit);
                    if (unit.getSystemUnit() instanceof Mass) {
                        Quantity<?> mass = Quantities.getQuantity(available,unit);
                        massAvailProperty().set(mass);
                    } else {
                        log.debug("Unexpected unit {} is not a Mass", unit.getName());
                    }
                } catch (MeasurementParseException e) {
                    log.debug("Can't parse unit",e);
                }
            }
        }

    Thanks

    Petar Tahchiev
    @ptahchiev
    Is there a bom that lists all dependencies and I can import it in my pom.xml?
    Petar Tahchiev
    @ptahchiev
    So uom-lib-jackson is 2.0.1 and it also brings systems-ucum 2.0.1 but all other deps are 2.0.2
    Werner Keil
    @keilw
    That doesn't really matter they are compatible with each other, but you may use the 2.1 versions of most libraries already.
    Werner Keil
    @keilw
    https://github.com/unitsofmeasurement/uom-demos/blob/master/pom.xml is the closest thing to a BOM. Beside that there's the Parent POM https://github.com/unitsofmeasurement/uom-parent also in version 2.1.