From 379ed8a0e133bee650e0acb24f6b743f657a50d0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 16:08:49 +0200 Subject: Last bit of cleanup honest New castor and dependent commons libs --- .classpath | 9 +++--- lib/castor-1.3.2-core.jar | Bin 0 -> 55019 bytes lib/castor-1.3.2-xml-schema.jar | Bin 0 -> 351544 bytes lib/castor-1.3.2-xml.jar | Bin 0 -> 795921 bytes lib/castor-core.jar | Bin 55226 -> 0 bytes lib/castor-xml-schema.jar | Bin 347768 -> 0 bytes lib/castor-xml.jar | Bin 749083 -> 0 bytes lib/commons-lang-2.6.jar | Bin 0 -> 284220 bytes lib/commons-logging-1.1.1.jar | Bin 0 -> 60841 bytes lib/commons-logging.jar | Bin 38015 -> 0 bytes source/com/c2kernel/entity/proxy/AgentProxy.java | 4 +-- .../c2kernel/entity/proxy/EntityProxyManager.java | 4 +-- source/com/c2kernel/entity/proxy/ProxyMessage.java | 9 ------ .../com/c2kernel/entity/proxy/ProxySubscriber.java | 36 --------------------- .../com/c2kernel/entity/transfer/TransferItem.java | 8 ++--- source/com/c2kernel/gui/data/NodeCollection.java | 8 ++--- source/com/c2kernel/gui/data/NodeContext.java | 4 +-- source/com/c2kernel/gui/tabs/CollectionPane.java | 28 +++++++++------- source/com/c2kernel/gui/tabs/ViewpointPane.java | 11 +++---- .../gui/tabs/collection/AggregationView.java | 11 ++++--- .../tabs/collection/CollectionHistoryWindow.java | 20 ++++++------ .../gui/tabs/collection/CollectionView.java | 7 ++-- .../gui/tabs/collection/DependencyView.java | 5 +-- .../gui/tabs/execution/ActivityViewer.java | 2 +- .../c2kernel/gui/tabs/outcome/form/DataRecord.java | 2 -- .../gui/tabs/outcome/form/OutcomePanel.java | 5 ++- .../gui/tabs/outcome/form/field/ComboField.java | 4 +-- .../tabs/outcome/form/field/StringEditField.java | 10 +++--- .../com/c2kernel/lifecycle/instance/JobPusher.java | 8 ++--- .../instance/predefined/AssignItemToSlot.java | 4 +-- .../predefined/CreateItemFromDescription.java | 8 ++--- .../lifecycle/instance/predefined/Erase.java | 3 +- .../predefined/entitycreation/Aggregation.java | 4 +-- .../predefined/entitycreation/Dependency.java | 7 ++-- .../predefined/entitycreation/NewAgent.java | 7 ++-- .../predefined/entitycreation/NewItem.java | 14 ++++---- source/com/c2kernel/lookup/LDAPRoleManager.java | 15 ++++----- source/com/c2kernel/lookup/Path.java | 6 ++-- .../persistency/ClusterStorageManager.java | 6 ++-- .../c2kernel/persistency/TransactionManager.java | 15 ++++----- .../c2kernel/persistency/XMLClusterStorage.java | 4 +-- source/com/c2kernel/process/Bootstrap.java | 3 +- source/com/c2kernel/property/PropertyUtility.java | 25 +++++++------- .../com/c2kernel/utils/GTimeStampComparator.java | 6 ++-- source/com/c2kernel/utils/SoftCache.java | 4 +-- 45 files changed, 138 insertions(+), 188 deletions(-) create mode 100644 lib/castor-1.3.2-core.jar create mode 100644 lib/castor-1.3.2-xml-schema.jar create mode 100644 lib/castor-1.3.2-xml.jar delete mode 100755 lib/castor-core.jar delete mode 100755 lib/castor-xml-schema.jar delete mode 100755 lib/castor-xml.jar create mode 100644 lib/commons-lang-2.6.jar create mode 100644 lib/commons-logging-1.1.1.jar delete mode 100755 lib/commons-logging.jar delete mode 100644 source/com/c2kernel/entity/proxy/ProxySubscriber.java diff --git a/.classpath b/.classpath index e344f67..79ed770 100644 --- a/.classpath +++ b/.classpath @@ -8,11 +8,12 @@ - - - - + + + + + diff --git a/lib/castor-1.3.2-core.jar b/lib/castor-1.3.2-core.jar new file mode 100644 index 0000000..914fe16 Binary files /dev/null and b/lib/castor-1.3.2-core.jar differ diff --git a/lib/castor-1.3.2-xml-schema.jar b/lib/castor-1.3.2-xml-schema.jar new file mode 100644 index 0000000..22b1b70 Binary files /dev/null and b/lib/castor-1.3.2-xml-schema.jar differ diff --git a/lib/castor-1.3.2-xml.jar b/lib/castor-1.3.2-xml.jar new file mode 100644 index 0000000..ef10b54 Binary files /dev/null and b/lib/castor-1.3.2-xml.jar differ diff --git a/lib/castor-core.jar b/lib/castor-core.jar deleted file mode 100755 index 03ff0b2..0000000 Binary files a/lib/castor-core.jar and /dev/null differ diff --git a/lib/castor-xml-schema.jar b/lib/castor-xml-schema.jar deleted file mode 100755 index 9dc9c00..0000000 Binary files a/lib/castor-xml-schema.jar and /dev/null differ diff --git a/lib/castor-xml.jar b/lib/castor-xml.jar deleted file mode 100755 index 8bf7639..0000000 Binary files a/lib/castor-xml.jar and /dev/null differ diff --git a/lib/commons-lang-2.6.jar b/lib/commons-lang-2.6.jar new file mode 100644 index 0000000..98467d3 Binary files /dev/null and b/lib/commons-lang-2.6.jar differ diff --git a/lib/commons-logging-1.1.1.jar b/lib/commons-logging-1.1.1.jar new file mode 100644 index 0000000..8758a96 Binary files /dev/null and b/lib/commons-logging-1.1.1.jar differ diff --git a/lib/commons-logging.jar b/lib/commons-logging.jar deleted file mode 100755 index b73a80f..0000000 Binary files a/lib/commons-logging.jar and /dev/null differ diff --git a/source/com/c2kernel/entity/proxy/AgentProxy.java b/source/com/c2kernel/entity/proxy/AgentProxy.java index f2e8283..72ed088 100644 --- a/source/com/c2kernel/entity/proxy/AgentProxy.java +++ b/source/com/c2kernel/entity/proxy/AgentProxy.java @@ -272,14 +272,14 @@ public class AgentProxy extends EntityProxy /** Let scripts resolve items */ public ItemProxy searchItem(String name) throws ObjectNotFoundException { - Enumeration results = Gateway.getLDAPLookup().search(new DomainPath(""),name); + Enumeration results = Gateway.getLDAPLookup().search(new DomainPath(""),name); Path returnPath = null; if (!results.hasMoreElements()) throw new ObjectNotFoundException(name, ""); while(results.hasMoreElements()) { - Path nextMatch = (Path)results.nextElement(); + Path nextMatch = results.nextElement(); if (returnPath != null && nextMatch.getSysKey() != -1 && returnPath.getSysKey() != nextMatch.getSysKey()) throw new ObjectNotFoundException("Too many items with that name"); returnPath = nextMatch; diff --git a/source/com/c2kernel/entity/proxy/EntityProxyManager.java b/source/com/c2kernel/entity/proxy/EntityProxyManager.java index 8ad4576..192a984 100644 --- a/source/com/c2kernel/entity/proxy/EntityProxyManager.java +++ b/source/com/c2kernel/entity/proxy/EntityProxyManager.java @@ -47,9 +47,9 @@ public class EntityProxyManager { Logger.msg(5, "EntityProxyManager - Starting....."); - Enumeration servers = Gateway.getLDAPLookup().searchEntities(new DomainPath("/servers")); + Enumeration servers = Gateway.getLDAPLookup().searchEntities(new DomainPath("/servers")); while(servers.hasMoreElements()) { - Path thisServerPath = (Path)servers.nextElement(); + Path thisServerPath = servers.nextElement(); try { int syskey = thisServerPath.getSysKey(); String remoteServer = ((Property)Gateway.getStorage().get(syskey, ClusterStorage.PROPERTY+"/Name", null)).getValue(); diff --git a/source/com/c2kernel/entity/proxy/ProxyMessage.java b/source/com/c2kernel/entity/proxy/ProxyMessage.java index b312a44..62866eb 100644 --- a/source/com/c2kernel/entity/proxy/ProxyMessage.java +++ b/source/com/c2kernel/entity/proxy/ProxyMessage.java @@ -2,7 +2,6 @@ package com.c2kernel.entity.proxy; import java.io.IOException; import java.net.DatagramPacket; -import java.net.InetAddress; import java.util.StringTokenizer; import com.c2kernel.common.InvalidDataException; @@ -92,14 +91,6 @@ public class ProxyMessage { public String toString() { return sysKey+":"+(state?"-":"")+path; } - public DatagramPacket getPacket(ProxySubscriber host) { - return getPacket(host.getHost(), host.getPort()); - } - - public DatagramPacket getPacket(InetAddress host, int port) { - byte[] packetString = toString().getBytes(); - return new DatagramPacket(packetString, packetString.length, host, port); - } public String getServer() { return server; diff --git a/source/com/c2kernel/entity/proxy/ProxySubscriber.java b/source/com/c2kernel/entity/proxy/ProxySubscriber.java deleted file mode 100644 index 8cb85fa..0000000 --- a/source/com/c2kernel/entity/proxy/ProxySubscriber.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.c2kernel.entity.proxy; - -import java.net.DatagramPacket; -import java.net.InetAddress; -import java.util.ArrayList; - -import com.c2kernel.common.InvalidDataException; - -/************************************************************************** - * - * $Revision: 1.1 $ - * $Date: 2003/04/24 10:12:40 $ - * - * Copyright (C) 2003 CERN - European Organization for Nuclear Research - * All rights reserved. - **************************************************************************/ - -public class ProxySubscriber { - - private InetAddress host; - private int port; - public ArrayList sysKeys = new ArrayList(); - - public ProxySubscriber(DatagramPacket packet) throws InvalidDataException { - host = packet.getAddress(); - port = packet.getPort(); - } - - public InetAddress getHost() { - return host; - } - - public int getPort() { - return port; - } -} diff --git a/source/com/c2kernel/entity/transfer/TransferItem.java b/source/com/c2kernel/entity/transfer/TransferItem.java index 9234650..0e3b764 100644 --- a/source/com/c2kernel/entity/transfer/TransferItem.java +++ b/source/com/c2kernel/entity/transfer/TransferItem.java @@ -10,6 +10,7 @@ import com.c2kernel.entity.TraceableEntity; import com.c2kernel.lifecycle.instance.Workflow; import com.c2kernel.lookup.DomainPath; import com.c2kernel.lookup.EntityPath; +import com.c2kernel.lookup.Path; import com.c2kernel.persistency.ClusterStorage; import com.c2kernel.persistency.outcome.Outcome; import com.c2kernel.process.Gateway; @@ -37,7 +38,7 @@ public class TransferItem { this.sysKey = sysKey; domainPaths = new ArrayList(); Property name = (Property)Gateway.getStorage().get(sysKey, ClusterStorage.PROPERTY + "/Name", null); - Enumeration paths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue()); + Enumeration paths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue()); while (paths.hasMoreElements()) { DomainPath thisPath = (DomainPath)paths.nextElement(); domainPaths.add(thisPath.toString()); @@ -73,10 +74,9 @@ public class TransferItem { } // retrieve objects - ArrayList objectFiles = FileStringUtility.listDir(dir.getCanonicalPath(), false, true); + ArrayList objectFiles = FileStringUtility.listDir(dir.getCanonicalPath(), false, true); ArrayList objects = new ArrayList(); - for (Object name : objectFiles) { - String element = (String)name; + for (String element : objectFiles) { String xmlFile = FileStringUtility.file2String(element); C2KLocalObject newObj; String choppedPath = element.substring(dir.getCanonicalPath().length()+1, element.length()-4); diff --git a/source/com/c2kernel/gui/data/NodeCollection.java b/source/com/c2kernel/gui/data/NodeCollection.java index f55f8cd..ceee16f 100644 --- a/source/com/c2kernel/gui/data/NodeCollection.java +++ b/source/com/c2kernel/gui/data/NodeCollection.java @@ -16,7 +16,7 @@ import com.c2kernel.utils.Logger; public class NodeCollection extends Node { ItemProxy parent; - Parent2ChildCollection thisCollection; + Parent2ChildCollection thisCollection; String path; public NodeCollection(ItemProxy parent, String name, EntityTabManager desktop) { @@ -32,7 +32,7 @@ public class NodeCollection extends Node { public void loadChildren() { Logger.msg(8, "NodeCollection::loadChildren()"); try { - thisCollection = (Parent2ChildCollection)parent.getObject("Collection/"+name); + thisCollection = (Parent2ChildCollection)parent.getObject("Collection/"+name); } catch (ObjectNotFoundException ex) { end(false); return; @@ -41,10 +41,10 @@ public class NodeCollection extends Node { this.type = thisCollection.getClass().getName(); int lastDot = this.type.lastIndexOf('.'); if (lastDot > -1) this.type = this.type.substring(lastDot+1); - ArrayList collectionMembers = thisCollection.getMembers().list; + ArrayList collectionMembers = thisCollection.getMembers().list; for (int i=0; i children; + Enumeration children; public NodeContext(Path path, EntityTabManager desktop) { super(path, desktop); @@ -31,7 +31,7 @@ public class NodeContext extends Node implements DomainPathSubscriber { int batch = 75; while (children.hasMoreElements() && batch > 0) { - Path newPath = (Path)children.nextElement(); + Path newPath = children.nextElement(); if (newPath == null) break; Logger.msg(2, "Subscription.run() - new node: " + newPath ); add( newNode(newPath)); diff --git a/source/com/c2kernel/gui/tabs/CollectionPane.java b/source/com/c2kernel/gui/tabs/CollectionPane.java index 7511a97..a8abfcd 100644 --- a/source/com/c2kernel/gui/tabs/CollectionPane.java +++ b/source/com/c2kernel/gui/tabs/CollectionPane.java @@ -5,6 +5,7 @@ import javax.swing.JTabbedPane; import com.c2kernel.collection.Aggregation; import com.c2kernel.collection.Collection; +import com.c2kernel.collection.CollectionMember; import com.c2kernel.collection.Dependency; import com.c2kernel.entity.proxy.EntityProxyObserver; import com.c2kernel.entity.proxy.ItemProxy; @@ -19,7 +20,7 @@ import com.c2kernel.utils.Logger; * @version $Revision: 1.36 $ $Date: 2005/10/06 06:51:15 $ * @author $Author: abranson $ */ -public class CollectionPane extends EntityTabPane implements EntityProxyObserver> +public class CollectionPane extends EntityTabPane implements EntityProxyObserver> { JTabbedPane collTabs; @@ -30,16 +31,22 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver } @Override - public void add(Collection contents) + public void add(Collection contents) { Logger.msg(5, "Got "+contents.getName()+": "+contents.getClass().getName()); Logger.msg(7, "Looking for existing "+contents.getName()); - CollectionView thisCollView = findTabForCollName(contents.getName()); + CollectionView thisCollView = findTabForCollName(contents.getName()); if (thisCollView == null){ - if (contents instanceof Aggregation) - thisCollView = new AggregationView(); - else if (contents instanceof Dependency) - thisCollView = new DependencyView(); + if (contents instanceof Aggregation) { + AggregationView thisAggView = new AggregationView(); + thisAggView.setCollection((Aggregation)contents); + thisCollView = thisAggView; + } + else if (contents instanceof Dependency) { + DependencyView thisDepView = new DependencyView(); + thisDepView.setCollection((Dependency)contents); + thisCollView = thisDepView; + } else { Logger.error("Collection type "+contents.getClass().getName()+" not known"); return; @@ -48,7 +55,6 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver thisCollView.setItem((ItemProxy)sourceEntity.getEntity()); collTabs.add(contents.getName(), thisCollView); } - thisCollView.setCollection(contents); } @Override @@ -57,12 +63,12 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver } - private CollectionView findTabForCollName(String collName) { - CollectionView thisCollView = null; + private CollectionView findTabForCollName(String collName) { + CollectionView thisCollView = null; for (int i = 0; i < collTabs.getTabCount(); i++) { String tabName = collTabs.getTitleAt(i); if (tabName.equals(collName)) { - thisCollView = (CollectionView)collTabs.getComponentAt(i); + thisCollView = (CollectionView)collTabs.getComponentAt(i); } } return thisCollView; diff --git a/source/com/c2kernel/gui/tabs/ViewpointPane.java b/source/com/c2kernel/gui/tabs/ViewpointPane.java index a0f63ab..a793e5d 100644 --- a/source/com/c2kernel/gui/tabs/ViewpointPane.java +++ b/source/com/c2kernel/gui/tabs/ViewpointPane.java @@ -441,7 +441,7 @@ public class ViewpointPane extends EntityTabPane implements ItemListener, Action // we don't really remove viewpoints } - class EventItem implements Comparable { + class EventItem implements Comparable { public int eventId; public int schemaVersion; public ArrayList viewNames = new ArrayList(); @@ -500,12 +500,9 @@ public class ViewpointPane extends EntityTabPane implements ItemListener, Action } @Override - public int compareTo(Object o) { - if (o instanceof EventItem) { - EventItem other = (EventItem)o; - if (other.eventId < eventId) return 1; - if (other.eventId > eventId) return -1; - } + public int compareTo(EventItem other) { + if (other.eventId < eventId) return 1; + if (other.eventId > eventId) return -1; return 0; } } diff --git a/source/com/c2kernel/gui/tabs/collection/AggregationView.java b/source/com/c2kernel/gui/tabs/collection/AggregationView.java index 3291906..35cdb11 100644 --- a/source/com/c2kernel/gui/tabs/collection/AggregationView.java +++ b/source/com/c2kernel/gui/tabs/collection/AggregationView.java @@ -7,6 +7,7 @@ import javax.swing.JButton; import javax.swing.JSplitPane; import com.c2kernel.collection.Aggregation; +import com.c2kernel.collection.AggregationMember; import com.c2kernel.collection.Collection; import com.c2kernel.collection.gui.model.AggregationVertexFactory; import com.c2kernel.collection.gui.model.AggregationVertexOutlineCreator; @@ -22,7 +23,7 @@ import com.c2kernel.utils.Resource; * @version $Revision: 1.5 $ $Date: 2006/09/15 15:02:24 $ * @author $Author: abranson $ */ -public class AggregationView extends CollectionView +public class AggregationView extends CollectionView { protected JButton mSaveButton = new JButton(Resource.getImageResource("graph/save.png")); protected JButton mHistoryButton = new JButton(Resource.getImageResource("graph/history.png")); @@ -32,8 +33,8 @@ public class AggregationView extends CollectionView // Objects to view/modify the properties of the selected activity protected PropertyPanel mPropertyPanel; protected JSplitPane mSplitPane; - private AggregationVertexFactory mAggregationVertexFactory = new AggregationVertexFactory(); - private AggregationMemberRenderer mAggregationMemberRenderer = new AggregationMemberRenderer(); + private final AggregationVertexFactory mAggregationVertexFactory = new AggregationVertexFactory(); + private final AggregationMemberRenderer mAggregationMemberRenderer = new AggregationMemberRenderer(); public AggregationView() { super(); @@ -48,7 +49,7 @@ public class AggregationView extends CollectionView } @Override - public void setCollection(Collection contents) + public void setCollection(Collection contents) { thisColl = contents; Aggregation agg = (Aggregation)thisColl; @@ -82,7 +83,7 @@ public class AggregationView extends CollectionView @Override public void actionPerformed(ActionEvent ae) { - new CollectionHistoryWindow(item, thisColl); + new CollectionHistoryWindow(item, (Aggregation)thisColl); } }); } diff --git a/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java b/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java index 7cb2753..0f3cc76 100644 --- a/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java +++ b/source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java @@ -10,6 +10,7 @@ import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.AbstractTableModel; +import com.c2kernel.collection.Aggregation; import com.c2kernel.collection.Collection; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.proxy.EntityProxy; @@ -33,7 +34,7 @@ public class CollectionHistoryWindow extends JFrame { JTable historyTable; HistoryTableModel historyModel; - public CollectionHistoryWindow(ItemProxy item, Collection coll) throws HeadlessException { + public CollectionHistoryWindow(ItemProxy item, Aggregation coll) throws HeadlessException { super("Collection History"); historyModel = new HistoryTableModel(item, coll); historyTable = new JTable(historyModel); @@ -48,12 +49,13 @@ public class CollectionHistoryWindow extends JFrame { private class HistoryTableModel extends AbstractTableModel implements EntityProxyObserver { ItemProxy item; - ArrayList collEvents, collEventData; - Collection coll; - public HistoryTableModel(ItemProxy item, Collection coll) { + ArrayList collEvents; + ArrayList collEventData; + Aggregation coll; + public HistoryTableModel(ItemProxy item, Aggregation coll) { this.item = item; this.coll = coll; - collEvents = new ArrayList(); + collEvents = new ArrayList(); collEventData = new ArrayList(); item.subscribe(new MemberSubscription(this, ClusterStorage.HISTORY, true)); } @@ -78,7 +80,7 @@ public class CollectionHistoryWindow extends JFrame { } @Override public Object getValueAt(int rowIndex, int columnIndex) { - Event ev = (Event)collEvents.get(rowIndex); + Event ev = collEvents.get(rowIndex); switch (columnIndex) { case 0: return ev.getTimeString(); @@ -165,8 +167,8 @@ public class CollectionHistoryWindow extends JFrame { if (e.getClickCount()==2) { int row = historyTable.getSelectedRow(); Object data = historyModel.getEventData(row); - if (data instanceof Collection) { - showColl((Collection)data); + if (data instanceof Aggregation) { + showColl((Aggregation)data); } else { String[] params = (String[])data; @@ -177,7 +179,7 @@ public class CollectionHistoryWindow extends JFrame { } } } - public void showColl(Collection coll) { + public void showColl(Aggregation coll) { JFrame newFrame = new JFrame(); AggregationView newView = new AggregationView(); newView.setCollection(coll); diff --git a/source/com/c2kernel/gui/tabs/collection/CollectionView.java b/source/com/c2kernel/gui/tabs/collection/CollectionView.java index 8a97af5..c698430 100644 --- a/source/com/c2kernel/gui/tabs/collection/CollectionView.java +++ b/source/com/c2kernel/gui/tabs/collection/CollectionView.java @@ -3,6 +3,7 @@ package com.c2kernel.gui.tabs.collection; import javax.swing.JPanel; import com.c2kernel.collection.Collection; +import com.c2kernel.collection.CollectionMember; import com.c2kernel.entity.proxy.ItemProxy; import com.c2kernel.gui.MainFrame; import com.c2kernel.utils.Logger; @@ -17,9 +18,9 @@ import com.c2kernel.utils.Logger; **************************************************************************/ -public abstract class CollectionView extends JPanel { +public abstract class CollectionView extends JPanel { - protected Collection thisColl; + protected Collection thisColl; protected ItemProxy item; public CollectionView() { @@ -30,7 +31,7 @@ public abstract class CollectionView extends JPanel { this.item = entity; } - public abstract void setCollection(Collection coll); + public abstract void setCollection(Collection coll); protected void saveCollection() { diff --git a/source/com/c2kernel/gui/tabs/collection/DependencyView.java b/source/com/c2kernel/gui/tabs/collection/DependencyView.java index 14e2af0..734d315 100644 --- a/source/com/c2kernel/gui/tabs/collection/DependencyView.java +++ b/source/com/c2kernel/gui/tabs/collection/DependencyView.java @@ -4,11 +4,12 @@ import java.awt.GridLayout; import javax.swing.JLabel; import com.c2kernel.collection.Collection; +import com.c2kernel.collection.DependencyMember; /** * @version $Revision: 1.2 $ $Date: 2005/06/02 12:17:22 $ * @author $Author: abranson $ */ -public class DependencyView extends CollectionView +public class DependencyView extends CollectionView { // Objects to view/modify the properties of the selected activity @@ -20,7 +21,7 @@ public class DependencyView extends CollectionView } @Override - public void setCollection(Collection contents) + public void setCollection(Collection contents) { thisColl = contents; } diff --git a/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java b/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java index b6ef7f8..73e9612 100644 --- a/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java +++ b/source/com/c2kernel/gui/tabs/execution/ActivityViewer.java @@ -43,7 +43,7 @@ public class ActivityViewer extends JPanel implements Runnable { JLabel noOutcome = new JLabel(Language.translate("No outcome data is required for this activity")); ExecutionPane parent; JLabel status; - JComboBox executors; + JComboBox executors; JButton saveButton = new JButton("Save"); JButton loadButton = new JButton("Load"); GridBagLayout gridbag = new GridBagLayout(); diff --git a/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java b/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java index 7477ecd..3bfe3fd 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java @@ -3,7 +3,6 @@ import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; -import java.util.ArrayList; import javax.swing.JLabel; import javax.swing.JTabbedPane; @@ -25,7 +24,6 @@ public class DataRecord extends OutcomeStructure implements ChangeListener { AttributeList myAttributes; JTabbedPane DRPanel = null; boolean deferred; - ArrayList deferredChildren = new ArrayList(); Document parentDoc; GridBagConstraints position; GridBagLayout gridbag; diff --git a/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java b/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java index 6d20183..63c1d3d 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java @@ -6,7 +6,6 @@ import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.net.URL; -import java.util.Enumeration; import javax.swing.Box; import javax.swing.JComponent; @@ -275,9 +274,9 @@ public class OutcomePanel extends JPanel implements OutcomeHandler ElementDecl rootElementDecl = null; docElement = (outcomeDOM == null) ? null : outcomeDOM.getDocumentElement(); - for (Enumeration globalElements = schemaSOM.getElementDecls(); globalElements.hasMoreElements();) + for (ElementDecl elementDecl: schemaSOM.getElementDecls()) { - rootElementDecl = (ElementDecl) globalElements.nextElement(); + rootElementDecl = elementDecl; // REVISIT: We don't detect which is the most likely root element if there is more than one root decl // xmlspy looks for an element not referenced elsewhere. simple but hard // if we already have a document then use its root element to find the right decl diff --git a/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java b/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java index ef56046..58b2c37 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java @@ -86,9 +86,9 @@ public class ComboField extends StringEditField { // TODO: should be ANDed with above results if (content.hasFacet(Facet.ENUMERATION)) { //ListOfValues andList = new ListOfValues(); - Enumeration enums = content.getFacets(Facet.ENUMERATION); + Enumeration enums = content.getFacets(Facet.ENUMERATION); while (enums.hasMoreElements()) { - Facet thisEnum = (Facet)enums.nextElement(); + Facet thisEnum = enums.nextElement(); vals.put(thisEnum.getValue(), thisEnum.getValue(), false); } } diff --git a/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java b/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java index a9b55a4..5f6a384 100644 --- a/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java +++ b/source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java @@ -62,12 +62,12 @@ public class StringEditField implements FocusListener, DomainKeyConsumer { // is a combobox if (type.hasFacet(Facet.ENUMERATION)) return new ComboField(type, null); - //find LOVscript - Enumeration e = type.getAnnotations(); + //find LOVscript TODO: Implement LOV + Enumeration e = type.getAnnotations(); while (e.hasMoreElements()) { - Annotation note = (Annotation)e.nextElement(); - for (Enumeration f = note.getAppInfo(); f.hasMoreElements();) { - AppInfo thisAppInfo = (AppInfo)f.nextElement(); + Annotation note = e.nextElement(); + for (Enumeration f = note.getAppInfo(); f.hasMoreElements();) { + AppInfo thisAppInfo = f.nextElement(); for (Enumeration g = thisAppInfo.getObjects(); g.hasMoreElements();) { AnyNode appInfoNode = (AnyNode)g.nextElement(); if (appInfoNode.getLocalName().equals("ScriptList") diff --git a/source/com/c2kernel/lifecycle/instance/JobPusher.java b/source/com/c2kernel/lifecycle/instance/JobPusher.java index c6e5d26..5b8be63 100644 --- a/source/com/c2kernel/lifecycle/instance/JobPusher.java +++ b/source/com/c2kernel/lifecycle/instance/JobPusher.java @@ -26,18 +26,18 @@ final class JobPusher extends Thread { public void run() { Thread.currentThread().setName("Agent job pusher for "+activity.getName()+" to role "+myRole); - for (Enumeration e = myRole.getChildren(); e.hasMoreElements();) + for (Enumeration e = myRole.getChildren(); e.hasMoreElements();) { - AgentPath nextAgent = (AgentPath)e.nextElement(); + AgentPath nextAgent = e.nextElement(); Logger.msg(7, "Activity.pushJobsToAgents() - Calculating jobs for " + nextAgent.getAgentName()); try { // get joblist for user JobArrayList jobList = new JobArrayList(this.activity.calculateJobs(nextAgent, false)); // only transmit start, complete and resume jobs - for (Iterator element = jobList.list.iterator(); element.hasNext();) + for (Iterator element = jobList.list.iterator(); element.hasNext();) { - Job thisJob = (Job) element.next(); + Job thisJob = element.next(); if (thisJob.getPossibleTransition() != Transitions.START && thisJob.getPossibleTransition() != Transitions.COMPLETE && thisJob.getPossibleTransition() != Transitions.RESUME diff --git a/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java b/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java index 40fe740..0ad5adc 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java @@ -57,7 +57,7 @@ public class AssignItemToSlot extends PredefinedStep String collName; int slotNo; int entityKey; - Collection coll; + Collection coll; Logger.msg(1, "AssignItemToSlot::request() - Starting."); @@ -76,7 +76,7 @@ public class AssignItemToSlot extends PredefinedStep // load collection try { - coll = (Collection)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null); + coll = (Collection)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null); } catch (Exception e) { Logger.error(e); throw new InvalidDataException("Error loading collection "+collName, ""); diff --git a/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java b/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java index ad92052..7faee59 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java @@ -88,15 +88,15 @@ public class CreateItemFromDescription extends PredefinedStep // loop through collections to instantiate for (String collName : collNames) { - Collection thisCol = (Collection)storage.get(myPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null); + Collection thisCol = (Collection)storage.get(myPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null); if (thisCol instanceof CollectionDescription) { - CollectionDescription thisDesc = (CollectionDescription)thisCol; + CollectionDescription thisDesc = (CollectionDescription)thisCol; collections.add(CastorXMLUtility.marshall(thisDesc.newInstance())); } else if (thisCol.getName().equals("Workflow") && wfDefName == null) { - ArrayList members = thisCol.getMembers().list; + ArrayList members = thisCol.getMembers().list; // get the first member from the wf collection - CollectionMember wfMember = (CollectionMember)members.get(0); + CollectionMember wfMember = members.get(0); wfDefName = wfMember.resolveEntity().getName(); } } diff --git a/source/com/c2kernel/lifecycle/instance/predefined/Erase.java b/source/com/c2kernel/lifecycle/instance/predefined/Erase.java index 07d76b1..ffdb07c 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/Erase.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/Erase.java @@ -21,6 +21,7 @@ import com.c2kernel.common.InvalidTransitionException; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.DomainPath; import com.c2kernel.lookup.EntityPath; +import com.c2kernel.lookup.Path; import com.c2kernel.persistency.ClusterStorage; import com.c2kernel.process.Gateway; import com.c2kernel.property.Property; @@ -57,7 +58,7 @@ public class Erase extends PredefinedStep Property name = (Property)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.PROPERTY+"/Name", null); // get all domain paths - Enumeration domPaths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue()); + Enumeration domPaths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue()); while (domPaths.hasMoreElements()) { DomainPath path = (DomainPath)domPaths.nextElement(); // delete them diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java index 073d662..2de12e0 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java @@ -5,12 +5,12 @@ import java.util.ArrayList; public class Aggregation implements java.io.Serializable { public boolean isDescription; - public ArrayList aggregationMemberList; + public ArrayList aggregationMemberList; public String name; public Aggregation() { super(); - aggregationMemberList = new ArrayList(); + aggregationMemberList = new ArrayList(); } public Aggregation(String name, boolean isDescription) { diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java index 311c108..dc31c73 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java @@ -11,11 +11,11 @@ public class Dependency implements java.io.Serializable { public String name; public boolean isDescription; public String itemDescriptionPath; - public ArrayList dependencyMemberList; + public ArrayList dependencyMemberList; public Dependency() { super(); - dependencyMemberList = new ArrayList(); + dependencyMemberList = new ArrayList(); } public Dependency(String itemDesc) { @@ -32,8 +32,7 @@ public class Dependency implements java.io.Serializable { PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getSysKey()); //TODO: set props and class identifiers } - for (Object name2 : dependencyMemberList) { - DependencyMember thisMem = (DependencyMember) name2; + for (DependencyMember thisMem : dependencyMemberList) { int syskey = new DomainPath(thisMem.itemPath).getSysKey(); if (syskey == -1) throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection."); diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java index 30b80c4..540a6fc 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java @@ -21,11 +21,11 @@ public class NewAgent implements java.io.Serializable { public String password; - public ArrayList roles; + public ArrayList roles; public NewAgent() { super(); - roles = new ArrayList(); + roles = new ArrayList(); } public NewAgent(String name, String password) { @@ -49,8 +49,7 @@ public class NewAgent implements java.io.Serializable { Logger.error(ex); throw new CannotManageException("Error initialising new agent"); } - for (Object name2 : roles) { - String role = (String) name2; + for (String role : roles) { RolePath thisRole; try { thisRole = Gateway.getLDAPLookup().getRoleManager().getRolePath(role); diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java index 339e294..5666a00 100644 --- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java +++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java @@ -47,19 +47,19 @@ public class NewItem { /** * Field _aggregationList */ - public ArrayList aggregationList; + public ArrayList aggregationList; /** * Field _dependencyList */ - public ArrayList dependencyList; + public ArrayList dependencyList; public NewItem() { super(); propertyList = new ArrayList(); - aggregationList = new ArrayList(); - dependencyList = new ArrayList(); + aggregationList = new ArrayList(); + dependencyList = new ArrayList(); } public NewItem(String name, String initialPath, String wf) { @@ -113,8 +113,7 @@ public class NewItem { // create collections - for (Object name2 : dependencyList) { - Dependency element = (Dependency) name2; + for (Dependency element: dependencyList) { try { Gateway.getStorage().put(entPath.getSysKey(), element.create(), null); } catch (ClusterStorageException ex) { @@ -126,8 +125,7 @@ public class NewItem { } } - for (Object name2 : aggregationList) { - Aggregation element = (Aggregation) name2; + for (Aggregation element : aggregationList) { try { Gateway.getStorage().put(entPath.getSysKey(), element.create(), null); } catch (ClusterStorageException ex) { diff --git a/source/com/c2kernel/lookup/LDAPRoleManager.java b/source/com/c2kernel/lookup/LDAPRoleManager.java index 1df2f29..0536d6c 100644 --- a/source/com/c2kernel/lookup/LDAPRoleManager.java +++ b/source/com/c2kernel/lookup/LDAPRoleManager.java @@ -28,8 +28,8 @@ public class LDAPRoleManager { * */ LDAPLookup mLdap; - private String mRolePath; - private String mEntityPath; + private final String mRolePath; + private final String mEntityPath; public LDAPRoleManager(LDAPLookup ldap, String rolePath, String entityPath) { super(); @@ -100,8 +100,7 @@ public class LDAPRoleManager { LDAPSearchConstraints searchCons = new LDAPSearchConstraints(); searchCons.setBatchSize(0); searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER ); - Enumeration roles = mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons); - return roles.hasMoreElements(); + return mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons).hasMoreElements(); } protected AgentPath[] getAgents(RolePath role) @@ -171,10 +170,10 @@ public class LDAPRoleManager { searchCons.setBatchSize(0); searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER ); String filter = "(&(objectclass=cristalagent)(uid="+agentName+"))"; - Enumeration res = mLdap.search(mEntityPath,LDAPConnection.SCOPE_SUB,filter,searchCons); + Enumeration res = mLdap.search(mEntityPath,LDAPConnection.SCOPE_SUB,filter,searchCons); if (!res.hasMoreElements()) throw new ObjectNotFoundException("Agent not found"); - Path result = (Path)res.nextElement(); + Path result = res.nextElement(); if (result instanceof AgentPath) return (AgentPath)result; else @@ -187,10 +186,10 @@ public class LDAPRoleManager { searchCons.setBatchSize(0); searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER ); String filter = "(&(objectclass=cristalrole)(cn="+roleName+"))"; - Enumeration res = mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons); + Enumeration res = mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons); if (!res.hasMoreElements()) throw new ObjectNotFoundException("Role not found"); - Path result = (Path)res.nextElement(); + Path result = res.nextElement(); if (result instanceof RolePath) return (RolePath)result; else diff --git a/source/com/c2kernel/lookup/Path.java b/source/com/c2kernel/lookup/Path.java index 4966d1e..16d4f07 100644 --- a/source/com/c2kernel/lookup/Path.java +++ b/source/com/c2kernel/lookup/Path.java @@ -259,7 +259,7 @@ public abstract class Path implements Serializable return mSysKey; } - public Enumeration getChildren() { + public Enumeration getChildren() { String filter = "objectclass=*"; LDAPSearchConstraints searchCons = new LDAPSearchConstraints(); searchCons.setBatchSize(10); @@ -268,9 +268,9 @@ public abstract class Path implements Serializable } public Path find(String name) throws ObjectNotFoundException { - Enumeration e = Gateway.getLDAPLookup().search(this, name); + Enumeration e = Gateway.getLDAPLookup().search(this, name); if (e.hasMoreElements()) { - Path thisPath =(Path)e.nextElement(); + Path thisPath = e.nextElement(); if (e.hasMoreElements()) throw new ObjectNotFoundException("More than one match for "+name, ""); return thisPath; diff --git a/source/com/c2kernel/persistency/ClusterStorageManager.java b/source/com/c2kernel/persistency/ClusterStorageManager.java index 5ce8d06..b4515e0 100644 --- a/source/com/c2kernel/persistency/ClusterStorageManager.java +++ b/source/com/c2kernel/persistency/ClusterStorageManager.java @@ -283,10 +283,10 @@ public class ClusterStorageManager { Logger.msg(7, "CSM.clearCache() - removing "+sysKeyIntObj+"/"+path); if (memoryCache.containsKey(sysKeyIntObj)) { - SoftCache sysKeyMemCache = memoryCache.get(sysKeyIntObj); + SoftCache sysKeyMemCache = memoryCache.get(sysKeyIntObj); synchronized(sysKeyMemCache) { - for (Iterator iter = sysKeyMemCache.keySet().iterator(); iter.hasNext();) { - String thisPath = (String)iter.next(); + for (Iterator iter = sysKeyMemCache.keySet().iterator(); iter.hasNext();) { + String thisPath = iter.next(); if (thisPath.startsWith(path)) { Logger.msg(7, "CSM.clearCache() - removing "+sysKeyIntObj+"/"+thisPath); iter.remove(); diff --git a/source/com/c2kernel/persistency/TransactionManager.java b/source/com/c2kernel/persistency/TransactionManager.java index 6517d8b..6f930b7 100644 --- a/source/com/c2kernel/persistency/TransactionManager.java +++ b/source/com/c2kernel/persistency/TransactionManager.java @@ -65,9 +65,8 @@ public class TransactionManager { // check to see if the locker has been modifying this cluster synchronized(locks) { if (locks.containsKey(sysKeyIntObj) && locks.get(sysKeyIntObj).equals(locker)) { - ArrayList lockerTransaction = pendingTransactions.get(locker); - for (Object name : lockerTransaction) { - TransactionEntry thisEntry = (TransactionEntry)name; + ArrayList lockerTransaction = pendingTransactions.get(locker); + for (TransactionEntry thisEntry : lockerTransaction) { if (sysKey == thisEntry.sysKey.intValue() && path.equals(thisEntry.getPath())) { if (thisEntry.obj == null) throw new ClusterStorageException("ClusterStorageManager.get() - Cluster " + path + " has been deleted in " + sysKey + @@ -187,12 +186,11 @@ public class TransactionManager { */ public void commit(Object locker) { synchronized(locks) { - ArrayList lockerTransactions = pendingTransactions.get(locker); + ArrayList lockerTransactions = pendingTransactions.get(locker); HashMap exceptions = new HashMap(); // quit if no transactions are present; if (lockerTransactions == null) return; - for (Object name : lockerTransactions) { - TransactionEntry thisEntry = (TransactionEntry)name; + for (TransactionEntry thisEntry : lockerTransactions) { try { if (thisEntry.obj == null) storage.remove(thisEntry.sysKey, thisEntry.path); @@ -261,9 +259,8 @@ public class TransactionManager { else for (Object thisLocker : pendingTransactions.keySet()) { Logger.msg(logLevel, " Transaction owner:"+thisLocker); - ArrayList entries = pendingTransactions.get(thisLocker); - for (Object name : entries) { - TransactionEntry thisEntry = (TransactionEntry) name; + ArrayList entries = pendingTransactions.get(thisLocker); + for (TransactionEntry thisEntry : entries) { Logger.msg(logLevel, " "+thisEntry.toString()); } } diff --git a/source/com/c2kernel/persistency/XMLClusterStorage.java b/source/com/c2kernel/persistency/XMLClusterStorage.java index 277551d..5909fac 100644 --- a/source/com/c2kernel/persistency/XMLClusterStorage.java +++ b/source/com/c2kernel/persistency/XMLClusterStorage.java @@ -117,12 +117,12 @@ public class XMLClusterStorage extends ClusterStorage { String[] result = new String[0]; try { String filePath = getFilePath(sysKey, path); - ArrayList paths = FileStringUtility.listDir( filePath, true, false ); + ArrayList paths = FileStringUtility.listDir( filePath, true, false ); if (paths == null) return result; // dir doesn't exist yet ArrayList contents = new ArrayList(); String previous = null; for (int i=0; i en = Gateway.getLDAPLookup().search(getTypeRoot(itemType), itemName); + Enumeration en = Gateway.getLDAPLookup().search(getTypeRoot(itemType), itemName); ItemProxy thisProxy; if (!en.hasMoreElements()) { diff --git a/source/com/c2kernel/property/PropertyUtility.java b/source/com/c2kernel/property/PropertyUtility.java index 40d15bd..f8e714c 100644 --- a/source/com/c2kernel/property/PropertyUtility.java +++ b/source/com/c2kernel/property/PropertyUtility.java @@ -10,6 +10,7 @@ package com.c2kernel.property; import java.util.ArrayList; +import java.util.Iterator; import com.c2kernel.persistency.ClusterStorage; import com.c2kernel.persistency.outcome.Outcome; @@ -21,36 +22,32 @@ import com.c2kernel.utils.Logger; public class PropertyUtility { - static public String getValue(ArrayList pdlist, String name) + static public String getValue(ArrayList pdlist, String name) { - Object[] values = pdlist.toArray(); - for (Object value : values) { - PropertyDescription pd = (PropertyDescription) value; + for (PropertyDescription pd : pdlist) { if ( name.equalsIgnoreCase(pd.getName()) ) return pd.getDefaultValue(); } return null; } - static public String getNames(ArrayList pdlist) + static public String getNames(ArrayList pdlist) { - Object[] values = pdlist.toArray(); StringBuffer names = new StringBuffer(); - for (Object value : values) - names.append( ((PropertyDescription)value).getDefaultValue()).append(" "); + for (PropertyDescription value : pdlist) + names.append( value.getDefaultValue()).append(" "); return names.toString(); } - static public String getClassIdNames(ArrayList pdlist) + static public String getClassIdNames(ArrayList pdlist) { - Object[] values = pdlist.toArray(); StringBuffer names = new StringBuffer(); - for (int i=0;i iter = pdlist.iterator(); iter.hasNext();) { + PropertyDescription pd = iter.next(); if (pd.getIsClassIdentifier()) names.append(pd.getName()); - if (i { +public class GTimeStampComparator implements Comparator { @Override - public int compare(Object arg0, Object arg1) { - GTimeStamp t0 = (GTimeStamp)arg0; - GTimeStamp t1 = (GTimeStamp)arg1; + public int compare(GTimeStamp t0, GTimeStamp t1) { int retVal = compareInt(t0.mYear, t1.mYear); if (retVal == 0) retVal = compareInt(t0.mMonth, t1.mMonth); diff --git a/source/com/c2kernel/utils/SoftCache.java b/source/com/c2kernel/utils/SoftCache.java index 9c95f2e..ff71222 100644 --- a/source/com/c2kernel/utils/SoftCache.java +++ b/source/com/c2kernel/utils/SoftCache.java @@ -103,8 +103,8 @@ public class SoftCache extends AbstractMap { * Look for values that have been reaped, and remove their keys from the cache */ private void processQueue() { - SoftValue sv; - while ((sv = (SoftValue) queue.poll()) != null) { + SoftValue sv; + while ((sv = (SoftValue) queue.poll()) != null) { hash.remove(sv.key); } } -- cgit v1.2.3