Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038787Openbravo ERPA. Platformpublic2018-06-19 09:162018-06-25 18:14
alostale 
alostale 
immediatemajorhave not tried
closedfixed 
5
 
3.0PR18Q3 
AugustoMauch
Core
Automated tests
2018-06-14
pi
https://code.openbravo.com/erp/devel/pi/rev/5d06f2cf366feb9538344ba2405a00fee9b4c141 [^]
No
0038787: tests fail to compile with JDK10+
Using JDK10+ test fail to compile in command line, tested with OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1) and jdk11ea18. It is working fine with JDK 7, 8 and 9. When compiling from Eclipse it is also working properly.

The problem seems to be related with generics in org.hamcrest.CoreMatchers.anyOf, being this part of a compiled jar, might it be a byte-code incompatibility?
1. With JDK10+
2. run ant compile.test
  ERROR:
 compile.test:
    [mkdir] Created dir: /srv/ci/workspace/try-full-pgsql/src-test/build/classes
    [javac] Compiling 548 source files to /srv/ci/workspace/try-full-pgsql/src-test/build/classes
    [javac] /srv/ci/workspace/try-full-pgsql/src-test/src/org/openbravo/test/security/WritableReadableOrganizationClientTest.java:201: error: no suitable method found for assertThat(String,List<String>,Matcher<Iterable<? super Object>>)
    [javac] assertThat("Role should not be able to read any US organization", readableOrgs,
    [javac] ^
    [javac] method Assert.<T#1>assertThat(String,T#1,Matcher<? super T#1>) is not applicable
    [javac] (inference variable T#2 has incompatible bounds
    [javac] upper bounds: String,Object
    [javac] lower bounds: CAP#1,CAP#2,CAP#3,Object,String,CAP#4)
    [javac] method Assert.<T#3>assertThat(T#3,Matcher<? super T#3>) is not applicable
    [javac] (cannot infer type-variable(s) T#3
    [javac] (actual and formal argument lists differ in length))
    [javac] where T#1,T#2,T#3 are type-variables:
    [javac] T#1 extends Object declared in method <T#1>assertThat(String,T#1,Matcher<? super T#1>)
    [javac] T#2 extends Object declared in method <T#2>hasItem(T#2)
    [javac] T#3 extends Object declared in method <T#3>assertThat(T#3,Matcher<? super T#3>)
    [javac] where CAP#1,CAP#2,CAP#3,CAP#4 are fresh type-variables:
    [javac] CAP#1 extends Object super: T#2? from capture of ? super T#2?
    [javac] CAP#2 extends Object super: Object from capture of ? super Object
    [javac] CAP#3 extends Object super: Object from capture of ? super Object
    [javac] CAP#4 extends Object super: T#2? from capture of ? super T#2?
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 error

BUILD FAILED
/srv/ci/workspace/try-full-pgsql/build.xml:589: The following error occurred while executing this line:
/srv/ci/workspace/try-full-pgsql/src-test/build.xml:63: Compile failed; see the compiler error output for details.
No tags attached.
caused by defect 0038761 closed alostale having write access to a parent and one of its children orgs, sometimes it's not possible to read siblings of child one 
Issue History
2018-06-19 09:16alostaleNew Issue
2018-06-19 09:16alostaleAssigned To => alostale
2018-06-19 09:16alostaleModules => Core
2018-06-19 09:16alostaleRegression level => Automated tests
2018-06-19 09:16alostaleRegression date => 2018-06-14
2018-06-19 09:16alostaleRegression introduced in release => pi
2018-06-19 09:16alostaleRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/5d06f2cf366feb9538344ba2405a00fee9b4c141 [^]
2018-06-19 09:16alostaleTriggers an Emergency Pack => No
2018-06-19 09:17alostaleRelationship addedcaused by 0038761
2018-06-19 09:19alostaleReview Assigned To => AugustoMauch
2018-06-19 09:20hgbotCheckin
2018-06-19 09:20hgbotNote Added: 0105208
2018-06-19 09:20hgbotStatusnew => resolved
2018-06-19 09:20hgbotResolutionopen => fixed
2018-06-19 09:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fead1878df420f23a5fb005e6a1034ab708366aa [^]
2018-06-19 13:24hudsonbotCheckin
2018-06-19 13:24hudsonbotNote Added: 0105241
2018-06-19 16:40alostaleNote Added: 0105261
2018-06-25 18:14AugustoMauchNote Added: 0105367
2018-06-25 18:14AugustoMauchStatusresolved => closed
2018-06-25 18:14AugustoMauchFixed in Version => 3.0PR18Q3

Notes
(0105208)
hgbot   
2018-06-19 09:20   
Repository: erp/devel/pi
Changeset: fead1878df420f23a5fb005e6a1034ab708366aa
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jun 19 08:58:47 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fead1878df420f23a5fb005e6a1034ab708366aa [^]

fixed bug 38787: tests fail to compile with JDK10+

  org.hamcrest.CoreMatchers.anyOf was failing when compiling in JDK10+ due to
  generics handling. Although root cause of the problem is still unknown, replacing
  anyOf with allOf works. So the test using it has been changed for it.

---
M src-test/src/org/openbravo/test/security/WritableReadableOrganizationClientTest.java
---
(0105241)
hudsonbot   
2018-06-19 13:24   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/dd1f20cf33f6 [^]
Maturity status: Test
(0105261)
alostale   
2018-06-19 16:40   
Asked in SO to understand root cause [1]

[1] https://stackoverflow.com/questions/50928300/generics-behavior-differs-in-jdk-8-and-9 [^]
(0105367)
AugustoMauch   
2018-06-25 18:14   
Code reviewed and verified