Actions
bug #3811
closedNull pointer access in eu.etaxonomy.cdm.remote.service.DataController
Status:
Closed
Priority:
Priority14
Assignee:
Category:
cdmlib-remote
Target version:
Start date:
Due date:
% Done:
100%
Estimated time:
Severity:
normal
Found in Version:
Description
at line 83 and 86 the out stream reference is null.
It is recommended to set the warning to error for these kind of code checks in Window->Preferences->Java->Compiler->!Errors/Warnings->Potential Programming Problems->Null Pointer Access
As a hot fix I simply commented the method body
public ModelAndView getData(@RequestParam("lsid") LSID lsid, @RequestParam("start") Integer start, @RequestParam("length") Integer length, HttpServletResponse response) throws LSIDServerException, IOException { OutputStream out = null; InputStream data = null; try { data = lsidDataService.getDataByRange(lsid,start,length); if(data != null) { response.setContentType("application/octet-stream"); byte[] bytes = new byte[1024]; int numbytes = data.read(bytes); while (numbytes != -1) { out.write(bytes,0,numbytes); numbytes = data.read(bytes); } out.flush(); } } finally { if (out != null) { out.close(); } if (data != null) { data.close(); } } return null; }
Updated by Andreas Müller over 9 years ago
- Assignee changed from Andreas Müller to Andreas Kohlbecker
Updated by Andreas Kohlbecker over 9 years ago
- Category changed from cdmlib to cdmlib-remote
Updated by Andreas Kohlbecker over 9 years ago
- Severity changed from normal to minor
Updated by Andreas Müller over 1 year ago
- Description updated (diff)
- Status changed from New to Feedback
- Target version changed from cdmlib - Old Next Major Release to Release 5.40
Is this still an open issue?
Updated by Andreas Kohlbecker over 1 year ago
- Status changed from Feedback to New
- Priority changed from New to Priority14
- Severity changed from minor to normal
still open and a really wired interim solution to this problem.
Updated by Andreas Kohlbecker over 1 year ago
- Status changed from New to Closed
- % Done changed from 0 to 100
fixed!
Updated by Andreas Müller over 1 year ago
- Target version changed from Release 5.40 to Release 5.29
Actions