[DS-707] Style / readability

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5546 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Graham Triggs
2010-10-22 12:53:50 +00:00
parent bc9b9e4cac
commit 5c512c123c
52 changed files with 321 additions and 35 deletions

View File

@@ -124,7 +124,11 @@ public class MetadataExport
Collection[] collections = community.getCollections();
for (Collection collection : collections)
{
for (int i = 0; i < indent; i++) System.out.print(" ");
for (int i = 0; i < indent; i++)
{
System.out.print(" ");
}
ItemIterator items = collection.getAllItems();
while (items.hasNext())
{
@@ -141,7 +145,10 @@ public class MetadataExport
Community[] communities = community.getSubcommunities();
for (Community subCommunity : communities)
{
for (int i = 0; i < indent; i++) System.out.print(" ");
for (int i = 0; i < indent; i++)
{
System.out.print(" ");
}
buildFromCommunity(subCommunity, itemIDs, indent + 1);
}

View File

@@ -419,8 +419,10 @@ public class MediaFilterManager
Community[] topLevelCommunities = Community.findAllTop(c);
for(int i=0; i<topLevelCommunities.length; i++)
{
applyFiltersCommunity(c, topLevelCommunities[i]);
}
}
else
{
//otherwise, just find every item and process

View File

@@ -240,13 +240,17 @@ public class Packager
String pn[] = PluginManager
.getAllPluginNames(PackageIngester.class);
for (int i = 0; i < pn.length; ++i)
{
System.out.println(" " + pn[i]);
}
System.out
.println("\nAvailable Dissemination Package (DIP) types:");
pn = PluginManager.getAllPluginNames(PackageDisseminator.class);
for (int i = 0; i < pn.length; ++i)
{
System.out.println(" " + pn[i]);
}
}
System.exit(0);
}

View File

@@ -312,7 +312,9 @@ public class SyndicationFeed
{
List<String> creators = new ArrayList<String>();
for (DCValue author : dcAuthors)
{
creators.add(author.value);
}
dc.setCreators(creators);
}
}

View File

