details:   /erp/devel/pi/rev/c65b9bc04055
changeset: 7565:c65b9bc04055
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Jun 07 20:29:21 2010 +0200
summary:   fixes issue 13571: Small changes to log messages and logging in 
various locations

diffstat:

 src/org/openbravo/base/model/ModelProvider.java          |  12 +++++++-----
 src/org/openbravo/base/session/OBPropertiesProvider.java |   4 +++-
 src/org/openbravo/dal/core/OBContext.java                |  15 +++++++--------
 3 files changed, 17 insertions(+), 14 deletions(-)

diffs (82 lines):

diff -r eb86e4c97fe5 -r c65b9bc04055 
src/org/openbravo/base/model/ModelProvider.java
--- a/src/org/openbravo/base/model/ModelProvider.java   Mon Jun 07 20:12:45 
2010 +0200
+++ b/src/org/openbravo/base/model/ModelProvider.java   Mon Jun 07 20:29:21 
2010 +0200
@@ -385,10 +385,9 @@
           log.debug("Setting targetEntity and reference Property for " + 
thisProp);
           final Column thatColumn = c.getReferenceType();
           if (thatColumn == null) {
-            log
-                .error("Property "
-                    + thisProp
-                    + " is mapped incorrectly, there is no reference column 
for it, removing from the mapping");
+            log.error("Property "
+                + thisProp
+                + " is mapped incorrectly, there is no reference column for 
it, removing from the mapping");
             thisProp.getEntity().getProperties().remove(thisProp);
             if (thisProp.getEntity().getIdProperties().remove(thisProp)) {
               Check.fail("Incorrect mapping for property " + thisProp
@@ -430,7 +429,10 @@
       // }
 
       if (t.getPrimaryKeyColumns().size() == 0) {
-        log.debug("Ignoring table " + t.getName() + " because it has no 
primary key columns");
+        if (!t.isView()) {
+          // don't log the views, these are ignored anyway
+          log.warn("Ignoring table " + t.getName() + " because it has no 
primary key columns");
+        }
         toRemove.add(t);
         continue;
       }
diff -r eb86e4c97fe5 -r c65b9bc04055 
src/org/openbravo/base/session/OBPropertiesProvider.java
--- a/src/org/openbravo/base/session/OBPropertiesProvider.java  Mon Jun 07 
20:12:45 2010 +0200
+++ b/src/org/openbravo/base/session/OBPropertiesProvider.java  Mon Jun 07 
20:29:21 2010 +0200
@@ -87,7 +87,9 @@
   }
 
   public void setProperties(InputStream is) {
-    Check.isNull(obProperties, "Openbravo properties have already been set");
+    if (obProperties != null) {
+      log.warn("Openbravo properties have already been set, setting them 
again");
+    }
     log.debug("Setting openbravo.properties through input stream");
     obProperties = new Properties();
     try {
diff -r eb86e4c97fe5 -r c65b9bc04055 src/org/openbravo/dal/core/OBContext.java
--- a/src/org/openbravo/dal/core/OBContext.java Mon Jun 07 20:12:45 2010 +0200
+++ b/src/org/openbravo/dal/core/OBContext.java Mon Jun 07 20:29:21 2010 +0200
@@ -162,7 +162,7 @@
     if (stack.size() > 0) {
       stack.pop();
     } else {
-      log.warn("Unbalanced calls to enableAsAdminContext and 
resetAsAdminContext",
+      log.warn("Unbalanced calls to setAdminMode and restorePreviousMode",
           new IllegalStateException());
     }
 
@@ -234,10 +234,9 @@
       return;
     }
     if (context != null && context == adminContext) {
-      log
-          .warn("Trying to set the admin context in the session, "
-              + "this means that the context has not been reset correctly in a 
finally block."
-              + " When using the admin context it should always be removed in 
a finally block by the application");
+      log.warn("Trying to set the admin context in the session, "
+          + "this means that the context has not been reset correctly in a 
finally block."
+          + " When using the admin context it should always be removed in a 
finally block by the application");
       return;
     }
     session.setAttribute(CONTEXT_PARAM, context);
@@ -666,9 +665,9 @@
       Check.isNotNull(getRole(), "Role may not be null");
 
       if (orgId != null) {
-        final Organization o = getOne(Organization.class, "select r from "
-            + Organization.class.getName() + " r where " + " r." + 
Organization.PROPERTY_ID + "='"
-            + orgId + "'");
+        final Organization o = getOne(Organization.class,
+            "select r from " + Organization.class.getName() + " r where " + " 
r."
+                + Organization.PROPERTY_ID + "='" + orgId + "'");
         setCurrentOrganization(o);
       } else if (getUser().getDefaultOrganization() != null
           && getUser().getDefaultOrganization().isActive()) {

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to