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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0044131
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] External Integration Infrastructureminorhave not tried2020-05-21 11:242020-05-21 16:21
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision03f304a8c9c1
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned Tocaristu
Regression introduced in release
Summary

0044131: Remove unneeded generic method in ImportedBaseOBObjectFetcher, it results in unchecked warning

DescriptionThe current definition of the ImportedBaseOBObjectFetcher.fetch method is the following:

  public <T extends BaseOBObject> T fetch(SynchronizableBusinessObject item);

When implemented, an unchecked SuppressWarnings annotation needs to be added:

...
  @SuppressWarnings("unchecked")
  @Override
  public CharacteristicValue fetch(SynchronizableBusinessObject item) {
...

But, when compiling and showing the unchecked errors, a warning is still being logged:
CharacteristicValueBaseOBObjectFetcher.java:34: warning: [unchecked] fetch(SynchronizableBusinessObject) in CharacteristicValueBaseOBObjectFetcher implements <T>fetch(SynchronizableBusinessObject) in ImportedBaseOBObjectFetcher
    [javac] public CharacteristicValue fetch(SynchronizableBusinessObject item) {
    [javac] ^
    [javac] return type requires unchecked conversion from CharacteristicValue to T
    [javac] where T is a type-variable:
    [javac] T extends BaseOBObject declared in method <T>fetch(SynchronizableBusinessObject)

We can just make the fetch method not generic, since generics is not giving any extra value in that method.
Steps To ReproduceIn an environment where the org.openbravo.service.external.integration is installed:
- Create a class that extends the ImportedBaseOBObjectFetcher. A dummy one is enough, it is not going to be executed, we can focus on how it is compiled.
- Notice that you need to add a @SuppressWarnings("unchecked") annotation, otherwise there will be an eclipse warning.
- Apply the attached diff in the Openbravo root folder. It will show all the unchecked errors when compiling.
- Run compile.complete.deploy and check that the warning described in the description is logged
Proposed SolutionReplace this:

  public <T extends BaseOBObject> T fetch(SynchronizableBusinessObject item);

With:

  public BaseOBObject fetch(SynchronizableBusinessObject item);
TagsNo tags attached.
Attached Files? file icon showUncheckedWarnings.dif [^] (831 bytes) 2020-05-21 11:24

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0120116)
hgbot (developer)
2020-05-21 11:30

Repository: erp/pmods/org.openbravo.service.external.integration
Changeset: 03f304a8c9c16788a4b5b1ad5128c30cb9c5c350
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 21 11:29:53 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration/rev/03f304a8c9c16788a4b5b1ad5128c30cb9c5c350 [^]

Fixes ISSUE-44131: Removes generics from method to prevent warning

The ImportedBaseOBObjectFetcher.fetch method has been update from:

  public <T extends BaseOBObject> T fetch(SynchronizableBusinessObject item);

to:

  public BaseOBObject fetch(SynchronizableBusinessObject item);

The original generic signature did not provide any extra value, and forced to add @SuppressWarnings annotation to its implementations.

---
M src/org/openbravo/service/external/integration/importer/ImportedBaseOBObjectFetcher.java
---
(0120118)
hgbot (developer)
2020-05-21 11:36

Repository: erp/pmods/org.openbravo.service.external.integration.tests
Changeset: 8227b2cb98608ac6146130f2b0866b9e82d7af18
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 21 11:35:56 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration.tests/rev/8227b2cb98608ac6146130f2b0866b9e82d7af18 [^]

Related with ISSUE-44131: Removes SuppressWarning that is no longer needed

The ImportedBaseOBObjectFetcher.fetch method is no longer generic, so an unchecked warning was no longer being raised

---
M src-test/org/openbravo/service/external/integration/test/_import/CountryExtensionsImportFetcher.java
---
(0120120)
hgbot (developer)
2020-05-21 11:54

Repository: erp/pmods/org.openbravo.service.external.integration.tests
Changeset: 2cf180e9a942c8c71cbe3a54fb5e8b8aaedc4cb5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 21 11:54:50 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration.tests/rev/2cf180e9a942c8c71cbe3a54fb5e8b8aaedc4cb5 [^]

Related with ISSUE-44131: Adds missing license text

---
M src-test/org/openbravo/service/external/integration/test/_import/CountryExtensionsImportFetcher.java
---
(0120121)
hgbot (developer)
2020-05-21 11:56

Repository: erp/pmods/org.openbravo.service.external.integration
Changeset: a795e86baa8e83c8d0e899fbb1ca79b0997a8253
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 21 11:55:57 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration/rev/a795e86baa8e83c8d0e899fbb1ca79b0997a8253 [^]

Related with ISSUE-44131: Updates license year

---
M src/org/openbravo/service/external/integration/importer/ImportedBaseOBObjectFetcher.java
---
(0120140)
hgbot (developer)
2020-05-21 16:16

Repository: erp/pmods/org.openbravo.service.external.integration
Changeset: 7b5ab539df892d4a37c8b5ef88d6da770bf7059b
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 21 16:15:36 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration/rev/7b5ab539df892d4a37c8b5ef88d6da770bf7059b [^]

Related with ISSUE-44131: Backs out changeset 03f304a8c9c1, it is an API Change

The signature change of the fetch method is an API change that needs to be properly managed.

---
M src/org/openbravo/service/external/integration/importer/ImportedBaseOBObjectFetcher.java
---
(0120141)
hgbot (developer)
2020-05-21 16:17

Repository: erp/pmods/org.openbravo.service.external.integration.tests
Changeset: 55b0a4cb4fce67f148614c4e115f280bcdd016c8
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 21 16:17:24 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration.tests/rev/55b0a4cb4fce67f148614c4e115f280bcdd016c8 [^]

Related with ISSUE-44131: Backs out changeset, signature change was reverted

The signature change of the fetch method has been reverted. It is an API change that
needs to be properly managed.

---
M src-test/org/openbravo/service/external/integration/test/_import/CountryExtensionsImportFetcher.java
---
(0120143)
caristu (developer)
2020-05-21 16:21

Reopened issue to handle it as an API change and review all the modules affected by the change

- Issue History
Date Modified Username Field Change
2020-05-21 11:24 AugustoMauch New Issue
2020-05-21 11:24 AugustoMauch Assigned To => AugustoMauch
2020-05-21 11:24 AugustoMauch Status new => scheduled
2020-05-21 11:24 AugustoMauch File Added: showUncheckedWarnings.dif
2020-05-21 11:30 hgbot Checkin
2020-05-21 11:30 hgbot Note Added: 0120116
2020-05-21 11:30 hgbot Status scheduled => resolved
2020-05-21 11:30 hgbot Resolution open => fixed
2020-05-21 11:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration/rev/03f304a8c9c16788a4b5b1ad5128c30cb9c5c350 [^]
2020-05-21 11:30 AugustoMauch Review Assigned To => caristu
2020-05-21 11:36 hgbot Checkin
2020-05-21 11:36 hgbot Note Added: 0120118
2020-05-21 11:54 hgbot Checkin
2020-05-21 11:54 hgbot Note Added: 0120120
2020-05-21 11:56 hgbot Checkin
2020-05-21 11:56 hgbot Note Added: 0120121
2020-05-21 16:16 hgbot Checkin
2020-05-21 16:16 hgbot Note Added: 0120140
2020-05-21 16:17 hgbot Checkin
2020-05-21 16:17 hgbot Note Added: 0120141
2020-05-21 16:20 caristu Status resolved => new
2020-05-21 16:20 caristu Resolution fixed => open
2020-05-21 16:21 caristu Note Added: 0120143


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker