Skip to content

Commit

Permalink
FLAG-81: suppressed the warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ManojLL committed Aug 6, 2024
1 parent 9623188 commit 80e0722
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

public abstract class PatientFlagMetadataBundle extends AbstractMetadataBundle {

@SuppressWarnings("unchecked")
protected void install(TagDescriptor tagDescriptor) {
Tag tag = new Tag(tagDescriptor.name());
if (StringUtils.isNotBlank(tagDescriptor.uuid())) {
Expand Down Expand Up @@ -48,6 +49,7 @@ protected void install(PriorityDescriptor priorityDescriptor) {
this.install((OpenmrsObject) priority);
}

@SuppressWarnings("unchecked")
protected void install(FlagDescriptor flagDescriptor) {
Flag flag = new Flag(flagDescriptor.name(), flagDescriptor.criteria(), flagDescriptor.message());
if (StringUtils.isNotBlank(flagDescriptor.priority())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public Flag getFlagByName(String name) throws DAOException {
criteria.add(Restrictions.eq("name", name));
}

@SuppressWarnings("unchecked")
List<Flag> list = criteria.list();

if (list.size() == 1) {
Expand Down Expand Up @@ -185,6 +186,7 @@ public Tag getTag(String name) {
criteria.add(Restrictions.eq("name", name));
}

@SuppressWarnings("unchecked")
List<Tag> list = criteria.list();

if (list.size() == 1) {
Expand Down Expand Up @@ -269,6 +271,7 @@ public Priority getPriorityByName(String name) throws DAOException {
criteria.add(Restrictions.eq("name", name));
}

@SuppressWarnings("unchecked")
List<Priority> list = criteria.list();

if (list.size() == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
*/
package org.openmrs.module.patientflags.task;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -96,6 +94,8 @@ private static void generatePatientFlags(Flag flag, FlagService service) {
.collect(Collectors.toSet());

for (Integer patientId : members) {

@SuppressWarnings("unchecked")
List<String> flgs = (List<String>)context.get(patientId);
if (flgs != null) {
for (String flg : flgs) {
Expand All @@ -114,6 +114,8 @@ private void generatePatientFlags(Patient patient, FlagService service) {
HashMap<Object, Object> context = new HashMap<Object, Object>();
List<Flag> flags = service.generateFlagsForPatient(patient, context);
for (Flag flag : flags) {

@SuppressWarnings("unchecked")
List<String> flgs = (List<String>)context.get(patient.getPatientId());
if (flgs != null) {
for (String flg : flgs) {
Expand Down

0 comments on commit 80e0722

Please sign in to comment.