Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ public void showConfigForm(ModelMap model, WebRequest webRequest) {

@RequestMapping(value = "/module/dhisreport/mapLocations", method = RequestMethod.POST)
public String mapLocations(ModelMap model,
@RequestParam(value = "DHIS2OrgUnits", required = true) String dhis2OrgUnitCode,
@RequestParam(value = "DHIS2OrgUnits", required = false) String dhis2OrgUnitCode,
@RequestParam(value = "openmrsLocations", required = true) String openmrsLocationName,
WebRequest webRequest) {
System.out.println("org unit does not exits and it is : " + dhis2OrgUnitCode);
String referer = webRequest.getHeader("Referer");

if (dhis2OrgUnitCode.equals("")) {
if (dhis2OrgUnitCode == null || dhis2OrgUnitCode.isEmpty()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gitcliff , can you take a look at the java convestions here https://wiki.openmrs.org/display/docs/Java+Conventions.

dhis2OrgUnitCode == null || dhis2OrgUnitCode.isEmpty() , this is discouraged. instead take use of the apache commons string utils library

System.out.println("org unit does not exits");
webRequest.setAttribute(WebConstants.OPENMRS_MSG_ATTR,
Context.getMessageSourceService().getMessage("dhisreport.orgUnitCodeDoesNotExist"),
Expand Down
2 changes: 1 addition & 1 deletion omod/src/main/webapp/mapLocations.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</table>
</form>

<tr>


<h3>
<spring:message code="dhisreport.mappedLocations" />
Expand Down