Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038000Openbravo ERPA. Platformpublic2018-02-26 13:412018-03-14 19:17
caristu 
jarmendariz 
highminorN/A
closedfixed 
5
 
3.0PR18Q2 
caristu
Core
No
0038000: API change for ExternalConnectionPool.getInstance(String) method due to [deprecation] newInstance() warning removal
JDK 9 deprecates clazz.newInstance() method[1]. This is because this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler.

To avoid this problem, this call can be replaced by clazz.getDeclaredConstructor().newInstance(). This sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException.

Apply this internal replacement (see issue 0037943) in the getInstance(String) method of the ExternalConnectionPool class, forces to declare the thrown of this two exception types in this method declaration, which is an API change.

[1] https://docs.oracle.com/javase/9/docs/api/java/lang/Class.html [^]
In description
Replace current declaration:

public final synchronized static ExternalConnectionPool getInstance(
       String externalConnectionPoolClassName) throws InstantiationException,
      IllegalAccessException, ClassNotFoundException {
...

With just:

public static final synchronized ExternalConnectionPool getInstance(
      String externalConnectionPoolClassName) throws ReflectiveOperationException {
...

as ReflectiveOperationException is a superclass for all the exceptions we can possible throw with this method.
Approved
related to defect 0037943 closed jarmendariz Openbravo ERP JDK 9: remove [deprecation] newInstance() in Class warnings 
related to defect 0038095 closed jarmendariz Modules Handle new Exceptions thrown by ExternalConnectionPool.getInstance 
Issue History
2018-02-26 13:41caristuNew Issue
2018-02-26 13:41caristuAssigned To => platform
2018-02-26 13:41caristuModules => Core
2018-02-26 13:41caristuTriggers an Emergency Pack => No
2018-02-26 13:41caristuRelationship addedrelated to 0037943
2018-02-26 13:42caristuDescription Updatedbug_revision_view_page.php?rev_id=16768#r16768
2018-02-26 13:46caristuProposed Solution updated
2018-02-26 13:46caristuProposed Solution updated
2018-02-26 16:05caristuSummaryAPI change for ExternalConnectionPool.getInstance() method due to [deprecation] newInstance() warning removal => API change for ExternalConnectionPool.getInstance(String) method due to [deprecation] newInstance() warning removal
2018-02-26 16:05caristuDescription Updatedbug_revision_view_page.php?rev_id=16774#r16774
2018-02-26 16:05caristuDescription Updatedbug_revision_view_page.php?rev_id=16775#r16775
2018-03-08 16:13alostaleTag Attached: Approved
2018-03-13 09:45jarmendarizAssigned Toplatform => jarmendariz
2018-03-13 09:45jarmendarizStatusnew => scheduled
2018-03-13 09:48hgbotCheckin
2018-03-13 09:48hgbotNote Added: 0103179
2018-03-13 09:48hgbotStatusscheduled => resolved
2018-03-13 09:48hgbotResolutionopen => fixed
2018-03-13 09:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/api-checks/rev/8b986621e742c72b0b0c1483f7777728b6ea1c15 [^]
2018-03-13 09:50jarmendarizReview Assigned To => caristu
2018-03-14 19:17caristuNote Added: 0103252
2018-03-14 19:17caristuStatusresolved => closed
2018-03-14 19:17caristuFixed in Version => 3.0PR18Q2
2018-03-14 19:18caristuRelationship addedrelated to 0038095

Notes
(0103179)
hgbot   
2018-03-13 09:48   
Repository: erp/devel/api-checks
Changeset: 8b986621e742c72b0b0c1483f7777728b6ea1c15
Author: Javier Armendáriz <javier.armendariz <at> openbravo.com>
Date: Tue Mar 13 09:47:00 2018 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/8b986621e742c72b0b0c1483f7777728b6ea1c15 [^]

Fixes issue 38000: Handle new Exception thrown by newInstance method

---
M java/reference/java.japi.gz
---
(0103252)
caristu   
2018-03-14 19:17   
Verified