Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d8f47fefe143
Choose a base ref
...
head repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d5deed194fb9
Choose a head ref
  • 2 commits
  • 19 files changed
  • 2 contributors

Commits on Jan 22, 2014

  1. TRUNK-4222: SonarQube - Dead store to local variable

    Lech Rozanski committed Jan 22, 2014
    Copy the full SHA
    4adc72d View commit details
  2. Merge pull request #550 from lrozanski/TRUNK-4222

    TRUNK-4222: SonarQube - Dead store to local variable
    dkayiwa committed Jan 22, 2014
    Copy the full SHA
    d5deed1 View commit details
3 changes: 0 additions & 3 deletions api/src/main/java/org/openmrs/api/context/Context.java
Original file line number Diff line number Diff line change
@@ -897,9 +897,6 @@ public static void startup(String url, String username, String password, Propert
properties.put("connection.password", password);
setRuntimeProperties(properties);

@SuppressWarnings("unused")
AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext-service.xml");

openSession(); // so that the startup method can use proxyPrivileges

startup(properties);
Original file line number Diff line number Diff line change
@@ -236,9 +236,8 @@ public void updateReportObject(AbstractReportObject ro) throws DAOException {
*/
@Deprecated
public void deleteReportObject(Integer reportObjectId) throws DAOException {
ReportObjectWrapper wrappedReportObject = new ReportObjectWrapper();
wrappedReportObject = (ReportObjectWrapper) sessionFactory.getCurrentSession().get(ReportObjectWrapper.class,
reportObjectId);
ReportObjectWrapper wrappedReportObject = (ReportObjectWrapper) sessionFactory.getCurrentSession().get(
ReportObjectWrapper.class, reportObjectId);

sessionFactory.getCurrentSession().delete(wrappedReportObject);
}
Original file line number Diff line number Diff line change
@@ -51,11 +51,7 @@ public void setSessionFactory(SessionFactory sessionFactory) {
@SuppressWarnings("unchecked")
public List<Note> getNotes() {
log.info("Getting all notes from the database");
List<Note> notes = new ArrayList<Note>();

notes = sessionFactory.getCurrentSession().createQuery("from Note").list();

return notes;
return sessionFactory.getCurrentSession().createQuery("from Note").list();
}

/**
Original file line number Diff line number Diff line change
@@ -529,9 +529,8 @@ public List<Relationship> getRelationships(Person fromPerson, Person toPerson, R
* @see org.openmrs.api.db.PersonDAO#getRelationshipType(java.lang.Integer)
*/
public RelationshipType getRelationshipType(Integer relationshipTypeId) throws DAOException {
RelationshipType relationshipType = new RelationshipType();
relationshipType = (RelationshipType) sessionFactory.getCurrentSession().get(RelationshipType.class,
relationshipTypeId);
RelationshipType relationshipType = (RelationshipType) sessionFactory.getCurrentSession().get(
RelationshipType.class, relationshipTypeId);

return relationshipType;
}
Original file line number Diff line number Diff line change
@@ -638,8 +638,7 @@ public Drug getDrug(String drugNameOrId) {
if (drugId != null) {
return Context.getConceptService().getDrug(drugId);
} else {
List<Drug> drugs = new ArrayList<Drug>();
drugs = dao.getDrugs(drugNameOrId, null, false);
List<Drug> drugs = dao.getDrugs(drugNameOrId, null, false);
if (drugs.size() > 1)
log.warn("more than one drug name returned with name:" + drugNameOrId);
if (drugs.size() == 0)
Original file line number Diff line number Diff line change
@@ -118,8 +118,6 @@ public Encounter saveEncounter(Encounter encounter) throws APIException {
}
}

Errors errors = new BindException(encounter, "encounter");

boolean isNewEncounter = false;
Date newDate = encounter.getEncounterDatetime();
Date originalDate = null;
2 changes: 0 additions & 2 deletions api/src/main/java/org/openmrs/api/impl/UserServiceImpl.java
Original file line number Diff line number Diff line change
@@ -444,8 +444,6 @@ public List<User> getUsers(String nameSearch, List<Role> roles, boolean includeV
*/
private void checkPrivileges(User user) {
Collection<Role> roles = user.getAllRoles();
User authUser = Context.getAuthenticatedUser();

List<String> requiredPrivs = new Vector<String>();

for (Role r : roles) {
Loading