Skip to content

Commit b818792

Browse files
committed
Revert "GCI - 9 #1"
1 parent ae54d94 commit b818792

20 files changed

Lines changed: 45 additions & 51 deletions

api/src/main/java/org/openmrs/PersonName.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,6 @@ public int compareTo(PersonName other) {
576576
return ret;
577577
}
578578

579-
public boolean equals(Object o) {
580-
if (o instanceof PersonName) {
581-
return compareTo((PersonName) o) == 0;
582-
} else {
583-
return false;
584-
}
585-
}
586-
587579
/**
588580
* @since 1.5
589581
* @see org.openmrs.OpenmrsObject#getId()

api/src/main/java/org/openmrs/api/context/Context.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.util.Properties;
2323
import java.util.Set;
2424
import java.util.WeakHashMap;
25-
import java.util.Arrays;
2625

2726
import javax.mail.Authenticator;
2827
import javax.mail.PasswordAuthentication;
@@ -242,7 +241,7 @@ public static UserContext getUserContext() {
242241
Object[] arr = userContextHolder.get();
243242

244243
if (log.isTraceEnabled()) {
245-
log.trace("Getting user context " + Arrays.toString(arr) + " from userContextHolder " + userContextHolder);
244+
log.trace("Getting user context " + arr + " from userContextHolder " + userContextHolder);
246245
}
247246

248247
if (arr == null) {

api/src/main/java/org/openmrs/api/context/Daemon.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
*/
1414
package org.openmrs.api.context;
1515

16-
import org.apache.commons.logging.Log;
17-
import org.apache.commons.logging.LogFactory;
18-
1916
import org.openmrs.User;
2017
import org.openmrs.api.APIAuthenticationException;
2118
import org.openmrs.api.APIException;
@@ -40,8 +37,6 @@ public class Daemon {
4037
*/
4138
protected static final String DAEMON_USER_UUID = "A4F30A1B-5EB9-11DF-A648-37A07F9C90FB";
4239

43-
private static Log log = LogFactory.getLog(Daemon.class);
44-
4540
protected static final ThreadLocal<Boolean> isDaemonThread = new ThreadLocal<Boolean>();
4641

4742
/**
@@ -248,7 +243,8 @@ public void run() {
248243
onStartupThread.join();
249244
}
250245
catch (InterruptedException e) {
251-
log.error("\"onStartup\" thread interrupted!", e);
246+
// ignore
247+
e.printStackTrace();
252248
}
253249

254250
if (onStartupThread.exceptionThrown != null) {

api/src/main/java/org/openmrs/api/context/ServiceContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private ServiceContext() {
134134
* @return This VM's current ServiceContext.
135135
* @see org.openmrs.api.context.Context
136136
*/
137-
public static synchronized ServiceContext getInstance() {
137+
public static ServiceContext getInstance() {
138138
if (instance == null) {
139139
instance = new ServiceContext();
140140
}
@@ -146,7 +146,7 @@ public static synchronized ServiceContext getInstance() {
146146
* Null out the current instance of the ServiceContext. This should be used when modules are
147147
* refreshing (being added/removed) and/or openmrs is shutting down
148148
*/
149-
public static synchronized void destroyInstance() {
149+
public static void destroyInstance() {
150150
if (instance != null && instance.services != null) {
151151
if (log.isDebugEnabled()) {
152152
for (Map.Entry<Class, Object> entry : instance.services.entrySet()) {

api/src/main/java/org/openmrs/hl7/handler/ORUR01Handler.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,12 @@ private Obs parseObs(Encounter encounter, OBX obx, OBR obr, String uid) throws H
804804
if (value != null) {
805805
Date valueDate = getDate(value.getYear(), value.getMonth(), value.getDay(), value.getHour(), value
806806
.getMinute(), value.getSecond());
807-
obs.setValueDatetime(valueDate);
808-
807+
if (valueDate != null) {
808+
obs.setValueDatetime(valueDate);
809+
} else {
810+
log.warn("Not creating null valued obs for concept " + concept);
811+
return null;
812+
}
809813
} else {
810814
log.warn("Not creating null valued obs for concept " + concept);
811815
return null;
@@ -1291,7 +1295,7 @@ private void updateHealthCenter(Patient patient, PV1 pv1) {
12911295

12921296
PersonAttribute currentHealthCenter = patient.getAttribute("Health Center");
12931297

1294-
if (currentHealthCenter == null || !currentHealthCenter.getValue().equals(newLocationId.toString())) {
1298+
if (currentHealthCenter == null || !currentHealthCenter.equals(newLocationId.toString())) {
12951299
PersonAttribute newHealthCenter = new PersonAttribute(healthCenterAttrType, newLocationId.toString());
12961300

12971301
log.debug("Updating patient's location from " + currentHealthCenter + " to " + newLocationId);

api/src/main/java/org/openmrs/module/ModuleFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public static Collection<Module> getLoadedModules() {
447447
*
448448
* @return map<ModuleId, Module>
449449
*/
450-
public static synchronized Map<String, Module> getLoadedModulesMap() {
450+
public static Map<String, Module> getLoadedModulesMap() {
451451
if (loadedModules == null) {
452452
loadedModules = new WeakHashMap<String, Module>();
453453
}
@@ -461,7 +461,7 @@ public static synchronized Map<String, Module> getLoadedModulesMap() {
461461
*
462462
* @return map<PackageName, Module>
463463
*/
464-
public static synchronized Map<String, Module> getLoadedModulesMapPackage() {
464+
public static Map<String, Module> getLoadedModulesMapPackage() {
465465
if (loadedModules == null) {
466466
loadedModules = new WeakHashMap<String, Module>();
467467
return loadedModules;
@@ -505,7 +505,7 @@ public static List<Module> getStartedModulesInOrder() {
505505
*
506506
* @return Map&lt;ModuleId, Module&gt;
507507
*/
508-
public static synchronized Map<String, Module> getStartedModulesMap() {
508+
public static Map<String, Module> getStartedModulesMap() {
509509
if (startedModules == null) {
510510
startedModules = new WeakHashMap<String, Module>();
511511
}
@@ -628,7 +628,7 @@ public static Module startModuleInternal(Module module) throws ModuleException {
628628
* @param applicationContext the spring application context instance to refresh
629629
* @param applicationContext the spring application context instance to refresh
630630
*/
631-
public static synchronized Module startModuleInternal(Module module, boolean isOpenmrsStartup,
631+
public static Module startModuleInternal(Module module, boolean isOpenmrsStartup,
632632
AbstractRefreshableApplicationContext applicationContext) throws ModuleException {
633633

634634
if (module != null) {
@@ -1406,7 +1406,7 @@ public static Collection<ModuleClassLoader> getModuleClassLoaders() {
14061406
*
14071407
* @return Map<Module, ModuleClassLoader>
14081408
*/
1409-
public static synchronized Map<Module, ModuleClassLoader> getModuleClassLoaderMap() {
1409+
public static Map<Module, ModuleClassLoader> getModuleClassLoaderMap() {
14101410
if (moduleClassLoaders == null) {
14111411
moduleClassLoaders = new WeakHashMap<Module, ModuleClassLoader>();
14121412
}
@@ -1419,7 +1419,7 @@ public static synchronized Map<Module, ModuleClassLoader> getModuleClassLoaderMa
14191419
*
14201420
* @return Map<String, List<Extension>>
14211421
*/
1422-
public static synchronized Map<String, List<Extension>> getExtensionMap() {
1422+
public static Map<String, List<Extension>> getExtensionMap() {
14231423
if (extensionMap == null) {
14241424
extensionMap = new WeakHashMap<String, List<Extension>>();
14251425
}

api/src/main/java/org/openmrs/reporting/export/DataExportFunctions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ public void setPatientId(Integer patientId) {
261261
map.remove(this.patientId);
262262
}
263263
}
264-
//reclaim some memory
264+
265+
// reclaim some memory
265266
garbageCollect();
266267

267268
setPatient(null);

api/src/main/java/org/openmrs/reporting/export/DataExportUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static void generateExport(DataExportReportObject dataExport, Cohort pati
229229
log.debug("Clearing hibernate session");
230230
Context.clearSession();
231231

232-
//clear out excess objects
232+
// clear out the excess objects
233233
System.gc();
234234
System.gc();
235235
}

api/src/main/java/org/openmrs/reporting/export/RowPerObsDataExportReportObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public Cohort generatePatientSet(EvaluationContext context) {
211211
patientIdSet.addAll(patientIds);
212212
}
213213

214-
if (location != null && !location.toString().equals("")) {
214+
if (location != null && !location.equals("")) {
215215
patientIdSet.retainAll(pss.getPatientsHavingLocation(getLocation()).getMemberIds());
216216
}
217217

api/src/main/java/org/openmrs/util/DatabaseUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ public static void setAuthenticatedUserId(Integer userId) {
670670
*
671671
* @param warnings list of warnings to append to the end of the current list
672672
*/
673-
public static synchronized void reportUpdateWarnings(List<String> warnings) {
673+
public static void reportUpdateWarnings(List<String> warnings) {
674674
if (updateWarnings == null) {
675675
updateWarnings = new LinkedList<String>();
676676
}

0 commit comments

Comments
 (0)