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

View Revisions: Issue #28119 All Revisions ] Back to Issue ]
Summary 0028119: potential NPE in DataSourceServiceProvider
Revision 2014-11-07 09:52 by alostale
Description There is a compilation warning in DataSourceServiceProvider:

Null pointer access: The variable ds can only be null at this location

problematic code is around line 84:

            if (ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType())) {
              dataSource = table.getObserdsDatasource();
              ds.setEntity(ModelProvider.getInstance().getEntityByTableId(table.getId()));
            }

This code was added by changest

changeset: 20346:faaff1ca4c4a
user: Augusto Mauch <augusto.mauch@openbravo.com>
date: Mon May 06 09:42:42 2013 +0200
summary: [DS Based Tables] Set the entity of the datasource

diff -r 8113618afb03 -r faaff1ca4c4a modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java Mon May 06 09:41:54 2013 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java Mon May 06 09:42:42 2013 +0200
@@ -81,6 +81,7 @@
             Table table = (Table) qTable.list().get(0);
             if (ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType())) {
               dataSource = table.getObserdsDatasource();
+ ds.setEntity(ModelProvider.getInstance().getEntityByTableId(table.getId()));
             }
           }
           if (dataSource == null) {
Revision 2014-11-07 09:51 by alostale
Description There is a compilation warning in DataSourceServiceProvider:

Null pointer access: The variable ds can only be null at this location

problematic code is around line 84:

 if (ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType())) {
              dataSource = table.getObserdsDatasource();
              ds.setEntity(ModelProvider.getInstance().getEntityByTableId(table.getId()));
            }


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker