summaryrefslogtreecommitdiff
path: root/source/com
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 16:08:49 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 16:08:49 +0200
commit379ed8a0e133bee650e0acb24f6b743f657a50d0 (patch)
treebdcac37cabe3f2f3d40715519b830469dc9e63ad /source/com
parent0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (diff)
Last bit of cleanup honest
New castor and dependent commons libs
Diffstat (limited to 'source/com')
-rw-r--r--source/com/c2kernel/entity/proxy/AgentProxy.java4
-rw-r--r--source/com/c2kernel/entity/proxy/EntityProxyManager.java4
-rw-r--r--source/com/c2kernel/entity/proxy/ProxyMessage.java9
-rw-r--r--source/com/c2kernel/entity/proxy/ProxySubscriber.java36
-rw-r--r--source/com/c2kernel/entity/transfer/TransferItem.java8
-rw-r--r--source/com/c2kernel/gui/data/NodeCollection.java8
-rw-r--r--source/com/c2kernel/gui/data/NodeContext.java4
-rw-r--r--source/com/c2kernel/gui/tabs/CollectionPane.java28
-rw-r--r--source/com/c2kernel/gui/tabs/ViewpointPane.java11
-rw-r--r--source/com/c2kernel/gui/tabs/collection/AggregationView.java11
-rw-r--r--source/com/c2kernel/gui/tabs/collection/CollectionHistoryWindow.java20
-rw-r--r--source/com/c2kernel/gui/tabs/collection/CollectionView.java7
-rw-r--r--source/com/c2kernel/gui/tabs/collection/DependencyView.java5
-rw-r--r--source/com/c2kernel/gui/tabs/execution/ActivityViewer.java2
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/DataRecord.java2
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/OutcomePanel.java5
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/field/ComboField.java4
-rw-r--r--source/com/c2kernel/gui/tabs/outcome/form/field/StringEditField.java10
-rw-r--r--source/com/c2kernel/lifecycle/instance/JobPusher.java8
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java4
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java8
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/Erase.java3
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java4
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java7
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java7
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java14
-rw-r--r--source/com/c2kernel/lookup/LDAPRoleManager.java15
-rw-r--r--source/com/c2kernel/lookup/Path.java6
-rw-r--r--source/com/c2kernel/persistency/ClusterStorageManager.java6
-rw-r--r--source/com/c2kernel/persistency/TransactionManager.java15
-rw-r--r--source/com/c2kernel/persistency/XMLClusterStorage.java4
-rw-r--r--source/com/c2kernel/process/Bootstrap.java3
-rw-r--r--source/com/c2kernel/property/PropertyUtility.java25
-rw-r--r--source/com/c2kernel/utils/GTimeStampComparator.java6
-rw-r--r--source/com/c2kernel/utils/SoftCache.java4
35 files changed, 133 insertions, 184 deletions
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<Path> 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<Path> 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<Object>();
-
- 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<String>();
Property name = (Property)Gateway.getStorage().get(sysKey, ClusterStorage.PROPERTY + "/Name", null);
- Enumeration<?> paths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue());
+ Enumeration<Path> 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<String> objectFiles = FileStringUtility.listDir(dir.getCanonicalPath(), false, true);
ArrayList<C2KLocalObject> objects = new ArrayList<C2KLocalObject>();
- 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<CollectionMember> 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<CollectionMember>)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<CollectionMember> collectionMembers = thisCollection.getMembers().list;
for (int i=0; i<collectionMembers.size(); i++)
{
- CollectionMember aMember = (CollectionMember)collectionMembers.get(i);
+ CollectionMember aMember = collectionMembers.get(i);
if (aMember!=null)
try
{
diff --git a/source/com/c2kernel/gui/data/NodeContext.java b/source/com/c2kernel/gui/data/NodeContext.java
index 9240af4..ded3dd4 100644
--- a/source/com/c2kernel/gui/data/NodeContext.java
+++ b/source/com/c2kernel/gui/data/NodeContext.java
@@ -11,7 +11,7 @@ import com.c2kernel.utils.Logger;
public class NodeContext extends Node implements DomainPathSubscriber {
- Enumeration<?> children;
+ Enumeration<? extends Path> 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<Collection<?>>
+public class CollectionPane extends EntityTabPane implements EntityProxyObserver<Collection<? extends CollectionMember>>
{
JTabbedPane collTabs;
@@ -30,16 +31,22 @@ public class CollectionPane extends EntityTabPane implements EntityProxyObserver
}
@Override
- public void add(Collection<?> contents)
+ public void add(Collection<? extends CollectionMember> contents)
{
Logger.msg(5, "Got "+contents.getName()+": "+contents.getClass().getName());
Logger.msg(7, "Looking for existing "+contents.getName());
- CollectionView thisCollView = findTabForCollName(contents.getName());
+ CollectionView<? extends CollectionMember> 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<? extends CollectionMember> findTabForCollName(String collName) {
+ CollectionView<? extends CollectionMember> 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<? extends CollectionMember>)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<Object> {
+ class EventItem implements Comparable<EventItem> {
public int eventId;
public int schemaVersion;
public ArrayList<String> viewNames = new ArrayList<String>();
@@ -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<AggregationMember>
{
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<AggregationMember> 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<Event> {
ItemProxy item;
- ArrayList<Object> collEvents, collEventData;
- Collection<?> coll;
- public HistoryTableModel(ItemProxy item, Collection<?> coll) {
+ ArrayList<Event> collEvents;
+ ArrayList<Object> collEventData;
+ Aggregation coll;
+ public HistoryTableModel(ItemProxy item, Aggregation coll) {
this.item = item;
this.coll = coll;
- collEvents = new ArrayList<Object>();
+ collEvents = new ArrayList<Event>();
collEventData = new ArrayList<Object>();
item.subscribe(new MemberSubscription<Event>(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<M extends CollectionMember> extends JPanel {
- protected Collection<?> thisColl;
+ protected Collection<M> 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<M> 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<DependencyMember>
{
// 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<DependencyMember> 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<Executor> 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<Object>();
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<Facet> 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<Annotation> 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<AppInfo> 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<AgentPath> 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<Job> 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<? extends CollectionMember> 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<? extends CollectionMember>)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<? extends CollectionMember> thisCol = (Collection<? extends CollectionMember>)storage.get(myPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
if (thisCol instanceof CollectionDescription) {
- CollectionDescription<?> thisDesc = (CollectionDescription<?>)thisCol;
+ CollectionDescription<? extends CollectionMember> thisDesc = (CollectionDescription<? extends CollectionMember>)thisCol;
collections.add(CastorXMLUtility.marshall(thisDesc.newInstance()));
}
else if (thisCol.getName().equals("Workflow") && wfDefName == null) {
- ArrayList<?> members = thisCol.getMembers().list;
+ ArrayList<? extends CollectionMember> 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<Path> 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<AggregationMember> aggregationMemberList;
public String name;
public Aggregation() {
super();
- aggregationMemberList = new ArrayList<Object>();
+ aggregationMemberList = new ArrayList<AggregationMember>();
}
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<DependencyMember> dependencyMemberList;
public Dependency() {
super();
- dependencyMemberList = new ArrayList<Object>();
+ dependencyMemberList = new ArrayList<DependencyMember>();
}
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<String> roles;
public NewAgent() {
super();
- roles = new ArrayList<Object>();
+ roles = new ArrayList<String>();
}
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<Aggregation> aggregationList;
/**
* Field _dependencyList
*/
- public ArrayList<?> dependencyList;
+ public ArrayList<Dependency> dependencyList;
public NewItem() {
super();
propertyList = new ArrayList<Property>();
- aggregationList = new ArrayList<Object>();
- dependencyList = new ArrayList<Object>();
+ aggregationList = new ArrayList<Aggregation>();
+ dependencyList = new ArrayList<Dependency>();
}
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<Path> 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<Path> 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<? extends Path> 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<Path> 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<String, C2KLocalObject> sysKeyMemCache = memoryCache.get(sysKeyIntObj);
synchronized(sysKeyMemCache) {
- for (Iterator<?> iter = sysKeyMemCache.keySet().iterator(); iter.hasNext();) {
- String thisPath = (String)iter.next();
+ for (Iterator<String> 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<TransactionEntry> 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<TransactionEntry> lockerTransactions = pendingTransactions.get(locker);
HashMap<TransactionEntry, Exception> exceptions = new HashMap<TransactionEntry, Exception>();
// 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<TransactionEntry> 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<String> paths = FileStringUtility.listDir( filePath, true, false );
if (paths == null) return result; // dir doesn't exist yet
ArrayList<String> contents = new ArrayList<String>();
String previous = null;
for (int i=0; i<paths.size(); i++) {
- String next = (String)paths.get(i);
+ String next = paths.get(i);
// trim off the xml from the end if it's there
if (next.endsWith(".xml")) next = next.substring(0, next.length()-4);
diff --git a/source/com/c2kernel/process/Bootstrap.java b/source/com/c2kernel/process/Bootstrap.java
index 6ffdd01..5011b7f 100644
--- a/source/com/c2kernel/process/Bootstrap.java
+++ b/source/com/c2kernel/process/Bootstrap.java
@@ -22,6 +22,7 @@ import com.c2kernel.lookup.AgentPath;
import com.c2kernel.lookup.DomainPath;
import com.c2kernel.lookup.EntityPath;
import com.c2kernel.lookup.LDAPLookup;
+import com.c2kernel.lookup.Path;
import com.c2kernel.lookup.RolePath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.outcome.Outcome;
@@ -140,7 +141,7 @@ public class Bootstrap
}
Logger.msg(1, "Bootstrap.verifyBootItems() - Verifying data of "+getDataType(itemType)+" "+itemName);
- Enumeration<?> en = Gateway.getLDAPLookup().search(getTypeRoot(itemType), itemName);
+ Enumeration<Path> 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<PropertyDescription> 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<PropertyDescription> 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<PropertyDescription> pdlist)
{
- Object[] values = pdlist.toArray();
StringBuffer names = new StringBuffer();
- for (int i=0;i<values.length;i++)
- {
- PropertyDescription pd = ((PropertyDescription)values[i]);
+
+ for (Iterator<PropertyDescription> iter = pdlist.iterator(); iter.hasNext();) {
+ PropertyDescription pd = iter.next();
if (pd.getIsClassIdentifier())
names.append(pd.getName());
- if (i<values.length-1 && i!=0)
+ if (iter.hasNext())
names.append(",");
}
return names.toString();
diff --git a/source/com/c2kernel/utils/GTimeStampComparator.java b/source/com/c2kernel/utils/GTimeStampComparator.java
index 3680a50..8701b0e 100644
--- a/source/com/c2kernel/utils/GTimeStampComparator.java
+++ b/source/com/c2kernel/utils/GTimeStampComparator.java
@@ -4,12 +4,10 @@ import java.util.Comparator;
import com.c2kernel.common.GTimeStamp;
-public class GTimeStampComparator implements Comparator<Object> {
+public class GTimeStampComparator implements Comparator<GTimeStamp> {
@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<K, V> extends AbstractMap<K, V> {
* 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<V> sv;
+ while ((sv = (SoftValue<V>) queue.poll()) != null) {
hash.remove(sv.key);
}
}