Revision: 3249
Author: silva.josemanuel1
Date: Wed Jan 27 12:25:33 2010
Log: Implemented child removal in ProfileManagerImpl better, and removed it
from TableProfileResult.
http://code.google.com/p/power-architect/source/detail?r=3249
Modified:
/trunk/src/ca/sqlpower/architect/profile/ProfileManagerImpl.java
/trunk/src/ca/sqlpower/architect/profile/TableProfileResult.java
=======================================
--- /trunk/src/ca/sqlpower/architect/profile/ProfileManagerImpl.java Mon
Jan 18 11:01:49 2010
+++ /trunk/src/ca/sqlpower/architect/profile/ProfileManagerImpl.java Wed
Jan 27 12:25:33 2010
@@ -381,10 +381,14 @@
@Override
protected boolean removeChildImpl(SPObject child) {
- if (results.remove(child)) {
- return true;
+ if (child.getClass().isAssignableFrom(TableProfileResult.class)) {
+ if (removeProfile((TableProfileResult)child)) {
+ return true;
+ } else {
+ throw new IllegalArgumentException("Table does not exist
in this profile manager");
+ }
} else {
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Child must be of type
TableProfileResult");
}
}
=======================================
--- /trunk/src/ca/sqlpower/architect/profile/TableProfileResult.java Mon
Jan 18 11:01:49 2010
+++ /trunk/src/ca/sqlpower/architect/profile/TableProfileResult.java Wed
Jan 27 12:25:33 2010
@@ -209,11 +209,7 @@
@Override
protected boolean removeChildImpl(SPObject child) {
- if (columnProfileResults.remove(child)) {
- return true;
- } else {
- throw new IllegalArgumentException();
- }
+ return false;
}
public boolean allowsChildren() {