Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0010429Openbravo ERPA. Platformpublic2009-08-28 18:092012-03-02 15:35
iperdomo 
guilleaer 
normalmajoralways
closedfixed 
202.6.28-gentoo-r5
2.50MP3 
3.0MP9 
Core
No
0010429: Data Package allows invalid Java package names
When you define a module with db artifacts (e.g. tables), you need to define the Java package name on 'Data Package' tab to be able to generate a Java class of that table. You can put invalid java package names like: org.openbravo.import

Note: import is a reserved word in Java
* Create a module
* Define a invalid java package name in the 'Data Package' tab, e.g. org.openbravo.import
* Create a table
* Export the module: ant export.database
The Java package name must be checked to ensure a valid package is register
Modularity, OB3-Reviewed
related to defect 00115202.50MP11 closed alostale It's possible create a column with reserved names of java 
? JavaIdentifierTest.java (633) 2009-08-31 10:05
https://issues.openbravo.com/file_download.php?file_id=1687&type=bug
Issue History
2009-08-28 18:09iperdomoNew Issue
2009-08-28 18:09iperdomoAssigned To => rafaroda
2009-08-31 08:14rafarodaAssigned Torafaroda => alostale
2009-08-31 08:14rafarodaStatusnew => scheduled
2009-08-31 08:14rafarodaTag Attached: Modularity
2009-08-31 10:05iperdomoFile Added: JavaIdentifierTest.java
2009-08-31 10:13iperdomoNote Added: 0019319
2009-12-16 09:31alostaleRelationship addedrelated to 0011520
2009-12-16 10:16alostaleNote Added: 0022852
2011-11-17 10:45alostaleTag Attached: OB3-Reviewed
2011-11-30 17:51iperdomoAssigned Toalostale => guilleaer
2011-12-02 11:49guilleaerNote Added: 0043693
2012-02-07 17:45hgbotCheckin
2012-02-07 17:45hgbotNote Added: 0044914
2012-02-07 17:45hgbotStatusscheduled => resolved
2012-02-07 17:45hgbotResolutionopen => fixed
2012-02-07 17:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8ec4eac1fac073150f9df35ad1411b11ac9c9cee [^]
2012-02-07 17:51alostaleNote Added: 0044917
2012-02-07 17:51alostaleStatusresolved => closed
2012-02-07 17:51alostaleFixed in Version => 3.0MP9
2012-02-09 10:44AugustoMauchNote Added: 0044949
2012-02-09 11:23AugustoMauchNote Added: 0044951
2012-03-02 15:35hudsonbotCheckin
2012-03-02 15:35hudsonbotNote Added: 0045770

Notes
(0019319)
iperdomo   
2009-08-31 10:13   
Attached you'll find a way to detect a valid java package name. I think that can be done with a callout.

Cheers,

Iván
(0022852)
alostale   
2009-12-16 10:16   
The same is applicable for ad_module.javapackage column
(0043693)
guilleaer   
2011-12-02 11:49   
Test plan:
1. In the module window try to create a new module with an invalid java package (e.g. org.openbravo.void) You should see an error.

2. In the tab "data package" of the module window try to add a new line with an invalid java package. You should see an error.

3. if you put a good java package in the two previous cases you should be able to continue filling the tab fields normally

No regressions detected.
(0044914)
hgbot   
2012-02-07 17:45   
Repository: erp/devel/pi
Changeset: 8ec4eac1fac073150f9df35ad1411b11ac9c9cee
Author: Guillermo Álvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Tue Feb 07 16:18:38 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8ec4eac1fac073150f9df35ad1411b11ac9c9cee [^]

Fixed issue 10429: Warning is shown if wrong java package is entered.

---
M src-db/database/sourcedata/AD_CALLOUT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
A src/org/openbravo/erpCommon/ad_callouts/JavaPackageChecker.java
---
(0044917)
alostale   
2012-02-07 17:51   
code review and verified on pi@561e6f569f2c
(0044949)
AugustoMauch   
2012-02-09 10:44   
Maybe the text of the new message could be improved.

The current text is: "The java package could cause problems. Try to fill the field with correct one. (E.g. "org.openbravo.example")".

What could cause problems is not the java package itself, but the java package name that has been entered.

Proposed message text: "The java package name entered is invalid. Please enter a valid java package name (e.g. "org.openbravo.example")
(0044951)
AugustoMauch   
2012-02-09 11:23   
My proposal is not correct, because Guillermo has told me that clients are allowed to enter an invalid java package name, so the message shown is a warning message, not an error.

Anyway, I still think it is a good idea to refer explicitly to the java package name.

New proposal: "The entered java package name seems invalid. Please try to enter a valid java package name if possible".
(0045770)
hudsonbot   
2012-03-02 15:35   
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/544d64e0c159 [^]

Maturity status: Test