Return-Path: X-Original-To: apmail-zest-dev-archive@minotaur.apache.org Delivered-To: apmail-zest-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 853CD17EF5 for ; Fri, 10 Jul 2015 14:16:47 +0000 (UTC) Received: (qmail 83785 invoked by uid 500); 10 Jul 2015 14:16:47 -0000 Delivered-To: apmail-zest-dev-archive@zest.apache.org Received: (qmail 83745 invoked by uid 500); 10 Jul 2015 14:16:47 -0000 Mailing-List: contact dev-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list dev@zest.apache.org Received: (qmail 83729 invoked by uid 99); 10 Jul 2015 14:16:47 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jul 2015 14:16:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B51B2D3886 for ; Fri, 10 Jul 2015 14:16:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.001 X-Spam-Level: *** X-Spam-Status: No, score=3.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qA4CWl6gaNJK for ; Fri, 10 Jul 2015 14:16:38 +0000 (UTC) Received: from mail-ig0-f170.google.com (mail-ig0-f170.google.com [209.85.213.170]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 28B1420E40 for ; Fri, 10 Jul 2015 14:16:38 +0000 (UTC) Received: by igpy18 with SMTP id y18so13863094igp.0 for ; Fri, 10 Jul 2015 07:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=oIaoi3z3SsFzesaVTq+cvjOpj7hyO0wjzkI0jXEYcUc=; b=INT9q0NsjRvIFN5BMt/iWuXPOYTuSDb4la+J0cdBVSCWGqlgvZjPmyWvjjYGXYj0Nt iomzaXZjiJ6c6gRZDNZ1M+tHfs759T2zQ9hhQiuIwFzMdNbM/e99MsPLGc/3OEDjZ82K Z4JUfvYW2ExOOifMnaDrUdXmLT11tM/XREvVtDX0OpKYDgf9eH/x552pOcPlmdZByM+6 i49S4dF7zXG5W/BKjv//BZqChMkzQKwd8NLPpM2SuHD0l1mYQlFFeRimMXdPaclM0bX7 lFiv5jnydfEFKe40b4thPDedLqkYfSzV19YbP1wGvQ8a9k9N5qw3vNCubyrlIFBviGus cxOQ== X-Received: by 10.50.143.101 with SMTP id sd5mr3711414igb.44.1436537797664; Fri, 10 Jul 2015 07:16:37 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.36.98.18 with HTTP; Fri, 10 Jul 2015 07:16:18 -0700 (PDT) In-Reply-To: References: <559FCC8D.5020807@nosphere.org> From: Niclas Hedhman Date: Fri, 10 Jul 2015 17:16:18 +0300 X-Google-Sender-Auth: NgzgDhdG6Bu3O3hSsqu7Bm-iKl0 Message-ID: Subject: Re: Test Error found... To: dev Content-Type: multipart/alternative; boundary=001a1134bad022e81b051a860512 --001a1134bad022e81b051a860512 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable That was quick... single() also throw IllegalArgumentException on zero results. I added a atMostOne() method in Iterables. All this will be re-written in 3.0 and use Java 8 Function+Stream API. On Fri, Jul 10, 2015 at 5:09 PM, Niclas Hedhman wrote: > I am introducing a small fix (use single() instead of first(), catch > IllegalArgumentException and rethrow a AmbiguousTypeException), and the > output is > > org.qi4j.api.composite.AmbiguousTypeException: More than one model matche= s > the classname > org.qi4j.api.value.ValueSerialization:[OrgJsonValueSerializationService(a= ctive=3Dfalse,module=3D'Module > 1'), JacksonValueSerializationService(active=3Dfalse,module=3D'Module 1')= ] > > > for the case that I just detected. > > I am starting a local build to see what else fails and whether there is > concern for this change. Perhaps some way it is needed to ignore ambiguou= s > types in some usecase. > > > I'll report back later. > Niclas > > On Fri, Jul 10, 2015 at 4:56 PM, Niclas Hedhman > wrote: > >> So, the question is; SHOULD a AmbiguousTypeException be thrown when one >> is asking for a @Service injection of a composite type or >> ServiceReference? >> >> And I am pretty sure the exact same code is called if one calls >> ServiceFinder.findService(), and that would also throw the >> AmbiguousTypeException. >> >> >> Cheers >> Niclas >> >> On Fri, Jul 10, 2015 at 4:53 PM, Niclas Hedhman >> wrote: >> >>> And it is not done there... It takes, and instantiates, the first one. >>> Line 378 in TypeLookup >>> >>> On Fri, Jul 10, 2015 at 4:50 PM, Niclas Hedhman >>> wrote: >>> >>>> The findService() (single instance) should be checking ambiguity, wher= e >>>> as findServices() shouldn't. I am looking into that at the moment. >>>> >>>> On Fri, Jul 10, 2015 at 4:45 PM, Paul Merlin wrote= : >>>> >>>>> Good catch Niclas. >>>>> >>>>> No AmbiguousTypeException should be expected though. >>>>> >>>>> There is two services registered for the ValueSerialization type with >>>>> !=3D >>>>> identities, possibly different qualifiers etc... there's no type >>>>> ambiguity with multiple services of the same type. >>>>> >>>>> Think @Service Iterable inject; >>>>> >>>>> /Paul >>>>> >>>>> Niclas Hedhman a =C3=A9crit : >>>>> > EntityTestAssembler is the answer... which is invoked in the >>>>> > AbstractValueCompositeSerializationTest. >>>>> > >>>>> > I'll resolve that. Sorry for the noise. >>>>> > >>>>> > On Fri, Jul 10, 2015 at 4:31 PM, Niclas Hedhman >>>>> wrote: >>>>> > >>>>> >> So, the Module contains TWO ValueSerialization systems, both the >>>>> OrgJson >>>>> >> and the Jackson ones. >>>>> >> >>>>> >> That should then raise the question, Why don't we get >>>>> >> AmbigiousTypeException?? >>>>> >> >>>>> >> There are also a MemoryEntityStore and a UuidIdentityGenerator in >>>>> the >>>>> >> Module.... Where are those coming from? >>>>> >> >>>>> >> >>>>> >> Cheers >>>>> >> >>>>> >> On Fri, Jul 10, 2015 at 4:25 PM, Niclas Hedhman >>>> > >>>>> >> wrote: >>>>> >> >>>>> >>> I think I have found a Testcase problem, while trying to improve >>>>> the >>>>> >>> ValueSerialization subsystem. >>>>> >>> >>>>> >>> To show what I mean; >>>>> >>> >>>>> >>> a. Put a breakpoint on the first line in the only(!) test in >>>>> >>> AbstractValueCompositeSerializationTest >>>>> >>> >>>>> >>> b. Run the JacksonValueCompositeSerializationTest. >>>>> >>> >>>>> >>> c. At breakpoint, look at the this.valueSerialization member. >>>>> It has >>>>> >>> a ServiceComposite reference to the >>>>> OrgJsonValueSerializationService, >>>>> >>> not the Jackson one. >>>>> >>> >>>>> >>> >>>>> >>> I am trying to figure out how this is at all possible. >>>>> >>> >>>>> >>> >>>>> >>> Cheers >>>>> >>> -- >>>>> >>> Niclas Hedhman, Software Developer >>>>> >>> http://zest.apache.org - New Energy for Java >>>>> >>> >>>>> >> -- >>>>> >> Niclas Hedhman, Software Developer >>>>> >> http://zest.apache.org - New Energy for Java >>>>> >> >>>>> > >>>>> > >>>>> > >>>>> >>>> >>>> >>>> >>>> -- >>>> Niclas Hedhman, Software Developer >>>> http://zest.apache.org - New Energy for Java >>>> >>> >>> >>> >>> -- >>> Niclas Hedhman, Software Developer >>> http://zest.apache.org - New Energy for Java >>> >> >> >> >> -- >> Niclas Hedhman, Software Developer >> http://zest.apache.org - New Energy for Java >> > > > > -- > Niclas Hedhman, Software Developer > http://zest.apache.org - New Energy for Java > --=20 Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java --001a1134bad022e81b051a860512--