@@ -278,8 +278,10 @@ public class AuthenticationManager
EPerson eperson)
throws SQLException
{
for (int i = 0; i < methodStack.length; ++i)
methodStack[i].initEPerson(context, request, eperson);
for (AuthenticationMethod method : methodStack)
{
method.initEPerson(context, request, eperson);
}
}
/**
@@ -330,8 +332,10 @@ public class AuthenticationManager
for (int i = 0; i < gll.size(); ++i)
{
int gl[] = (int [])gll.get(i);
for (int j = 0; j < gl.length; ++j)
result[k++] = gl[j];
for (int aGl : gl)
{
result[k++] = aGl;
}
}
return result;
}

View File

@@ -281,18 +281,24 @@ public class ShibAuthentication implements AuthenticationMethod
// revert back to original entry when no mapping is provided
if (groupLabels == null)
{
groupLabels = affiliation;
}
String[] labels = groupLabels.split(",");
for (int i = 0; i < labels.length; i++)
{
addGroup(groups, context, labels[i].trim());
}
}
}
int ids[] = new int[groups.size()];
java.util.Iterator it = groups.iterator();
for (int i = 0; it.hasNext(); i++)
{
ids[i] = ((Integer) it.next()).intValue();
}
// store the special group, if already transformed from headers
// since subsequent header may not have the values anymore

View File

@@ -171,11 +171,17 @@ public class InstallItem
boolean identifierExists = false;
DCValue[] identifiers = item.getDC("identifier", "uri", Item.ANY);
for (DCValue identifier : identifiers)
{
if (handleref.equals(identifier.value))
{
identifierExists = true;
}
}
if (!identifierExists)
{
item.addDC("identifier", "uri", null, handleref);
}
}
// fill in metadata needed by new Item.
private static void populateMetadata(Context c, Item item, DCDate embargoLiftDate)

View File

@@ -188,9 +188,11 @@ public abstract class AbstractMETSDisseminator
throws IOException
{
for (InputStream is : extraFiles.values())
{
is.close();
}
}
}
/**
* Make a new unique ID symbol with specified prefix.

View File

@@ -293,8 +293,10 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
// NOTE: The AbstractPackageIngester itself will perform the
// recursive ingest call, based on these child pkg references
for (int i = 0; i < childFilePaths.length; i++)
{
addPackageReference(dso, childFilePaths[i]);
}
}
return dso;
}
@@ -1075,8 +1077,10 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
// NOTE: The AbstractPackageIngester itself will perform the
// recursive ingest call, based on these child pkg references.
for (int i = 0; i < childFilePaths.length; i++)
{
addPackageReference(dso, childFilePaths[i]);
}
}
return dso;
}

View File

@@ -146,30 +146,42 @@ public class DSpaceAIPIngester
if (userDmd != null && userDmd.length() > 0)
{
for (int i = 0; i < dmds.length; ++i)
{
if (userDmd.equalsIgnoreCase(manifest.getMdType(dmds[i])))
{
found = i;
}
}
}
// DIM is preferred, if nothing specified by user
if (found == -1)
{
// DIM is preferred for AIP
for (int i = 0; i < dmds.length; ++i)
{
//NOTE: METS standard actually says this should be DIM (all uppercase). But,
// just in case, we're going to be a bit more forgiving.
if ("DIM".equalsIgnoreCase(manifest.getMdType(dmds[i])))
{
found = i;
}
}
}
// MODS is acceptable otehrwise..
if (found == -1)
{
for (int i = 0; i < dmds.length; ++i)
{
//NOTE: METS standard actually says this should be MODS (all uppercase). But,
// just in case, we're going to be a bit more forgiving.
if ("MODS".equalsIgnoreCase(manifest.getMdType(dmds[i])))
{
found = i;
}
}
}
String groupID = null;
if (found >= 0)

View File

@@ -124,29 +124,41 @@ public class DSpaceMETSIngester
if (userDmd != null && userDmd.length() > 0)
{
for (int i = 0; i < dmds.length; ++i)
{
if (userDmd.equalsIgnoreCase(manifest.getMdType(dmds[i])))
{
found = i;
}
}
}
// MODS is preferred, if nothing specified by user
if (found == -1)
{
for (int i = 0; i < dmds.length; ++i)
{
//NOTE: METS standard actually says this should be MODS (all uppercase). But,
// just in case, we're going to be a bit more forgiving.
if ("MODS".equalsIgnoreCase(manifest.getMdType(dmds[i])))
{
found = i;
}
}
}
// DC acceptable if no MODS
if (found == -1)
{
for (int i = 0; i < dmds.length; ++i)
{
//NOTE: METS standard actually says this should be DC (all uppercase). But,
// just in case, we're going to be a bit more forgiving.
if ("DC".equalsIgnoreCase(manifest.getMdType(dmds[i])))
{
found = i;
}
}
}
String groupID = null;
if (found >= 0)

View File

@@ -590,7 +590,9 @@ public class METSManifest
String id = mdSec.getAttributeValue("ID");
StringBuffer sb = new StringBuffer();
for (Iterator mi = mdc.iterator(); mi.hasNext();)
{
sb.append(", ").append(((Content)mi.next()).toString());
}
throw new MetadataValidationException("Cannot parse METS with "+mdSec.getQualifiedName()+" element that contains more than one child, size="+String.valueOf(mdc.size())+", ID="+id+"Kids="+sb.toString());
}
Element mdRef = null;
@@ -905,7 +907,9 @@ public class METSManifest
Element result[] = new Element[dmdID.length];
for (int i = 0; i < dmdID.length; ++i)
{
result[i] = getElementByXPath("mets:dmdSec[@ID=\""+dmdID[i]+"\"]", false);
}
return result;
}
@@ -964,13 +968,19 @@ public class METSManifest
{
Element amdSec = getElementByXPath("mets:amdSec[@ID=\""+amdID+"\"]", false);
for (Iterator ti = amdSec.getChildren("techMD", metsNS).iterator(); ti.hasNext();)
{
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
}
for (Iterator ti = amdSec.getChildren("digiprovMD", metsNS).iterator(); ti.hasNext();)
{
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
}
for (Iterator ti = amdSec.getChildren("rightsMD", metsNS).iterator(); ti.hasNext();)
{
crosswalkXmd(context, params, dso, (Element)ti.next(), callback);
}
}
}
/**
* Just crosswalk the sourceMD sections; used to set the handle and parent of AIP.
@@ -1150,11 +1160,15 @@ public class METSManifest
{
Element amdSec = getElementByXPath("mets:amdSec[@ID=\""+amdID[i]+"\"]", false);
for (Iterator ti = amdSec.getChildren("techMD", metsNS).iterator(); ti.hasNext();)
{
crosswalkXmd(context, params, bitstream, (Element)ti.next(), callback);
}
for (Iterator ti = amdSec.getChildren("sourceMD", metsNS).iterator(); ti.hasNext();)
{
crosswalkXmd(context, params, bitstream, (Element)ti.next(), callback);
}
}
}
/**
* @return root element of METS document.

View File

@@ -242,7 +242,9 @@ public class RoleDisseminator implements PackageDisseminator
writer.writeStartElement(GROUPS);
for (Group group : groups)
{
writeGroup(context, object, group, writer);
}
writer.writeEndElement(); // GROUPS
}
@@ -253,7 +255,9 @@ public class RoleDisseminator implements PackageDisseminator
writer.writeStartElement(EPERSONS);
for (EPerson eperson : people)
{
writeEPerson(eperson, writer, emitPasswords);
}
writer.writeEndElement(); // EPERSONS
}

View File

@@ -229,7 +229,9 @@ public class RoleIngester implements PackageIngester
if (params.replaceModeEnabled()) // -r -f
{
for (Group member : collider.getMemberGroups())
{
collider.removeMember(member);
}
for (EPerson member : collider.getMembers())
{
// Remove all group members *EXCEPT* we don't ever want

View File

@@ -730,10 +730,14 @@ public class PluginManager
val = val.trim();
String classname[] = val.split("\\s*,\\s*");
for (int i = 0; i < classname.length; ++i)
{
if (checkClassname(classname[i], "implementation class"))
{
allImpls.put(classname[i], classname[i]);
}
}
}
}
// 3. self-named plugins - grab and check all values
// then make sure it is a subclass of SelfNamedPlugin
@@ -749,11 +753,13 @@ public class PluginManager
val = val.trim();
String classname[] = val.split("\\s*,\\s*");
for (int i = 0; i < classname.length; ++i)
{
if (checkClassname(classname[i], "selfnamed implementation class"))
{
allImpls.put(classname[i], classname[i]);
checkSelfNamed(classname[i]);
}
}
checkNames(key);
}
}

View File

@@ -463,13 +463,19 @@ public class Event implements Serializable
{
int result = 0;
for (int i = 0; i < eventTypeText.length; ++i)
{
result |= (1 << i);
}
return result;
}
for (int i = 0; i < eventTypeText.length; ++i)
{
if (eventTypeText[i].equalsIgnoreCase(s))
{
return 1 << i;
}
}
return 0;
}
@@ -571,10 +577,16 @@ public class Event implements Serializable
private static int log2(int n)
{
for (int i = 0; i < 32; ++i)
{
if (n == 1)
{
return i;
}
else
{
n = n >> 1;
}
}
return -1;
}

View File

@@ -812,10 +812,14 @@ public class DSIndexer
int i = 0;
for (i = 0; i < communities.length; i++)
{
location.append(" m").append(communities[i].getID());
}
for (i = 0; i < collections.length; i++)
{
location.append(" l").append(collections[i].getID());
}
return location.toString();
}
@@ -831,7 +835,9 @@ public class DSIndexer
int i = 0;
for (i = 0; i < communities.length; i++)
{
location.append(" m").append(communities[i].getID());
}
return location.toString();
}

View File

@@ -357,7 +357,9 @@ public class SortOption
public static SortOption getDefaultSortOption() throws SortException
{
for (SortOption so : getSortOptions())
{
return so;
}
return null;
}

View File

@@ -38,12 +38,7 @@
package org.dspace.text.filter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import org.apache.commons.lang.StringUtils;
import org.dspace.core.ConfigurationManager;
@@ -292,7 +287,9 @@ public class MARC21InitialArticleWord extends InitialArticleWord
String[] words = new String[wordList.size()];
for (int idx = 0; idx < wordList.size(); idx++)
{
words[idx] = (String)wordList.get(idx);
}
// Sort the array into length order - longest to shortest
// This ensures maximal matching on the article words

View File

@@ -152,8 +152,12 @@ public class WorkflowManager
public static int getWorkflowID(String state)
{
for (int i = 0; i < workflowText.length; ++i)
{
if (state.equalsIgnoreCase(workflowText[i]))
{
return i;
}
}
return -1;
}

View File

@@ -571,10 +571,14 @@ public class SolrServiceImpl implements SearchService, IndexingService {
int i = 0;
for (i = 0; i < communities.length; i++)
{
locations.add(new String("m" + communities[i].getID()));
}
for (i = 0; i < collections.length; i++)
{
locations.add(new String("l" + collections[i].getID()));
}
return locations;
}

View File

@@ -112,7 +112,9 @@ public class FlowGroupUtils {
String[] epeopleIDs = new String[epeople.length];
for (int i=0; i < epeople.length; i++)
{
epeopleIDs[i] = String.valueOf(epeople[i].getID());
}
return epeopleIDs;
}
@@ -138,7 +140,9 @@ public class FlowGroupUtils {
String[] groupIDs = new String[groups.length];
for (int i=0; i < groups.length; i++)
{
groupIDs[i] = String.valueOf(groups[i].getID());
}
return groupIDs;
}
@@ -270,10 +274,14 @@ public class FlowGroupUtils {
// Second, Prepare to check members by turning arrays into lists
List<Integer> newEPeopleIDs = new ArrayList<Integer>();
for (String epeopleID : newEPeopleIDsArray)
{
newEPeopleIDs.add(Integer.valueOf(epeopleID));
}
List<Integer> newGroupIDs = new ArrayList<Integer>();
for (String _groupID : newGroupIDsArray)
{
newGroupIDs.add(Integer.valueOf(_groupID));
}
// Third, check if there are any members to remove

View File

@@ -159,7 +159,9 @@ public class FlowRegistryUtils
// First remove and fields in the schema
MetadataField[] fields = MetadataField.findAllInSchema(context, schema.getSchemaID());
for (MetadataField field : fields)
{
field.delete(context);
}
// Once all the fields are gone, then delete the schema.
schema.delete(context);
@@ -459,8 +461,12 @@ public class FlowRegistryUtils
// Remove leading periods from file extensions.
for (int i = 0; i < extensions.length; i++)
{
if (extensions[i].startsWith("."))
{
extensions[i] = extensions[i].substring(1);
}
}
// Get or create the format

View File

@@ -125,14 +125,18 @@ public class AdvacedAuthorizationsForm extends AbstractDSpaceTransformer
groupSelect.setMultiple(true);
groupSelect.setSize(15);
for (Group group : Group.findAll(context, Group.NAME))
{
groupSelect.addOption(false, group.getID(), group.getName());
}
// Grant the ability to perform the following action...
actionsList.addItem().addContent(T_actions_actionSentence);
actionsList.addLabel(T_actions_policyAction);
Select actionSelect = actionsList.addItem().addSelect("action_id");
for( int i = 0; i < Constants.actionText.length; i++ )
{
actionSelect.addOption(i, Constants.actionText[i]);
}
// For all following object types...
actionsList.addItem().addContent(T_actions_resourceSentence);
@@ -148,7 +152,9 @@ public class AdvacedAuthorizationsForm extends AbstractDSpaceTransformer
collectionsSelect.setMultiple(true);
collectionsSelect.setSize(15);
for (Collection collection : Collection.findAll(context))
{
collectionsSelect.addOption(false, collection.getID(), collection.getMetadata("name"));
}
Para buttons = main.addPara();

View File

@@ -115,8 +115,10 @@ public class AuthorizationMain extends AbstractDSpaceTransformer
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
Division main = body.addInteractiveDivision("authorization-main",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
main.setHead(T_main_head);

View File

@@ -174,8 +174,10 @@ public class EditPolicyForm extends AbstractDSpaceTransformer
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
/* Set up our current Dspace object */

