Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||||||||||||||||||||||||||
| View Issue Details | |||||||||||||||||||||||||||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||||||||||||||||||||
| 0037943 | Openbravo ERP | A. Platform | public | 2018-02-15 18:55 | 2018-03-14 19:15 | ||||||||||||||||||||||||||||||||
| Reporter | caristu | ||||||||||||||||||||||||||||||||||||
| Assigned To | jarmendariz | ||||||||||||||||||||||||||||||||||||
| Priority | high | Severity | minor | Reproducibility | have not tried | ||||||||||||||||||||||||||||||||
| Status | closed | Resolution | fixed | ||||||||||||||||||||||||||||||||||
| Platform | OS | 5 | OS Version | ||||||||||||||||||||||||||||||||||
| Product Version | |||||||||||||||||||||||||||||||||||||
| Target Version | Fixed in Version | 3.0PR18Q2 | |||||||||||||||||||||||||||||||||||
| Merge Request Status | |||||||||||||||||||||||||||||||||||||
| Review Assigned To | caristu | ||||||||||||||||||||||||||||||||||||
| OBNetwork customer | No | ||||||||||||||||||||||||||||||||||||
| Web browser | |||||||||||||||||||||||||||||||||||||
| Modules | Core | ||||||||||||||||||||||||||||||||||||
| Support ticket | |||||||||||||||||||||||||||||||||||||
| Regression level | |||||||||||||||||||||||||||||||||||||
| Regression date | |||||||||||||||||||||||||||||||||||||
| Regression introduced in release | |||||||||||||||||||||||||||||||||||||
| Regression introduced by commit | |||||||||||||||||||||||||||||||||||||
| Triggers an Emergency Pack | No | ||||||||||||||||||||||||||||||||||||
| Summary | 0037943: JDK 9: remove [deprecation] newInstance() in Class warnings | ||||||||||||||||||||||||||||||||||||
| Description | When building Openbravo with JDK 9, several "[deprecation] newInstance() in Class" warnings appears: warning: [deprecation] newInstance() in Class has been deprecated Besides, it seems that is not a recommended practice to make use of this method. So, these warnings should be fixed by retrieving the instance from a constructor object. See [1] and [2]. This is a safe change as Class.newInstance() is more limited than Constructor.newInstance(): the first one can only invoke the zero-argument constructor, while the second one may invoke any constructor. So, in order to fix this issue we have just to: a) Replace calls to Class.newInstance() with Constructor.newInstance() without using any argument. b) Catch the new exception types that are thrown by Constructor.newInstance(): InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException. [1] https://docs.oracle.com/javase/9/docs/api/java/lang/Class.html [^] [2] https://docs.oracle.com/javase/tutorial/reflect/member/ctorInstance.html [^] | ||||||||||||||||||||||||||||||||||||
| Steps To Reproduce | 1. Build Openbravo with Java 9 -> Check warnings | ||||||||||||||||||||||||||||||||||||
| Proposed Solution | |||||||||||||||||||||||||||||||||||||
| Additional Information | |||||||||||||||||||||||||||||||||||||
| Tags | Approved | ||||||||||||||||||||||||||||||||||||
| Relationships |
| ||||||||||||||||||||||||||||||||||||
| Attached Files | https://issues.openbravo.com/file_download.php?file_id=11604&type=bug https://issues.openbravo.com/file_download.php?file_id=11620&type=bug | ||||||||||||||||||||||||||||||||||||
| Issue History | |||||||||||||||||||||||||||||||||||||
| Date Modified | Username | Field | Change | ||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | New Issue | |||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | Assigned To | => platform | ||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | OBNetwork customer | => No | ||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | Modules | => Core | ||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | Triggers an Emergency Pack | => No | ||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | Issue generated from | 0037942 | ||||||||||||||||||||||||||||||||||
| 2018-02-15 18:55 | caristu | Relationship added | related to 0037083 | ||||||||||||||||||||||||||||||||||
| 2018-02-15 19:04 | caristu | Description Updated | bug_revision_view_page.php?rev_id=16719#r16719 | ||||||||||||||||||||||||||||||||||
| 2018-02-16 09:19 | caristu | Summary | JDK: remove [deprecation] newInstance() in Class warnings => JDK 9: remove [deprecation] newInstance() in Class warnings | ||||||||||||||||||||||||||||||||||
| 2018-02-26 13:41 | caristu | Relationship added | related to 0038000 | ||||||||||||||||||||||||||||||||||
| 2018-02-26 13:51 | caristu | Description Updated | bug_revision_view_page.php?rev_id=16769#r16769 | ||||||||||||||||||||||||||||||||||
| 2018-02-26 13:51 | caristu | Description Updated | bug_revision_view_page.php?rev_id=16770#r16770 | ||||||||||||||||||||||||||||||||||
| 2018-02-26 13:52 | caristu | Description Updated | bug_revision_view_page.php?rev_id=16771#r16771 | ||||||||||||||||||||||||||||||||||
| 2018-02-26 18:22 | caristu | File Added: newInstanceRemovalFinal.diff | |||||||||||||||||||||||||||||||||||
| 2018-03-07 13:53 | jarmendariz | File Added: new-instance.patch | |||||||||||||||||||||||||||||||||||
| 2018-03-09 14:34 | jarmendariz | Relationship added | related to 0038095 | ||||||||||||||||||||||||||||||||||
| 2018-03-12 12:13 | jarmendariz | Assigned To | platform => jarmendariz | ||||||||||||||||||||||||||||||||||
| 2018-03-12 12:13 | alostale | Tag Attached: Approved | |||||||||||||||||||||||||||||||||||
| 2018-03-12 12:40 | jarmendariz | Status | new => scheduled | ||||||||||||||||||||||||||||||||||
| 2018-03-13 09:48 | hgbot | Checkin | |||||||||||||||||||||||||||||||||||
| 2018-03-13 09:48 | hgbot | Note Added: 0103178 | |||||||||||||||||||||||||||||||||||
| 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/pi/rev/d526512e5e96cb6c5acf77a8451b82f233e4dd0c [^] | ||||||||||||||||||||||||||||||||||
| 2018-03-13 09:50 | jarmendariz | Review Assigned To | => caristu | ||||||||||||||||||||||||||||||||||
| 2018-03-13 13:20 | jarmendariz | Relationship added | related to 0038115 | ||||||||||||||||||||||||||||||||||
| 2018-03-13 17:24 | hudsonbot | Checkin | |||||||||||||||||||||||||||||||||||
| 2018-03-13 17:24 | hudsonbot | Note Added: 0103216 | |||||||||||||||||||||||||||||||||||
| 2018-03-14 19:15 | caristu | Note Added: 0103251 | |||||||||||||||||||||||||||||||||||
| 2018-03-14 19:15 | caristu | Status | resolved => closed | ||||||||||||||||||||||||||||||||||
| 2018-03-14 19:15 | caristu | Fixed in Version | => 3.0PR18Q2 | ||||||||||||||||||||||||||||||||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||