Revision: 3785
Author: [email protected]
Date: Fri Jul 23 11:28:13 2010
Log: Patch for bug 2886. Now users cannot change the properties of a column with the type field being null. While this does not prevent the type from being set to null on reverse engineering it prevents users from removing the override on the column information which would get them into an inconsistent state that throws NPEs.
http://code.google.com/p/power-architect/source/detail?r=3785

Modified:
 /trunk/src/main/java/ca/sqlpower/architect/swingui/ColumnEditPanel.java
 /trunk/src/main/resources/ca/sqlpower/architect/swingui/messages.properties

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/ColumnEditPanel.java Thu Jul 22 14:31:50 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/ColumnEditPanel.java Fri Jul 23 11:28:13 2010
@@ -822,6 +822,11 @@
     private List<String> updateModel() {
         logger.debug("Updating model"); //$NON-NLS-1$
         List<String> errors = new ArrayList<String>();
+        if (componentEnabledMap.get(colType).isSelected() &&
+                colType.getLastSelectedPathComponent() == null) {
+            errors.add(Messages.getString("ColumnEditPanel.missingType"));
+            return errors;
+        }
SQLObject compoundEditRoot = SQLObjectUtils.findCommonAncestor(columns);
         logger.debug("Compound edit root is " + compoundEditRoot);
         try {
=======================================
--- /trunk/src/main/resources/ca/sqlpower/architect/swingui/messages.properties Mon Jul 5 15:20:51 2010 +++ /trunk/src/main/resources/ca/sqlpower/architect/swingui/messages.properties Fri Jul 23 11:28:13 2010
@@ -81,6 +81,7 @@
 ColumnEditPanel.inPrimaryKey=In Primary Key
 ColumnEditPanel.physicalName=Physical Name
 ColumnEditPanel.logicalName=Logical Name
+ColumnEditPanel.missingType=The data type of this column must be specified
 ColumnEditPanel.noneSpecified=None Specified
 ColumnEditPanel.precision=Precision
 ColumnEditPanel.remarks=Remarks

Reply via email to