View File

@@ -151,7 +151,9 @@ public class AddEPersonForm extends AbstractDSpaceTransformer
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
String emailValue = request.getParameter("email_address");

View File

@@ -199,7 +199,9 @@ public class EditEPersonForm extends AbstractDSpaceTransformer
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
// Grab the person in question

View File

@@ -266,9 +266,13 @@ public class EditGroupForm extends AbstractDSpaceTransformer
if (memberEPeopleIDsString != null)
{
for (String id : memberEPeopleIDsString.split(","))
{
if (id.length() > 0)
{
memberEPeopleIDs.add(Integer.valueOf(id));
}
}
}
// Get highlight parameters
int highlightEPersonID = parameters.getParameterAsInteger("highlightEPersonID",-1);
@@ -283,10 +287,12 @@ public class EditGroupForm extends AbstractDSpaceTransformer
String errorString = parameters.getParameter("errors",null);
ArrayList<String> errors = new ArrayList<String>();
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
//DIVISION: group-edit
Division main = body.addInteractiveDivision("group-edit",contextPath+"/admin/groups",Division.METHOD_POST,"primary administrative groups");

View File

@@ -85,8 +85,12 @@ public class FindItemForm extends AbstractDSpaceTransformer {
String errorString = parameters.getParameter("errors",null);
ArrayList<String> errors = new ArrayList<String>();
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
// DIVISION: find-item
Division findItem = body.addInteractiveDivision("find-item",contextPath + "/admin/item", Division.METHOD_GET,"primary administrative item");

View File

@@ -139,8 +139,12 @@ public class EditBitstreamFormat extends AbstractDSpaceTransformer
String errorString = parameters.getParameter("errors",null);
ArrayList<String> errors = new ArrayList<String>();
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
Request request = ObjectModelHelper.getRequest(objectModel);
String mimetypeValue = request.getParameter("mimetype");
@@ -153,8 +157,12 @@ public class EditBitstreamFormat extends AbstractDSpaceTransformer
// Remove leading periods from file extensions.
for (int i = 0; i < extensionValues.length; i++)
{
if (extensionValues[i].startsWith("."))
{
extensionValues[i] = extensionValues[i].substring(1);
}
}
if (format != null)
{

View File

@@ -161,8 +161,10 @@ public class EditMetadataSchema extends AbstractDSpaceTransformer
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
// DIVISION: edit-schema

View File

@@ -125,7 +125,9 @@ public class MetadataRegistryMain extends AbstractDSpaceTransformer
if (errorString != null)
{
for (String error : errorString.split(","))
{
errors.add(error);
}
}
MetadataSchema[] schemas = MetadataSchema.findAll(context);

View File

@@ -372,7 +372,9 @@ public class CommunityBrowser extends AbstractDSpaceTransformer implements Cache
Stack<TreeNode> stack = new Stack<TreeNode>();
for (Community community : communities)
{
stack.push(newRoot.addChild(community));
}
while (!stack.empty())
{

View File

@@ -376,13 +376,17 @@ public class EditProfile extends AbstractDSpaceTransformer
{
String name = possible.getMetadata("name");
if (name.length() > 50)
{
name = name.substring(0, 47) + "...";
}
subscriptions.addOption(possible.getID(), name);
}
for (Collection collection: currentList)
{
subscriptions.addInstance().setOptionSelected(collection.getID());
}
}
if (allowSetPassword)

View File

@@ -188,8 +188,12 @@ public class DSpaceLocaleAction extends ServiceableAction implements Configurabl
// Otherwise check if they are listed
for (Locale locale : supportedLocales)
{
if (locale.equals(test))
{
return true;
}
}
// Fail if not found
return false;

View File

@@ -159,7 +159,7 @@ public class OpenSearchGenerator extends AbstractGenerator
if (this.validity == null)
{
long expiry = System.currentTimeMillis() +
ConfigurationManager.getIntProperty("websvc.opensearch.validity") * 60 * 60 * 1000;
ConfigurationManager.getLongProperty("websvc.opensearch.validity") * 60 * 60 * 1000;
this.validity = new ExpiresValidity(expiry);
}
return this.validity;

View File

@@ -333,11 +333,15 @@ public class RepositoryAdapter extends AbstractAdapter
if (dso instanceof Community)
{
for (DSpaceObject child : ((Community)dso).getCollections())
{
renderStructuralDiv(child);
}
for (DSpaceObject child : ((Community)dso).getSubcommunities())
{
renderStructuralDiv(child);
}
}
// ////////////////////
// Close division

View File

@@ -224,7 +224,9 @@ public class AuthenticationUtil
int[] groupIDs = AuthenticationManager.getSpecialGroups(context,
request);
for (int groupID : groupIDs)
{
context.setSpecialGroup(groupID);
}
// and the remote IP address to compare against later requests
// so we can detect session hijacking.
@@ -303,8 +305,10 @@ public class AuthenticationUtil
// Set any special groups - invoke the authentication mgr.
int[] groupIDs = AuthenticationManager.getSpecialGroups(context, request);
for (int groupID : groupIDs)
{
context.setSpecialGroup(groupID);
}
}
else
{
// Possible hack attempt.
@@ -366,7 +370,9 @@ public class AuthenticationUtil
// Set any special groups - invoke the authentication mgr.
int[] groupIDs = AuthenticationManager.getSpecialGroups(context,request);
for (int groupID : groupIDs)
{
context.setSpecialGroup(groupID);
}
// Set both the effective and authenticated user to the same.
session.setAttribute(EFFECTIVE_USER_ID, loginAs.getID());

View File

@@ -260,11 +260,17 @@ public class Include extends AbstractTransformer implements CacheableProcessingC
Element foundChild = null;
for (Element child : getElementList(peek))
{
if (isEqual(child, uri, localName, qName, attributes))
{
foundChild = child;
}
}
if (foundChild != null)
{
peek.removeChild(foundChild);
}
stack.push(foundChild);
}
@@ -304,9 +310,11 @@ public class Include extends AbstractTransformer implements CacheableProcessingC
//getLogger().debug("startElement: streaming");
for (Node node : getNodeList(poped))
{
streamer.stream(node);
}
}
}
super.endElement(uri, localName, qName);
}

