You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Madhan Neethiraj <ma...@apache.org> on 2017/06/12 05:36:53 UTC
FW: New Defects reported by Coverity Scan for Apache Ranger
Colm, Bhavik, Zsombor, Abhay,
As recent updaters of TestServiceREST.java, can you please review the following issues flagged by Coverity scan?
Thanks,
Madhan
On 6/11/17, 1:12 AM, "scan-admin@coverity.com" <sc...@coverity.com> wrote:
Hi,
Please find the latest report on new defect(s) introduced to Apache Ranger found with Coverity Scan.
2 new defect(s) introduced to Apache Ranger found with Coverity Scan.
2 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)
** CID 164568: Null pointer dereferences (NULL_RETURNS)
/security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java: 371 in org.apache.ranger.rest.TestServiceREST.test2updateServiceDef()()
________________________________________________________________________________________________________
*** CID 164568: Null pointer dereferences (NULL_RETURNS)
/security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java: 371 in org.apache.ranger.rest.TestServiceREST.test2updateServiceDef()()
365 public void test2updateServiceDef() throws Exception {
366 RangerServiceDef rangerServiceDef = rangerServiceDef();
367
368 Mockito.when(validatorFactory.getServiceDefValidator(svcStore))
369 .thenReturn(serviceDefValidator);
370
>>> CID 164568: Null pointer dereferences (NULL_RETURNS)
>>> "anyObject" returns null (checked 0 out of 3 times).
371 Mockito.when(
372 svcStore.updateServiceDef((RangerServiceDef) Mockito
373 .anyObject())).thenReturn(rangerServiceDef);
374
375 RangerServiceDef dbRangerServiceDef = serviceREST
376 .updateServiceDef(rangerServiceDef);
** CID 164567: Null pointer dereferences (NULL_RETURNS)
/security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java: 331 in org.apache.ranger.rest.TestServiceREST.test1createServiceDef()()
________________________________________________________________________________________________________
*** CID 164567: Null pointer dereferences (NULL_RETURNS)
/security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java: 331 in org.apache.ranger.rest.TestServiceREST.test1createServiceDef()()
325 public void test1createServiceDef() throws Exception {
326 RangerServiceDef rangerServiceDef = rangerServiceDef();
327
328 Mockito.when(validatorFactory.getServiceDefValidator(svcStore))
329 .thenReturn(serviceDefValidator);
330
>>> CID 164567: Null pointer dereferences (NULL_RETURNS)
>>> "anyObject" returns null (checked 0 out of 3 times).
331 Mockito.when(
332 svcStore.createServiceDef((RangerServiceDef) Mockito
333 .anyObject())).thenReturn(rangerServiceDef);
334
335 RangerServiceDef dbRangerServiceDef = serviceREST
336 .createServiceDef(rangerServiceDef);
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZSbhom32dlDl11LWEm9nX11zsOWMf5dv3Q9Mogo-2FGua3FsLRTFft2V-2FOFC9o0P2e0-3D_LnAJ35ABvEvOrnniInKJw2EvFzzVWfd-2BYI3WJ8Im3vGLykd3jixR4gwMhd13bE1GMScgHH1AdhZ1pAXRa1-2FoQTbT9Vcaddrp-2BRtqYuXrQ4esVzcABVuPy38YT0PTDIqP68R3C2rD68G-2FJpndg8W1kWoEOX3RvA5I6Y6zp-2F8SCKD8XrFed3S54eousbGE6zwWTXivf-2BvlYhS0j4-2BcLSqadI0PCwGaQxJ1kJ6dCH11brk-3D
To manage Coverity Scan email notifications for "mneethiraj@hortonworks.com", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq47mxskBQgxRJXpeEpoMwX0McAuDRyJUckvXbF17DhDLsPMLsQ8vjMxWA8prVpW8XFQLFUT1SyR1J0pL1yCZ20nVmr2nMWjTeARQKttMH-2FASk-3D_LnAJ35ABvEvOrnniInKJw2EvFzzVWfd-2BYI3WJ8Im3vGLykd3jixR4gwMhd13bE1GMScgHH1AdhZ1pAXRa1-2FoQQ0CEZkVLdYRzAr4kvhDYuagJ5ZrDOmJ4D-2FWCQDR9Z63-2FNP5eASnG929-2BcMpCQB-2B0wXgmbRYxrNtjVpKFkHl7pYqa2vI8pmrceflJUo2Pr6M11V7M6exwKRKOak3pDSTgT68e6SOTlK3PZfkFxqJE0k-3D
Re: FW: New Defects reported by Coverity Scan for Apache Ranger
Posted by Colm O hEigeartaigh <co...@apache.org>.
It should be "Mockito.any" and not "Mockito.anyObject" - not sure if this
is what the problem is or not, but I'll submit a RR and we'll see if the
warning goes away....
Colm.
On Mon, Jun 12, 2017 at 6:36 AM, Madhan Neethiraj <ma...@apache.org> wrote:
> Colm, Bhavik, Zsombor, Abhay,
>
> As recent updaters of TestServiceREST.java, can you please review the
> following issues flagged by Coverity scan?
>
> Thanks,
> Madhan
>
>
> On 6/11/17, 1:12 AM, "scan-admin@coverity.com" <sc...@coverity.com>
> wrote:
>
>
> Hi,
>
> Please find the latest report on new defect(s) introduced to Apache
> Ranger found with Coverity Scan.
>
> 2 new defect(s) introduced to Apache Ranger found with Coverity Scan.
> 2 defect(s), reported by Coverity Scan earlier, were marked fixed in
> the recent build analyzed by Coverity Scan.
>
> New defect(s) Reported-by: Coverity Scan
> Showing 2 of 2 defect(s)
>
>
> ** CID 164568: Null pointer dereferences (NULL_RETURNS)
> /security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java:
> 371 in org.apache.ranger.rest.TestServiceREST.test2updateServiceDef()()
>
>
> ____________________________________________________________
> ____________________________________________
> *** CID 164568: Null pointer dereferences (NULL_RETURNS)
> /security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java:
> 371 in org.apache.ranger.rest.TestServiceREST.test2updateServiceDef()()
> 365 public void test2updateServiceDef() throws Exception {
> 366 RangerServiceDef rangerServiceDef =
> rangerServiceDef();
> 367
> 368 Mockito.when(validatorFactory.
> getServiceDefValidator(svcStore))
> 369 .thenReturn(serviceDefValidator);
> 370
> >>> CID 164568: Null pointer dereferences (NULL_RETURNS)
> >>> "anyObject" returns null (checked 0 out of 3 times).
> 371 Mockito.when(
> 372 svcStore.updateServiceDef((RangerServiceDef)
> Mockito
> 373
> .anyObject())).thenReturn(rangerServiceDef);
> 374
> 375 RangerServiceDef dbRangerServiceDef = serviceREST
> 376 .updateServiceDef(
> rangerServiceDef);
>
> ** CID 164567: Null pointer dereferences (NULL_RETURNS)
> /security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java:
> 331 in org.apache.ranger.rest.TestServiceREST.test1createServiceDef()()
>
>
> ____________________________________________________________
> ____________________________________________
> *** CID 164567: Null pointer dereferences (NULL_RETURNS)
> /security-admin/src/test/java/org/apache/ranger/rest/TestServiceREST.java:
> 331 in org.apache.ranger.rest.TestServiceREST.test1createServiceDef()()
> 325 public void test1createServiceDef() throws Exception {
> 326 RangerServiceDef rangerServiceDef =
> rangerServiceDef();
> 327
> 328 Mockito.when(validatorFactory.
> getServiceDefValidator(svcStore))
> 329 .thenReturn(serviceDefValidator);
> 330
> >>> CID 164567: Null pointer dereferences (NULL_RETURNS)
> >>> "anyObject" returns null (checked 0 out of 3 times).
> 331 Mockito.when(
> 332 svcStore.createServiceDef((RangerServiceDef)
> Mockito
> 333
> .anyObject())).thenReturn(rangerServiceDef);
> 334
> 335 RangerServiceDef dbRangerServiceDef = serviceREST
> 336 .createServiceDef(
> rangerServiceDef);
>
>
> ____________________________________________________________
> ____________________________________________
> To view the defects in Coverity Scan visit,
> https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-
> 2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZSbhom32dlDl11LWEm9n
> X11zsOWMf5dv3Q9Mogo-2FGua3FsLRTFft2V-2FOFC9o0P2e0-3D_
> LnAJ35ABvEvOrnniInKJw2EvFzzVWfd-2BYI3WJ8Im3vGLykd3jixR4gwMhd13
> bE1GMScgHH1AdhZ1pAXRa1-2FoQTbT9Vcaddrp-2BRtqYuXrQ4esVzcABVuPy38YT0PTD
> IqP68R3C2rD68G-2FJpndg8W1kWoEOX3RvA5I6Y6zp-2F8SCKD8XrFed3S54eousbGE6zwWTX
> ivf-2BvlYhS0j4-2BcLSqadI0PCwGaQxJ1kJ6dCH11brk-3D
>
> To manage Coverity Scan email notifications for "
> mneethiraj@hortonworks.com", click https://u2389337.ct.sendgrid.
> net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-
> 2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq47mxskBQgxRJXpeEpoMwX
> 0McAuDRyJUckvXbF17DhDLsPMLsQ8vjMxWA8prVpW8XFQLFUT1SyR1J0pL1y
> CZ20nVmr2nMWjTeARQKttMH-2FASk-3D_LnAJ35ABvEvOrnniInKJw2EvFzzVWfd-
> 2BYI3WJ8Im3vGLykd3jixR4gwMhd13bE1GMScgHH1AdhZ1pAXRa1-
> 2FoQQ0CEZkVLdYRzAr4kvhDYuagJ5ZrDOmJ4D-2FWCQDR9Z63-2FNP5eASnG929-2BcMpCQB-
> 2B0wXgmbRYxrNtjVpKFkHl7pYqa2vI8pmrceflJUo2Pr6M11V7M6exwKRKOa
> k3pDSTgT68e6SOTlK3PZfkFxqJE0k-3D
>
>
>
>
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com