cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r734416 - in /cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler: CayenneModelerFrame.java editor/EditorView.java
Date Wed, 14 Jan 2009 15:13:02 GMT
Author: andrey
Date: Wed Jan 14 07:12:57 2009
New Revision: 734416

URL: http://svn.apache.org/viewvc?rev=734416&view=rev
Log:
CAY-940 CayenneModeler fails on load of existing project file or upon creation of new project
on IBM's Java 1.6.0 SDK on 32-bit ppc

Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java?rev=734416&r1=734415&r2=734416&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerFrame.java
Wed Jan 14 07:12:57 2009
@@ -100,6 +100,7 @@
 import org.apache.cayenne.modeler.util.OperatingSystem;
 import org.apache.cayenne.modeler.util.RecentFileMenu;
 import org.apache.cayenne.pref.Domain;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Main frame of CayenneModeler. Responsibilities include coordination of
@@ -276,13 +277,22 @@
         
         splitPane.setResizeWeight(0.7);
         
-        Domain domain = Application.getInstance().getPreferenceDomain().getSubdomain(
+        /**
+         * Moving this to try-catch block per CAY-940.
+         * Exception will be stack-traced  
+         */
+        try {
+            Domain domain = Application.getInstance().getPreferenceDomain().getSubdomain(
                 this.getClass());
-        ComponentGeometry geometry = (ComponentGeometry) domain.getDetail(
+            ComponentGeometry geometry = (ComponentGeometry) domain.getDetail(
                 "splitPane.divider",
                 ComponentGeometry.class,
                 true);
-        geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 400);
+            geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 400);
+        }
+        catch (Exception ex) {
+            LogFactory.getLog(getClass()).error("Cannot bind divider property", ex);
+        }
 
         JPanel statusBar = new JPanel(new FlowLayout(FlowLayout.LEFT, 3, 1));
         // add placeholder

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java?rev=734416&r1=734415&r2=734416&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
Wed Jan 14 07:12:57 2009
@@ -55,6 +55,7 @@
 import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Main display area split into the project navigation tree on the left and selected
@@ -170,14 +171,23 @@
         eventController.addQueryDisplayListener(this);
         eventController.addMultipleObjectsDisplayListener(this);
 
-        Domain domain = eventController.getApplicationPreferenceDomain().getSubdomain(
-                this.getClass());
-        ComponentGeometry geometry = (ComponentGeometry) domain.getDetail(
+        /**
+         * Moving this to try-catch block per CAY-940.
+         * Exception will be stack-traced  
+         */
+        try {
+            Domain domain = eventController.getApplicationPreferenceDomain().getSubdomain(
+                 this.getClass());
+            ComponentGeometry geometry = (ComponentGeometry) domain.getDetail(
                 "splitPane.divider",
                 ComponentGeometry.class,
                 true);
 
-        geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 150);
+            geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 150);
+        }
+        catch (Exception ex) {
+            LogFactory.getLog(getClass()).error("Cannot bind divider property", ex);
+        }
     }
 
     public void currentProcedureChanged(ProcedureDisplayEvent e) {



Mime
View raw message