View File

@@ -262,7 +262,9 @@ public class Body extends AbstractWingElement implements WingMergeableElement
public void dispose()
{
for (Division division : divisions)
{
division.dispose();
}
super.dispose();
}

View File

@@ -111,7 +111,9 @@ public abstract class Container extends AbstractWingElement
if (this.contents != null)
{
for (AbstractWingElement element : contents)
{
element.dispose();
}
this.contents.clear();
}
this.contents = null;

View File

@@ -944,7 +944,9 @@ public class Division extends AbstractWingElement implements StructuralElement,
head.dispose();
head = null;
for (AbstractWingElement content : contents)
{
content.dispose();
}
if (contents != null)
contents.clear();
contents = null;

View File

@@ -494,8 +494,12 @@ public abstract class Field extends AbstractWingElement implements
{
List<Value> found = new ArrayList<Value>();
for (Value value : values)
{
if (value.getType().equals(removeType))
{
found.add(value);
}
}
for (Value remove : found)
{
@@ -546,19 +550,29 @@ public abstract class Field extends AbstractWingElement implements
help.toSAX(contentHandler, lexicalHandler, namespaces);
for (Error error : errors)
{
error.toSAX(contentHandler, lexicalHandler, namespaces);
}
for (Field field : fields)
{
field.toSAX(contentHandler, lexicalHandler, namespaces);
}
for (Option option : options)
{
option.toSAX(contentHandler, lexicalHandler, namespaces);
}
for (Value value : values)
{
value.toSAX(contentHandler, lexicalHandler, namespaces);
}
for (Instance instance : instances)
{
instance.toSAX(contentHandler, lexicalHandler, namespaces);
}
endElement(contentHandler, namespaces, E_FIELD);
}
@@ -569,38 +583,64 @@ public abstract class Field extends AbstractWingElement implements
public void dispose()
{
if (params != null)
{
params.dispose();
}
if (label != null)
{
label.dispose();
}
if (help != null)
{
help.dispose();
}
for (Error error : errors)
{
error.dispose();
}
if (errors != null)
{
errors.clear();
}
for (Field field : fields)
{
field.dispose();
}
if (fields != null)
{
fields.clear();
}
for (Option option : options)
{
option.dispose();
}
if (options != null)
{
options.clear();
}
for (Value value : values)
{
value.dispose();
}
if (values != null)
{
values.clear();
}
for (Instance instance : instances)
{
instance.dispose();
}
if (instances != null)
{
instances.clear();
}
params = null;

View File

@@ -552,14 +552,20 @@ public class List extends AbstractWingElement implements WingMergeableElement,
}
if (childMerged == false && head != null)
{
head.toSAX(contentHandler, lexicalHandler, namespaces);
}
for (AbstractWingElement content : contents)
{
content.toSAX(contentHandler, lexicalHandler, namespaces);
}
if (this.merged == false)
{
endElement(contentHandler, namespaces, E_LIST);
}
}
/**
* dispose
@@ -567,10 +573,14 @@ public class List extends AbstractWingElement implements WingMergeableElement,
public void dispose()
{
if (head != null)
{
head.dispose();
}
head = null;
for (AbstractWingElement content : contents)
{
content.dispose();
}
contents.clear();
contents = null;
super.dispose();

View File

@@ -211,7 +211,9 @@ public class Options extends AbstractWingElement implements
}
for (AbstractWingElement content : contents)
{
content.toSAX(contentHandler, lexicalHandler, namespaces);
}
if (!merged)
{
@@ -225,7 +227,9 @@ public class Options extends AbstractWingElement implements
public void dispose()
{
for (AbstractWingElement content : contents)
{
content.dispose();
}
contents.clear();
contents = null;
super.dispose();

View File

@@ -262,7 +262,9 @@ public class PageMeta extends AbstractWingElement implements
if (WingConstants.DRI.URI.equals(namespace) && Trail.E_TRAIL.equals(localName))
{
for (Trail trail : trails)
{
trail.dispose();
}
trails.clear();
}
@@ -324,14 +326,20 @@ public class PageMeta extends AbstractWingElement implements
}
for (Metadata metadata : metadatum)
{
metadata.toSAX(contentHandler, lexicalHandler, namespaces);
}
for (Trail trail : trails)
{
trail.toSAX(contentHandler, lexicalHandler, namespaces);
}
if (!merged)
{
endElement(contentHandler, namespaces, E_PAGE_META);
}
}
/**
* dispose
@@ -339,10 +347,14 @@ public class PageMeta extends AbstractWingElement implements
public void dispose()
{
for (Metadata metadata : metadatum)
{
metadata.dispose();
}
for (Trail trail : trails)
{
trail.dispose();
}
trails.clear();
trails = null;

View File

@@ -200,9 +200,13 @@ public class Reference extends AbstractWingElement implements
public void dispose()
{
for (AbstractWingElement content : contents)
{
content.dispose();
}
if (contents != null)
{
contents.clear();
}
contents = null;
super.dispose();
}

View File

@@ -235,9 +235,13 @@ public class ReferenceSet extends AbstractWingElement implements
public void dispose()
{
for (AbstractWingElement content : contents)
{
content.dispose();
}
if (contents != null)
{
contents.clear();
}
contents = null;
super.dispose();
}

View File

@@ -298,7 +298,9 @@ public class Row extends AbstractWingElement implements StructuralElement
startElement(contentHandler, namespaces, E_ROW, attributes);
for (AbstractWingElement content : contents)
{
content.toSAX(contentHandler, lexicalHandler, namespaces);
}
endElement(contentHandler, namespaces, E_ROW);
}
@@ -308,7 +310,9 @@ public class Row extends AbstractWingElement implements StructuralElement
public void dispose()
{
for (AbstractWingElement content : contents)
{
content.dispose();
}
contents.clear();
contents = null;
super.dispose();

View File

@@ -242,7 +242,9 @@ public class Table extends AbstractWingElement implements StructuralElement
if (head != null)
head.toSAX(contentHandler, lexicalHandler, namespaces);
for (AbstractWingElement content : contents)
{
content.toSAX(contentHandler, lexicalHandler, namespaces);
}
endElement(contentHandler, namespaces, E_TABLE);
}
@@ -252,9 +254,13 @@ public class Table extends AbstractWingElement implements StructuralElement
public void dispose()
{
if (head != null)
{
head.dispose();
}
for (AbstractWingElement content : contents)
{
content.dispose();
}
head = null;
contents.clear();

View File

@@ -315,11 +315,15 @@ public class UserMeta extends AbstractWingElement implements
}
for (Metadata metadata : metadatum)
{
metadata.toSAX(contentHandler, lexicalHandler, namespaces);
}
if (!merged)
{
endElement(contentHandler, namespaces, E_USER_META);
}
}
/**
* dispose
@@ -327,7 +331,9 @@ public class UserMeta extends AbstractWingElement implements
public void dispose()
{
for (AbstractWingElement content : metadatum)
{
content.dispose();
}
metadatum.clear();
metadatum = null;
super.dispose();