Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038000
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. PlatformminorN/A2018-02-26 13:412018-03-14 19:17
ReportercaristuView Statuspublic 
Assigned Tojarmendariz 
PriorityhighResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revision8b986621e742
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0038000: API change for ExternalConnectionPool.getInstance(String) method due to [deprecation] newInstance() warning removal

DescriptionJDK 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 [^]
Steps To ReproduceIn description
Proposed SolutionReplace 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.
TagsApproved
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0037943 closedjarmendariz Openbravo ERP JDK 9: remove [deprecation] newInstance() in Class warnings 
related to defect 0038095 closedjarmendariz Modules Handle new Exceptions thrown by ExternalConnectionPool.getInstance 

-  Notes
(0103179)
hgbot (developer)
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 (developer)
2018-03-14 19:17

Verified

- Issue History
Date Modified Username Field Change
2018-02-26 13:41 caristu New Issue
2018-02-26 13:41 caristu Assigned To => platform
2018-02-26 13:41 caristu Modules => Core
2018-02-26 13:41 caristu Triggers an Emergency Pack => No
2018-02-26 13:41 caristu Relationship added related to 0037943
2018-02-26 13:42 caristu Description Updated View Revisions
2018-02-26 13:46 caristu Proposed Solution updated
2018-02-26 13:46 caristu Proposed Solution updated
2018-02-26 16:05 caristu Summary API 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:05 caristu Description Updated View Revisions
2018-02-26 16:05 caristu Description Updated View Revisions
2018-03-08 16:13 alostale Tag Attached: Approved
2018-03-13 09:45 jarmendariz Assigned To platform => jarmendariz
2018-03-13 09:45 jarmendariz Status new => scheduled
2018-03-13 09:48 hgbot Checkin
2018-03-13 09:48 hgbot Note Added: 0103179
2018-03-13 09:48 hgbot Status scheduled => resolved
2018-03-13 09:48 hgbot Resolution open => fixed
2018-03-13 09:48 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/api-checks/rev/8b986621e742c72b0b0c1483f7777728b6ea1c15 [^]
2018-03-13 09:50 jarmendariz Review Assigned To => caristu
2018-03-14 19:17 caristu Note Added: 0103252
2018-03-14 19:17 caristu Status resolved => closed
2018-03-14 19:17 caristu Fixed in Version => 3.0PR18Q2
2018-03-14 19:18 caristu Relationship added related to 0038095


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker