details:   https://code.openbravo.com/erp/devel/pi/rev/4c91b7f6a04f
changeset: 18176:4c91b7f6a04f
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Tue Oct 09 15:34:19 2012 +0200
summary:   Fixes issue 21429: Openbravo doesn't work with Eclipse 4.2 (Juno)
Apparently the eclipse juno compiler optimizes away a method which has a 
complete dead body.

diffstat:

 src/org/openbravo/dal/core/OBContext.java |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r f2ec6da4445f -r 4c91b7f6a04f src/org/openbravo/dal/core/OBContext.java
--- a/src/org/openbravo/dal/core/OBContext.java Tue Oct 09 13:41:46 2012 +0200
+++ b/src/org/openbravo/dal/core/OBContext.java Tue Oct 09 15:34:19 2012 +0200
@@ -164,7 +164,7 @@
     } else if (OBContext.getOBContext() == adminContext) {
       return;
     }
-    if (OBContext.getOBContext() != null) {
+    if (OBContext.getOBContext() != null && ADMIN_TRACE_SIZE != 0) {
       addStackTrace("setAdminMode");
     }
   }
@@ -219,7 +219,9 @@
     if (OBContext.getOBContext() == null) {
       return;
     }
-    addStackTrace("restorePreviousMode");
+    if (ADMIN_TRACE_SIZE != 0) {
+      addStackTrace("restorePreviousMode");
+    }
     if (stack.isEmpty() && OBContext.getOBContext() == adminContext) {
       OBContext.setOBContext((OBContext) null);
     }
@@ -255,10 +257,6 @@
   }
 
   private static void addStackTrace(String prefix) {
-    if (ADMIN_TRACE_SIZE == 0) {
-      return;
-    }
-
     final StringWriter sw = new StringWriter();
     final PrintWriter pw = new PrintWriter(sw);
     sw.write(prefix + "\n");

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to